[SalesForce] Error authenticating with the refresh token due to: expired access/refresh token when I try to retrieve/deploy source from org

I have a project in Sandbox in Salesforce. Every day when I try to retrieve source from my org I got this error: enter image description here

How to resolve this issue?

The thing is that if I download and create project from scratch then It works but only till the next day. The next day this token automatically expires or something. I am not sure what is the problem, and I start to have this error again. So how to fix this so I don't to have to create a new project every morning?

My sfdx version : sfdx-cli/7.108.0 win32-x64 node-v14.17.1

sfdx update didn't seem to help.

Best Answer

It happened to me every time we refresh our dev org, so you can try to logout your user with the command:

sfdx force:auth:logout -u username@org.com.dev

And then you have to authorize again the org.

As malte wrote in the comment, you have also to reopen VS Code.

Related Topic