Suddenly vscode stopped working with deploying the class to the sandbox I'm using and throws this message "No org configuration found for name INSTANCE NAME"

I tried to create a new project for the sandbox but still get the same error when I'm trying to retrieve all the classes from the org.

sfdx update didn't help.

  • 1
    It sounds like you need to authenticate again? Try sfdx force:auth:web:login -a "some-alias" -r https://test.salesforce.com/ -s (change some-alias to whatever you'd like to call the sandbox). – sfdcfox Mar 31 '19 at 12:45
  • Sometimes it might be a proxy issue. – sanket kumar Mar 31 '19 at 17:15

It may be a problem with aliases.

I have mistakenly created an alias: DevHub=me@salesforce.com

Then, not aware of consequences I created an alias again, in the way I wanted it in the first place: me@salesforce.com=DevHub

So I ended up having two aliases, which were translated by the CLI:

DevHub -> me@salesforce.com -> DevHub

So CLI was trying to use DevHub as my username, instead of me@salesforce.com

Hence, the error: No org configuration found for name DevHub

Verify Your aliases with:

sfdx force:alias:list

and delete unnecessary aliases (if any) by setting them as empty:

sfdx force:alias:set DevHub=
|improve this answer|||||

Deleting folders "tools", "typings" and the file "sfdx-config.json" and then close and open vscode solved the problem.

|improve this answer|||||
  • 1
    I tried this, then re-authorize and organization using command SFDX: Authorize an Org. It is working. But why? Care to do some explanation? Or it is just a caching issue? – ksugiarto Apr 25 '19 at 11:38

I had the same problem just now, working with a developer sandbox and indeed authenticating again solved the issue. Thank you

|improve this answer|||||
  • authenticating again did not help. – osos9 Apr 2 '19 at 14:03

One of the reasons may be conflict in your aliases files. You can find following folder on your computer: %USERPROFILE%/.sfdx and find there file alias.json. There would be all your used aliases and you can investigate if you have any conflicts.

|improve this answer|||||

FYI, this happened to me. Specific error I got was: "No org configuration found for name DevHub"

I used the command: sfdx force:config:list to see my configuration values for defaultdevhubusername and defaultusername. I noticed that defaultdevhubusername was just DevHub so I changed this to the username I used to login to my DevHub and it worked. To change, I used command sfdx force:config:set defaultdevhubusername=myusername@domain.com

Hope this helps someone else.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.