Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Customize] Create new field not working #8173

Open
2 of 3 tasks
sstojak1 opened this issue Oct 31, 2024 · 1 comment
Open
2 of 3 tasks

[Bug][Customize] Create new field not working #8173

sstojak1 opened this issue Oct 31, 2024 · 1 comment
Labels
severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@sstojak1
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When attempting to create a new field with the Customize plugin, the request returns a 500 status code. Screenshots of the API key and error code are attached.

What do you expect to happen

New field to be created successfully.

How to reproduce

  1. Create a new API key through UI
  2. Run the following curl:
    curl --location 'https://my-devlake-endpoint/api/rest/plugins/customize/issues/fields' \ --header 'accept: application/json' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <my_api_key>' \ --data '{ "columnName": "x_test", "dataType": "varchar(255)", "displayName":"test" }'

Anything else

image
image

Version

v1.0.2-beta3@7cf1a60

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@sstojak1 sstojak1 added the type/bug This issue is a bug label Oct 31, 2024
@dosubot dosubot bot added the severity/p1 This bug affects functionality or significantly affect ux label Oct 31, 2024
Copy link

dosubot bot commented Oct 31, 2024

The 500 status code indicates an internal server error, which can occur due to several reasons when creating a new field with the Customize plugin. Here are some potential causes and steps to diagnose the issue:

  1. Field Validation: Ensure that the columnName starts with "x_" and matches the regular expression ^x_[a-zA-Z0-9_]{0,50}$. The displayName must not be empty, and the dataType must be one of the supported types: varchar(255), text, bigint, float, timestamp [1].

  2. Database Operations: The error might occur during database operations such as creating the field or adding a column. Check if there are any database constraints or issues with the database connection that might be causing the error [2].

  3. Error Handling: The CreateField service method includes error handling that wraps errors with errors.Default.Wrap. If an unexpected error occurs during the execution of this method, it could result in a 500 status code [2].

  4. Middleware and Global Error Handling: The DevLake backend has middleware that handles errors globally. This could affect how errors are reported for the Customize plugin. Check the logs for any error messages or stack traces that might provide more details about the issue [3].

To further diagnose the issue, review the server logs for any specific error messages or stack traces that occur when the 500 error is returned. This information can help pinpoint the exact cause of the error.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant