Getting a 500 status code when performing a sign-up request

I am getting an Auth0Exception with message:

Request failed with status code 500: Unknown exception

whenever I execute a SignUpRequest.

SignUpRequest request = authAPI.signUp(email, password, connection).setCustomFields(fields);
request.execute();

What could possibly be causing the error?

The most common cause for issues like a 500 error or a Sandbox Error during a signup request would be to have a custom hook that runs for pre-registration and that custom code throwing an unhandled exception. For example, the hook logic did not consider for some scenario with the signup data being processed and/or makes calls to external services that temporarily experienced an issue.

The above is easy to rule out if you don’t have hooks enabled; if that’s the case, another possibility would be the use of a custom database connection with migration enabled. In this situation, the sign-up would trigger a call into the custom database scripts to check if the user already exists (the get user script would be called). If this script call also fails then I believe it could also trigger the error in question. A custom database with no import could also be the culprit, but here you would already expect that if a signup fails it may have to do with the custom database itself. The case of the migration is not so obvious as new users are created in Auth0 and not on the custom database itself, however, there’s still the need to check user existence on the legacy store.

The recommendation would be for you to check if any of the above can be a possibility. If you rule out both, then you may need to provide additional information as a question update.

Currently any error returned from a hook, handled or not, will result in a generic ‘Sandbox Error’.

See the note at the bottom of this page: https://auth0.com/docs/hooks/extensibility-points/pre-user-registration

The Pre-Registration Hook does not currently pass error messages to any Auth0 APIs.