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
Net Tech InternationalNet Tech International 

sfdx force:source:deploy Error does not show enough information

Hello, 

When I try to deploy a class to my Production organization using sfdx the error produced does not show enough details.
I am executing the command:
sfdx force:source:deploy -m ApexClass:ClassNameRepository -l RunLocalTests -u myOrgProd --json --loglevel error
Response error:
{
    "status": 1,
    "result": [
        {
            "error": "Unknown"
        }
    ],
    "name": "DeployFailed",
    "message": "Deploy failed.",
    "exitCode": 1,
    "commandName": "SourceDeployCommand",
    "data": [
        {
            "error": "Unknown"
        }
    ],
    "stack": "DeployFailed: Deploy failed.\n    at MetadataRegistry.initializeMetadataTypeInfos.then.then.catch.e (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\salesforce-alm\\dist\\lib\\source\\sourceApiCommand.js:64:31)\n    at tryCatcher (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\util.js:16:23)\n    at Promise._settlePromiseFromHandler (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\promise.js:517:31)\n    at Promise._settlePromise (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\promise.js:574:18)\n    at Promise._settlePromise0 (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\promise.js:619:10)\n    at Promise._settlePromises (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\promise.js:695:18)\n    at _drainQueueStep (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\async.js:138:12)\n    at _drainQueue (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\async.js:131:9)\n    at Async._drainQueues (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\async.js:147:5)\n    at Immediate.Async.drainQueues [as _onImmediate] (C:\\Users\\whernandez\\AppData\\Local\\sfdx\\node_modules\\bluebird\\js\\release\\async.js:17:14)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)",
    "warnings": []
}
I upgrade to the following versions sfdx-cli / 7.30.13-9e204762d5 win32-x64 node-v10.15.3
and salesforcedx installed v47.3.7

 
StephenDicksonStephenDickson
It is my understanding that it is not possible to delpoy directly to a Production org.  You have to deploy to a developer org or sandbox and then send it to Production with a change set.  Forgive me if you already were working with this understanding, but you mentioned your Production org in your post.  Cheers!
Net Tech InternationalNet Tech International

Hi StephenDickson, thanks for your reply.

Sorry for not specifying before, I'm trying to deploy from Developer Org to Production Org using the sfdx CLI in Visual Studio Code.
I have already deployed some classes, but with other classes I get the error.

Net Tech InternationalNet Tech International
Regards,
I solved the problem using the Ant Migration Tool https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/meta_development.htm
With this tooling I was able to obtain more details of my problem, finally my problem is that it was not covering 75% of the code in the Test.
Venkat Koppolu *Venkat Koppolu *
This appears to be an intermittent issue which shows up with certain versions of the salesforce-alm, sfdx-cli plugins and not with some versions, I came across the same issue with the latest version of plugins and when I verified the same with an older version of salesforce-alm I was not having any issues, looks like the salesforce dx team is working on this for a fix.