1

Today, i reached the second unit "Get Ready to Create an App" of "App Development with Salesforce DX" trailhead (Unit link).

i am getting an error when trying to create a scratch org using this command

sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch

The message error: ERROR: Failed to decipher auth data. reason: Unsupported state or unable to authenticate data.

do you have an idea how to get rid of that error ?

5
  • Have you tried the following: salesforce.stackexchange.com/questions/188735? – sfdcfox Dec 4 '17 at 11:53
  • No, i do not think it's the same problem. for me, it works for other projects , i do not know what's the matter with this one. – Merabti Ibrahim Dec 4 '17 at 11:56
  • 1
    It sounds like your data might somehow be corrupt. What's the output of sfdx force:org:list --verbose? – sfdcfox Dec 4 '17 at 11:58
  • @sfdcfox the scratch org GeoAppScratch does not appear in the list, it only shows other scratch orgs that i have created before. – Merabti Ibrahim Dec 4 '17 at 12:10
  • 1
    but for the Orgs part: i have two Orgs with a "Connected Status = Connected" and one org with "Connected Status = authDecryptFailed". – Merabti Ibrahim Dec 4 '17 at 12:13
2

I figured out what the problem is, i have just to login in to my DevHub Org first. using this command: (change 'my-devhub-org' with your Dev hub name)

sfdx force:auth:web:login -d -a my-devhub-org

and Then you can create your scratch orgs as usual.

0

To complete Merabti's answer, here are some precisions because I for one didn't realize that you must first login to the exact DevHub org first, and not only the user account !

Logging in with the same user, to another DevHub org is not enough.

In case you're not sure of your DevHub's name anymore, you can find it by listing all your orgs: $ sfdx force:org:list

Then login with: $ sfdx force:auth:web:login -d -a my-devhub-org

Then you can do regular stuff like sfdx force:org:open -u my-devhub-org.

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.