You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create a new API key through UI
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" }'
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:
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].
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].
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].
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.
Search before asking
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
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
Version
v1.0.2-beta3@7cf1a60
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: