function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Terence VibanTerence Viban 

Scratch Org - Error authenticating with JWT config due to: invalid assertion

Hi all,
I can no longer log into my scratch org using sfdx cli. I get the error Error authenticating with JWT config due to: invalid assertion.
When I look into my DevHub and through the terminal my scratch org is active.
I have also generated a password and can use that to log into my scratch org. So the scratch org is fine.
My DevHub is connected as well. Can someone explain to me what the above error message means and what I can do about it?
I have been working with scratch orgs for over a year now and never had this issue. This issue started when I set up CI using Circle CI. I have been able to connected to my DevHub and create and delete scratch orgs on the fly using CI. So suspect these two things might be related. But i do not understand how.
Thanks in advance

JWT Error when logging into scratch orgs
SwethaSwetha (Salesforce Developers) 
HI Terence,
Can you setup debug logs by appending --dev-debug switch to the command to see if you can find something useful. 

Example:  sfdx force:org:create -f config/project-scratch-def.json -a sourcescratchorg --dev-debug

Came across this related post from past:

Terence VibanTerence Viban
Hi Swetha,
thanks for your response.
In my research of the issue, I came across the post you shared but disregarded it since it is dealing with issues regarding JWT bearer flows and certificates when login in. Although my error says "Error authenticating with JWT config", I do not need to authenticate using this Flow when using scratch orgs.
I also tried the debug option and nothing useful came up in the error message unfortunately

User-added image

So finally I have just created a new scratch org and it seems to work fine. Unfortunately, I didn't pull all of my work from the previous scratch org to my local repo. Had to comment out certain portions of my code to successfully push to my new scratch org. 

From the way this looks, I have stumbled onto an edge case here

Thanks for your input.
Anakin AnderAnakin Ander
Thanks everyone for sharing their experience regarding this issue. As we were facing the same issue in the account for aarthi scans janakpuri ( But after seeing your discussion. I found the solution. Really appreciated your discussion.
nokev veriynokev veriy
If you are looking for Angel number 222 meaning and significance, then you are in right place. Let's check here: Angel number