Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force:mdapi:deploy no longer showing error line numbers on failures #356

Closed
alan-morey opened this issue Mar 30, 2020 · 6 comments
Closed
Labels
area:mdapi This is an issue for MDAPI server side team. bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.

Comments

@alan-morey
Copy link

alan-morey commented Mar 30, 2020

Summary

force:mdapi:deploy no longer shows the error line number for components that fail to deploy.

Steps To Reproduce:

  1. Create package folder deploy-test with following components:
       deploy-test/
       ├── classes/
       │   ├── ClassWithCompileError.cls
       │   └── ClassWithCompileError.cls-meta.xml
       └── package.xml
    
  2. Contents of ClassWithCompileError.cls:
    public class ClassWithCompileError {
       privtae String text;
  3. Contents of ClassWithCompileError.cls-meta.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
        <apiVersion>48.0</apiVersion>
        <status>Active</status>
    </ApexClass>
  4. Contents of package.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
    
     <types>
       <members>ClassWithCompileError</members>
       <name>ApexClass</name>
     </types>
    
     <version>48.0</version>
    </Package>
  5. Execute deploy command:
    $ sfdx force:mdapi:deploy -d deploy-test -g -w -1
    Job ID | 0Af2h00000AOa8QCAT
    MDAPI PROGRESS | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 0/3 Files
    
    === Component Failures [3]
    TYPE   FILE                                           NAME                   PROBLEM
    ─────  ─────────────────────────────────────────────  ─────────────────────  ──────────────────────────────
    Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Unexpected token 'String'.
    Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Expecting '}' but was: '<EOF>'
    Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Unexpected token 'String'.
    
    ERROR running force:mdapi:deploy:  The metadata deploy operation failed.

Expected result

Expected error messages in "Component Failures" list would contain the line/column number where the problem occurs, so that I can easily fix the issue and re-deploy:

 === Component Failures [3]
   TYPE   FILE                                           NAME                   PROBLEM
   ─────  ─────────────────────────────────────────────  ─────────────────────  ──────────────────────────────
   Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Unexpected token 'String'. (2:13)
   Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Expecting '}' but was: '<EOF>' (3:1)
   Error  deploy-test/classes/ClassWithCompileError.cls  ClassWithCompileError  Unexpected token 'String'. (2:13)

Note the line/column at the end of each message.

Actual result

No line/column numbers are shown in the error messages making it more difficult for me to track the source of the problem.

Additional information

I also tried using the --verbose flag but this does not add the line/column numbers either.

Using --json flag I can see the line/column numbers are present.

As a workaround, I am opening "Deployment Status" page in Salesforce to view errors but really should get that information in force:mdapi:deploy without having to use --verbose or --json flags.

SFDX CLI Version: sfdx-cli/7.52.0-c5ad5c3eff linux-x64 node-v10.15.3

SFDX plugin Version:

@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.7.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)                                                                                                                               
├─ salesforcedx-templates 48.7.0 (core)                                                                                                                                        
└─ salesforce-alm 48.8.0 (core) 

OS and version: Ubuntu 18.04.4 LTS

@clairebianchi
Copy link
Collaborator

@alan-morey We will look into it. Out of curiosity if you use source:deploy do you see the line numbers?

@clairebianchi clairebianchi added bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. labels Mar 31, 2020
@alan-morey
Copy link
Author

@clairebianchi Yes, line/column numbers appear on failure messages when using source:deploy

@clairebianchi
Copy link
Collaborator

Great, Thank you

@forcebewithyou
Copy link

Hello, any idea on when this is targeted to be fixed? Thank you so much.

@dcinzona
Copy link

dcinzona commented Feb 5, 2021

Still an issue, btw...

*** EDIT ***
Still an issue as of Spring 21 release (2/16/2021)

@jshackell-sfdc
Copy link
Collaborator

This issue is fixed in version 2.13.9 (Oct 18, 2023) of Salesforce CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:mdapi This is an issue for MDAPI server side team. bug Issue or pull request that identifies or fixes a bug owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.
Projects
None yet
Development

No branches or pull requests

6 participants