"Sandbox Error: connect ECONNREFUSED 127.0.0.1:443" error when create user in custom DB

Problem statement

Using the management API, we were able to create a user for our custom database connection earlier, but now we are getting the error:

Sandbox Error: connect ECONNREFUSED 127.0.0.1:443

Solution

The error was caused by the Custom Database connection create user script. The connection to the legacy database endpoint to create a user is timing out.

If you can normally connect to your legacy database endpoint on your network, it could be that this endpoint is behind a firewall and doesn’t allow a connection from Auth0 IPs. If so, please add the following IPs to the allowed list: