Checklist
Description
auth0 users create fails with "There are currently no active database or passwordless connections to choose from" when a connection has enabled_clients: null in the API response (the default, meaning enabled for all applications).
The root cause is in internal/cli/users.go — databaseAndPasswordlessConnectionOptions() filters connections with:
if len(connection.GetEnabledClients()) == 0 {
continue
}
GetEnabledClients() returns nil when enabled_clients is null. In Go, len(nil) == 0 is true, so connections enabled for all apps are incorrectly skipped, same as connections explicitly disabled (empty slice).
Same bug in 3 places: createUserCmd() (line 407), importUsersCmd() (line 897), databaseAndPasswordlessConnectionOptions() (line 999).
Expectation
auth0 users create should succeed when the connection has enabled_clients: null, since null means enabled for all applications.
Reproduction
- Have a tenant with a
Username-Password-Authentication connection where enabled_clients is null (the default)
- Verify the connection works:
auth0 api post "users" --data '{"connection":"Username-Password-Authentication","email":"test@example.com","name":"Test","password":"Test12345!","email_verified":true}' — succeeds
- Try:
auth0 users create -c "Username-Password-Authentication" -e "test@example.com" -n "Test" -p "Test12345!" --no-input — fails with "no active database or passwordless connections"
Same connection, same tenant — Management API works, users create does not.
Auth0 CLI version
1.31.0 (also reproduced on 1.29.0)
Fix
Draft PR with fix and local test verification: #1532
Checklist
Description
auth0 users createfails with "There are currently no active database or passwordless connections to choose from" when a connection hasenabled_clients: nullin the API response (the default, meaning enabled for all applications).The root cause is in
internal/cli/users.go—databaseAndPasswordlessConnectionOptions()filters connections with:GetEnabledClients()returnsnilwhenenabled_clientsis null. In Go,len(nil) == 0istrue, so connections enabled for all apps are incorrectly skipped, same as connections explicitly disabled (empty slice).Same bug in 3 places:
createUserCmd()(line 407),importUsersCmd()(line 897),databaseAndPasswordlessConnectionOptions()(line 999).Expectation
auth0 users createshould succeed when the connection hasenabled_clients: null, since null means enabled for all applications.Reproduction
Username-Password-Authenticationconnection whereenabled_clientsis null (the default)auth0 api post "users" --data '{"connection":"Username-Password-Authentication","email":"test@example.com","name":"Test","password":"Test12345!","email_verified":true}'— succeedsauth0 users create -c "Username-Password-Authentication" -e "test@example.com" -n "Test" -p "Test12345!" --no-input— fails with "no active database or passwordless connections"Same connection, same tenant — Management API works,
users createdoes not.Auth0 CLI version
1.31.0 (also reproduced on 1.29.0)
Fix
Draft PR with fix and local test verification: #1532