Skip to main content

I've been unable to push to my scratch org or even list it in gitbash / CLI since yesterday. Looks like my token has expired but after a half day of Googling I can't find a solution for how to fix it when the issue is your gitbash won't connect (all I'm finding is how to fix the code in your APIs getting the similar messages).

I'm able to log in to my scratch org through the browser, but if I try to force:auth:web:login and pop the URL that way, I get an error about localhost. Below is what I'm getting in gitbash:

sfdx force:org:push -u -sfdx-tst

ERROR running force:source:push:  Error authenticating with the refresh token due to: expired access/refresh token

sfdx force:org:display

ERROR running force:org:display:  This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - expired access/refresh token

username: test-ealg1mxwqs9w@example.com,

clientId: PlatformCLI,

loginUrl: https://CS69.salesforce.com,

privateKey: <Not Specified>

Try this:

Verify the OAuth configuration for this org. For JWT:

Ensure the private key is correct and the cert associated with the connected app has not expired.

Ensure the following OAuth scopes are configured [api, refresh_token, offline_access].

Ensure the username is assigned to a profile or perm set associated with the connected app.

Ensure the connected app is configured to pre-authorize admins.

 
6 Antworten
  1. 5. Jan. 2022, 17:42
    Greetings, I just finished refreshing Sandbox and got the same VS Code error trying to use an existing project.

    I followed the above steps but they didn't work, initially, one step was missing. Restarting VS Code

    • CTRL + SHIFT + P
    • Authorize an Org [ENTER]
    • Project Default [ENTER]
    • Org Alias (left it what it was) [ENTER]
    • Click Allow on OAuth screen
    • Tested VS Code, it failed with the same error
    • Fully close VS Code, start it again. Issue resolved.

     
0/9000