Auth0 Home Blog Docs

Sandbox Error: Internal server error for user creation

developer-plan
python

#1

User creation through the Python lib is returning a 400 without any useful message. Looks like it might even be an upstream error. This is for a developer account.

>>> from auth0.v3.management import Auth0
>>> from apps.accounts.utils import auth0_mgmt_api_token
>>> from django.conf import settings
>>> client = Auth0(settings.AUTH0'domain'], auth0_mgmt_api_token())
>>> client.users.create({'connection': settings.AUTH0'connection'], 'email': 'from-console@example.com', 'password': 'test123'})
{'statusCode': 400, 'message': 'Sandbox Error: Internal server error', 'error': 'Bad Request'}

This in contrast to a similar request which helpfully shows what is wrong with the request:

>>> client.users.create({'connection': settings.AUTH0'connection'], 'email': 'from-console@example.com'})
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/env/lib/python3.5/site-packages/auth0/v3/management/users.py", line 75, in create
    return self.client.post(self._url(), data=body)
  File "/env/lib/python3.5/site-packages/auth0/v3/management/rest.py", line 64, in post
    return self._process_response(response)
  File "/env/lib/python3.5/site-packages/auth0/v3/management/rest.py", line 111, in _process_response
    message=text'message'])
auth0.v3.exceptions.Auth0Error: 400: Payload validation error: 'Missing required property: password'.

#2

The SDK itself is just relaying information and in some situations there’s no more information to share, in particular, that’s a public endpoint so very detailed error information can also be a problem all by itself.

In relation to the underlying issue, the recommendation would be for you to check the possible root causes listed at this other similar question:

https://community.auth0.com/questions/9517/request-failed-with-status-code-500-unknown-except


#3

@jmangelo thanks! i believe there was an error with a pre-registration hook.


#4

Unfortunately, i guess the hook is working fine, just that the underlying error message cannot propagate back to the response:

https://community.auth0.com/questions/7197/how-to-return-meaningful-error-after-pre-user-regi

That’s a bummer.


#5

@jmangelo thanks! i believe there was an error with a pre-registration hook.


#6

Yes, that’s correct, if the hook was throwing an error intentionally at this time this will only be conveyed as an error without the possibility to provide specific information to distinguish root causes.


#7