Salesforce Sandbox authorization issue from jenkins just in one specific org


We have a Jenkins job that makes some actions in 3 different SF orgs (2 sandboxes and 1 prod). The job has been working as expected for several months.
Suddenly, it started to receive the following error message after the execution of a sf org login jwt command, when it tries to connect to one of the sandboxes:

JsonParseError: Parse error in file unknown on line 3
get-org": “test”
“target-dev-hub”: "T

Exactly the same command line is executed for the 3 orgs, just replacing the values of some parameters (client id, username, instance URL,…), and it is connecting fine to the other sandbox and the production environment.
The command was connecting as expected before, and nothing has changed in the sandbox org.
Nevertheless, I also deleted and created the connected app again in the SF org, updating the connection values in the Jenkins server, and the connection was tested in the Jenkins server CLI with a successful result, but the Jenkins job is still failing (after server restart to refresh environment variables).

We also have another job that executes other actions in the same orgs and it is also failing in the connection to the same org.

I found similar JSON file issues in the past due to the specific JSON file used in the connection being corrupted (strange line breaks in the middle of the file content) and I was able to fix it by deleting the folder that contains those files (the files are named as the SF username with JSON extension in the Windows/System32/config/systemprofile/.sfdx folder) and the folder and files were created again in the next job execution, but now the JSON connection file to the sandbox org is not being created again and the same error is raising, so I don´t know what JSON file is raising the error.

I need some help.
Thanks in advance

I´m still facing the same issue.

Here is the summary of findings so far:

  1. The machine can connect to the SF org, as I have tested it using an SFDX CLI command. However, the Jenkins job is receiving the JSON error message. So the issue is inside of the Jenkins service.
  2. The same Jenkins job and the same command line in the job are used to connect to the other 2 SF orgs without any issues. Only parameters change. So the command is correct.
  3. Usually, the SF connection JSON files are in the C:\Windows\System32\config\systemprofile.sfdx folder, but I have deleted the connection file for that specific user and the file is not created again in the next execution, so I guess the issue is happening before that JSON file is created, and it is related to a different JSON file.

Any idea about where can I find the JSON file that is causing this issue? I´m lost.


Finally, there was an issue with one config.json file stored in the remote repository used by the job.
Once that file was removed from the repo (as it was not required at all), the job started to work again.

I was able to locate the file using the --dev-debug parameter in the SF login command. In that way, the command returns the list of every action executed, so you can find where it is crashing.

Javier Carvajal