Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INVALID_SESSION_ID when deploying with force:source:deploy #912

Closed
Bartheleway opened this issue Mar 11, 2021 · 3 comments
Closed

INVALID_SESSION_ID when deploying with force:source:deploy #912

Bartheleway opened this issue Mar 11, 2021 · 3 comments
Labels
investigating We're actively investigating this issue

Comments

@Bartheleway
Copy link

Summary

After the OAuth token of my session expire, it seems that sfdx doesn't refresh it automatically anymore.

Steps To Reproduce:

  1. Authorize an org (sandbox) on your VS Code sfdx project
  2. Wait or make your OAuth token to expire
  3. Try to use "force:source:deploy" on any file, you should get the error

Expected result

Refresh the token and deploy the source

Actual result

Receiving: INVALID_SESSION_ID: Session expired or invalid

Additional information

SFDX version : 7.90.2

Using the "open org" command seems to refresh the token. We have to do it every time that token expire, annoying.
This is probably related to issue #899

@Bartheleway Bartheleway added the investigating We're actively investigating this issue label Mar 11, 2021
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@MuriloKakazu
Copy link

MuriloKakazu commented Mar 16, 2021

This seems to be caused by the recent changes in which the CLI started using Salesforce's REST API to deploy by default (since v7.90.2). If you force it to deploy using SOAP API, it will refresh your expired access token:

$ SFDX_REST_DEPLOY=false sfdx force:source:deploy <...>

After refreshing your access token that way, or by sfdx force:org:open as you said, you can then go back to deploying with REST until the token expires again...

image

It seems that sfdx force:org:list still displays the orgs as Connected because it conveniently refreshes the access tokens for non-scratch orgs ref

@shetzel
Copy link
Contributor

shetzel commented Mar 16, 2021

This is a duplicate of #899
Closing this in favor of the first report. It's a bug and will be fixed asap.

@shetzel shetzel closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants