Open sstojak1 opened 3 weeks ago
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
displayNamemust not be empty, and the
dataTypemust 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.
To continue talking to Dosu, mention @dosu.
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