Error codes and troubleshooting
When a call fails, the HTTP code and the message returned usually point to the cause. This page lists the codes you may run into and the fixes for the most common problems.
Error codes
Generated APIs
These codes are returned when you call one of your APIs. Most errors have a JSON body like {"message": "..."}.
| Code | Message | Cause | Solution |
|---|---|---|---|
| 400 | You must provide a collection name | The endpoint has no collection (or table) attached. | Choose a collection in the endpoint's Execution Request step. |
| 400 | You need to provide a pageNumber and pageSize | The endpoint is paginated and a pagination parameter is missing. | Add pageNumber and pageSize to the URL. |
| 400 | Invalid JSON format, The username field and password field are required. | The body sent to /signin is invalid or incomplete. | Send a JSON body with username and password. |
| 400 | The username field is required, The email field is required and must be a valid email address… | A field is missing or invalid in the body sent to /signup. | Fill in the field named in the message. |
| 401 | You need to provide a JWT | The endpoint is secured and no token was sent. | Add the Authorization: Bearer <token> header. |
| 401 | Expired JWT token. | The token has expired. | Call /signin to get a new token. |
| 401 | Invalid JWT signature., Unsupported JWT token. | The token is incomplete, altered or comes from another project. | Use a token obtained with /signin on this API. |
| 401 | You don't have the permission to use this secured API. | The user has none of the endpoint's access roles. | Give them an allowed role, or change the endpoint's access roles. |
| 401 | Wrong Credentials | Wrong username or password on /signin. | Check the credentials. |
| 403 | You cannot delete an admin | /deleteuser targets an administrator (NoSQL databases). | First remove the admin role from this user with /grant. |
| 404 | This API URL is not valid or no longer exists. | No endpoint matches this path and method in the release. | Check the runtime URL, the path and the method. |
| 404 | Username does not exist, This role does not exist. Please enter a valid role. | The user or role sent to /grant doesn't exist. | Check the username and the project's roles. |
| 406 | — | A value in the request was refused (NoSQL databases). | Check the values you sent. |
| 409 | User with current username already exists | The username is already taken on /signup (NoSQL databases). | Choose another username. |
| 500 | — | Unexpected error during execution (SQL databases). The body contains the error message. | Read the message, check the endpoint's query, then try again. |
Depending on the database
The same execution error, for example incomplete pagination, is returned as 400 on NoSQL databases and as 500 on SQL databases.
The Grizzly platform
These codes relate to the Grizzly interface, when you manage your projects, data sources or endpoints. They are usually shown as a notification.
| Code | Cause | Solution |
|---|---|---|
| 400 | Request refused or invalid data. | Read the message and correct your input. |
| 401 | Credentials refused or unauthorized access. | Sign in to Grizzly again. |
| 404 | Item not found: project, release, data source… | Reload the page; the item may have been deleted. |
| 406 | A value you entered was refused. | Check the form fields. |
| 500 | Failed to retrieve the BigQuery projects and datasets, with a service account or a Google account. | Check the key or account used, then try the connection again. |
Troubleshooting
The connection to a data source fails
Test connection shows Fail to connect to DataSource, please check parameters !.
- Check the host, port, database name, user and password.
- Check that the database can be reached from the Internet: a firewall or an IP allow list can block the connection.
- For a connection by URI, check the whole string.
The token is refused or has expired (401)
- Check that the header is exactly
Authorization: Bearer <token>. - If the message is
Expired JWT token., call/signinagain: by default, the token expires after one hour. - If
/signinanswersYour account will be activated soon by the admin, the account must first be activated by an administrator. - If the message is
You don't have the permission to use this secured API., compare the user's roles with the endpoint's access roles.
The endpoint returns an empty response or a 404 error
- A
404error withThis API URL is not valid or no longer exists.means the path or the method doesn't match any endpoint. Check the runtime URL, the path and the method. - An empty list
[]means the query finds no data. If an expected parameter isn't sent, its value is empty in the query and the filter finds nothing: check the parameters in the URL. - Check the collection or table chosen in the Execution Request step.
A custom function returns an error
When an input or output function fails, the API returns:
{"customException": "..."}with the HTTP code chosen by the function, if it sets one;- otherwise
{"exception": "..."}with the code400.
The message Invalid document to insert, please check your input function means the input function didn't return a valid document to save. Test the function on its own, then check what it returns. See Functions.
The free plan limit is reached
The free plan lets you create 3 APIs, 3 data sources and 3 flows. Beyond that, creation is refused and the interface shows, for example:
- "You have reached the 3 APIs limit. Upgrade to a higher plan to continue."
- "You have reached the 3 flows limit. Upgrade to a higher plan to continue."
- "Data source Limit Reached!"
For a project, the platform answers with the code 200 and the body {"code": "-1", "message": "Microservice limit reached!"}: it isn't an HTTP error.
Delete an item you no longer need, or upgrade to a higher plan (see Free plan limits).
Contact support
If the problem persists, write to us at contact@grizzly-api.com with:
- the project and release name;
- the endpoint called (method and path);
- the date and time of the call;
- the HTTP code and error message received.
DANGER
Never send a password, a token or a secret key in your message.
What's next?
- Call an API: build a correct request.
- Security: roles and tokens.
- Data sources: connect your database.
