Sub topic 13
Fixing common sign-up and login problems
This chapter assumes you have read the earlier chapters on the sign-up form, usernames, email verification, multi-factor authentication (MFA) and My Domain. It also assumes you can run commands in a terminal for the CLI section. The goal is to help you work out where a failure happened, and which setting or step caused it. Searching for the error text comes second.
Start by locating the stage that failed
Getting into a Developer Edition org involves four separate stages, and each fails in its own way:
- Sign-up: the form is accepted and Salesforce creates the org and user.
- Verification: you receive an email, follow its link and set a password.
- Authentication: you log in and prove your identity, usually with MFA.
- Tooling access: the Salesforce CLI is authorized against the org.
A problem at stage 1 or 2 usually concerns the username or email delivery. A problem at stage 3 usually concerns the login URL, the password, or the MFA method. A problem at stage 4 usually concerns which org the browser is logged into.
Sign-up errors
The username is already taken
The form rejects a username that is already in use. A username has to look like an email address, such as [email protected]. It does not have to be a real mailbox, but it must be unique across all Salesforce orgs, not only your own. Common names are often taken.
The usual fix is to make the username more specific. Add your role, a year, or the purpose of the org, for example [email protected]. The email address field is separate from the username. You can use the same real email address for several orgs, as long as each org has a different username.
The form reports an invalid or malformed username
Check for these problems:
- A missing
@or domain part. - Spaces anywhere in the value.
- Characters that cannot appear in an email-style string.
- A username longer than the field allows.
Retype the value by hand instead of pasting it. Pasted text sometimes carries invisible trailing spaces.
A browser extension blocks the form
Ad blockers and strict privacy extensions can block the scripts the form uses, or the CAPTCHA, if one is shown. If the Submit button does nothing, try a private window with extensions disabled.
The verification email never arrives
After you submit the form, Salesforce sends a message to the email address you entered. That message contains the link that lets you set your first password. If it does not arrive:
- Wait a few minutes. Delivery is not always instant.
- Search all folders, including spam, junk, and any "promotions" tab, for the word "Salesforce".
- Check the address you typed. A typo means the message went to someone else, and you cannot recover it.
- Look for filtering rules on a corporate or school mailbox. These systems often quarantine messages from new senders.
- If nothing arrives, repeat the sign-up with a different username and a mailbox you control, such as a personal address.
The link has expired or was already used
The verification link is meant for one use and stops working after a limited time. If you see an "invalid or expired link" page, go to the login page and choose Forgot Your Password?. Enter your username, and Salesforce sends a new reset link to the email address on the user record. This only works if the org and user were created in the first place. If the reset fails with an unknown username, the original sign-up probably never completed, so sign up again with a new username.
Password rules reject your new password
Salesforce enforces a password policy. A password has a minimum length and must include a mix of character types. It also cannot contain your username or match a recent password. If the page says the password does not meet requirements, use a longer passphrase with letters and numbers, and avoid personal details that appear in your profile.
Login failures
"Your login attempt has failed"
This message is deliberately vague. It does not say whether the username or the password was wrong. Work through these checks in order:
- Confirm that the username is the one you chose at sign-up. It is not necessarily your email address.
- Confirm that you are on the right login page. Use your org's My Domain URL, which looks like
https://yourname-dev-ed.my.salesforce.com. The generic login page can work, but the My Domain page avoids confusion when you have several orgs. - Check your keyboard layout, Caps Lock, and your password manager. A saved entry for an older org may be filling in the wrong credentials.
- Use Forgot Your Password? to rule out a password problem.
If you cannot remember the username, search your mailbox for the sign-up or welcome message from Salesforce. The username appears in it.
The account is locked
By default, a number of consecutive failed logins locks the user for a period. The usual defaults are ten attempts and a 15-minute lockout, though an org's password policy can change them. In a Developer Edition org you are the administrator, so once you can log in again you can review the policy under Setup, Password Policies. If you are locked out of your only user, wait for the lockout to expire, or use the password reset link.
Identity verification on a new browser
On a login from a new browser or network, Salesforce may send a verification code to your email, or ask for your MFA method. This is expected behavior and not an error. If the code does not arrive, check spam and try again from the same browser tab, so that the request matches the session.
You are logged into the wrong org
If you have more than one org, check the username at the top of the user menu or in the URL. An unexpected data model or missing objects often mean you are in a different org than you intended. Running the confirmation Apex from the earlier chapter settles this:
System.debug('Org: ' + UserInfo.getOrganizationName());
System.debug('User: ' + UserInfo.getUserName());MFA problems
MFA means a password alone is not enough. You must also pass a second check, such as an authenticator app code or a security key. Typical failures are:
- Codes are always rejected. Time-based codes depend on the phone clock. Turn on automatic date and time on the device, and try the next code.
- The phone is lost or replaced. If you registered more than one method, log in with another one and add the new device. Register at least two methods when you first set up MFA, for exactly this reason.
- No method remains. An administrator can reset a user's registered methods or issue a temporary verification code. In a Developer Edition org you are normally the only administrator, so you cannot do this for yourself. At that point, the practical options are to ask Salesforce through the Trailblazer Community or Support, or to sign up for a new org with a new username.
CLI authorization problems
Authorization goes through a browser, so most failures are about which org the browser is logged into.
sf org login web --alias my-dev-org --instance-url https://yourname-dev-ed.my.salesforce.com
sf org list
sf org display --target-org my-dev-orgTypical symptoms and fixes:
| Symptom | Likely cause | Fix |
|---|---|---|
| The browser opens but logs you into another org | An existing browser session is active for a different user | Log out in the browser, or use a private window, then run the command again |
| The browser does not open | No default browser, or a remote or headless terminal | Use the `--browser` flag to name a browser, or run the command from a local desktop session |
| Login succeeds but the CLI reports a connection error | Wrong login host for the org | Pass your My Domain URL with `--instance-url` |
| `sf org list` shows the org as expired or disconnected | The stored token no longer works, for example after a password change | Run `sf org login web` again with the same alias |
| Commands act on an unexpected org | A different default target org is set | Add `--target-org my-dev-org` to each command |
If an alias points at a dead entry, sf org logout --target-org my-dev-org removes the stored authorization, and you can then log in again. Finally, run the verification query again to confirm you are in the intended Developer Edition org:
sf data query --target-org my-dev-org --query "SELECT Name, OrganizationType FROM Organization"When to stop troubleshooting
Some situations are cheaper to restart than to repair. If the sign-up never produced a working user, if the mailbox is not yours, or if you have lost every MFA method on an org that holds nothing valuable, creating a new org with a new username takes less time than recovering the old one. Keep this option in mind for any org that holds little data. An org with important work in it is worth a request to support.
Exercise
You submit the sign-up form with the username [email protected]. The page says the username already exists, so you resubmit with the same username a second time after a few minutes. Why is this unlikely to work, and what should you do instead?
Show answer
Usernames must be unique across all Salesforce orgs, so another user (or your earlier attempt) already holds that name. Resubmitting the same value gives the same result. Choose a more specific username in email format, such as [email protected]. If you think your earlier attempt created the org, use Forgot Your Password with the username to get a reset link instead of signing up again.
Exercise
sf org login web completes, but sf data query shows an org name you do not recognize. List two checks that would find the cause.
Show answer
First, run sf org list and sf org display --target-org my-dev-org to see which username and instance URL the alias is attached to. Second, check which user the browser was logged in as when you authorized, since an existing browser session for another org is the usual cause. Then log out of the browser or use a private window, run sf org logout --target-org my-dev-org, and authorize again with --instance-url set to your My Domain URL.