forcedotcom / salesforcedx-docker

The official Dockerfile for Salesforce DX
BSD 3-Clause "New" or "Revised" License
74 stars 25 forks source link

SFDX: Authorize an Org encounters error "SLOW_DOWN - polling too quickly for the token endpoint." #18

Closed ghost closed 4 years ago

ghost commented 4 years ago

Summary

When running SFDX: Authorize an Org within the SalesforceDX container using VS Code Remote Containers, the following error is encountered:

ERROR running force:auth:device:login: SLOW_DOWN - polling too quickly for the token endpoint. Something went wrong. Cancel all currently running commands, and try again.

Steps To Reproduce:

  1. Open SFDX project in VS Code within the SalesforceDX container.
  2. Through the command palette, run SFDX: Authorize an Org. When prompted, specify the login url and org alias.
  3. Check the Output Tab (Salesforce CLI) for the Action Required message with the code and verification URL.
  4. Wait a few seconds for the error to come up. There is almost always not enough time to open the verification URL and enter login credentials before the error comes up.

Expected result

The user is able to click the verification URL and enter login credentials. VS Code (within the Docker container) is authenticated into the org.

Actual result

The following error is shown:

ERROR running force:auth:device:login: SLOW_DOWN - polling too quickly for the token endpoint. Something went wrong. Cancel all currently running commands, and try again.

Even if the user proceeds to log into Salesforce using the provided URL, VS Code does not register this authentication because of the error.

dehru commented 4 years ago

@octos4murai - Thanks for reporting this issue. I'm trying to reproduce this but I'm not having this issue locally using 'Authorize a Dev Hub' or 'Authorize an Org'.

You mentioned in your steps "When prompted, specify the login url and org alias.". Are you using a sandbox, custom url, production, or project default ( scratch org in my case )?

ghost commented 4 years ago

@dehru - Thanks for looking into this. I encountered this issue all last week up to this morning when I choose either 'Authorize a Dev Hub' or 'Authorize an Org'. Please note that the issue never came up for me if not running within a Docker container. I also never encountered this issue before last week.

To answer your other question, I have tried using custom URL, sandbox, and production -- all resulting in the same error. With all that said, I just tried again -- and can no longer reproduce the error although I changed nothing in my steps to reproduce.

dehru commented 4 years ago

That frustrating. I developed the device login command and I’ve seen that error during development. The command is supposed to obey the correct polling interval, but there could be a bug around that. So let me know if you encounter it again and I’ll re-open this.