[SalesForce] Any way to get more diagnostic information out of SFDX than ERROR “Unknown”

We have a shell script that runs:

echo "Deploying components..."
sfdx force:source:push --forceoverwrite --targetusername $SFDC_USERNAME --loglevel trace

but this has recently started failing from our Jenkins Continuous Integration server that runs on Amazon EC2. The failure message tells us little:

 [exec] Deploying components...
 [exec] PROJECT PATH  ERROR
 [exec] ────────────  ───────
 [exec]               Unknown

The same script run locally on a Mac on the same files works.

Is there a way to get more diagnostic information out of the SFDX tools? Or any thoughts on what the problem could be?

PS

Same problem experienced in August 2017 with no good answer…

PPS

Running with the --json option didn't reveal anything more:

{  
    "message":"Push failed.",
    "status":1,
    "stack":"DeployFailed: Push failed.\n    at ALMError ...",
    "name":"DeployFailed",
    "result":[  
        {  
            "error":"Unknown"
        }
    ],
    "warnings":[  

    ]
}

Best Answer

The logs from the log-levels are written in

USER_HOME_DIR/.sfdx/sfdx.log

directory, did you check the contents in there on your Mac? Only errors are output to the terminal or command window from which you run the CLI, so you need to read in that file as documented here.

Also, you can open the scratch org, navigate to Deployment Status page to check any deployment errors you're encountering over there.

If there are many errors try using the --json flag to get the output in JSON format and write it in a CSV using JQ. We were not receiving any errors on the command line since we had around 25k deployment errors and the CLI, Deployment Status page and log file failed in providing the errors but using JQ to redirect and convert them to a CSV helped identifying them.

Related Topic