forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
947 stars 404 forks source link

Experimental Deploy/Retrieve: "Error authenticating with the refresh token due to: expired access/refresh token" after sandbox refresh. #3750

Closed cgb-76 closed 5 months ago

cgb-76 commented 3 years ago

Summary

We've just refreshed a full-copy sandbox and I'm experiencing issues with sfdx force:source:deploy from VSCode. The error message is "Error authenticating with the refresh token due to: expired access/refresh token". I'm using experimental deploy/retrieve.

Steps To Reproduce:

  1. Connect to a sandbox org with salesforce CLI through VSCode
  2. Refresh the sandbox.
  3. Run sfdx force:auth:logout --all --noprompt
  4. Run sfdx force:auth:web:login --setalias UAT --instanceurl https://test.salesforce.com --setdefaultusername
  5. Attempt to deploy metadata with experimental deploy/retrieve enabled

Expected result

Metadata deploys.

Actual result

Error authenticating with the refresh token due to: expired access/refresh token

Additional information

When I switch back to standard deploy/retrieve, I do not encounter this issue.

SFDX CLI Version: sfdx-cli/7.94.3-a4e7c7955b win32-x64 node-v14.15.4

SFDX plugin Version: @oclif/plugin-autocomplete 0.3.0 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.10.0 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/lwc-dev-server 2.10.0 ├─ @oclif/plugin-update 1.3.10 └─ @oclif/plugin-help 2.2.3 @salesforce/sfdx-trust 3.6.0 (core) alias 1.1.8 (core) auth 1.5.1 (core) config 1.2.7 (core) generator 1.1.5 (core) salesforcedx 52.0.0 ├─ data 0.4.11 ├─ limits 1.2.1 ├─ apex 0.2.2 ├─ org 1.6.6 ├─ user 1.3.0 ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 ├─ templates 51.5.0 ├─ custom-metadata 1.0.12 ├─ schema 1.0.7 └─ salesforce-alm 52.0.0 sfdx-cli 7.94.3 (core) telemetry 1.1.1 (core)

OS and version: Windows 10 Pro, Version 2004, Build 19041.685

cgb-76 commented 3 years ago

Update: A restart has fixed the issue, but should be looked at nonetheless.

proudchild commented 3 years ago

SAME HERE on same Scenario in both windows and MAC.

NuAgeDan commented 2 years ago

EDIT: the below workaround doesn't actually work for me

Same. Its been an issue since at least May. Workaround here until they fix this:

https://salesforce.stackexchange.com/questions/342444/sfdx-issue-authorized-dev-sandbox-yet-get-expired-access-refresh-token-when

floralan commented 2 years ago

@cgb-76 We has requested a doc change to Sandbox Doc team to clarify this issue in W-10935487.

AnanyaJha commented 5 months ago

Hi @cgb-76 ! The Experimental Deploy/Retrieve setting has now been deprecated and your issue should be addressed. Please open a new issue if you're still having any problems, thanks so much!