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

sfdx force:source:convert for Custom Label in package.xml is not working #673

Closed
saicharanreddyk opened this issue Oct 15, 2020 · 7 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@saicharanreddyk
Copy link

saicharanreddyk commented Oct 15, 2020

Summary

I am trying to convert source format metadata to mdapi format and using the below command and getting the error.
sfdx force:source:convert -x ./manifest/package.xml -d ./metadataPackage

Steps To Reproduce:

  1. Authorize devhub org in VSCode
  2. Create a Custom Label in the org from UI
  3. Create a project in VScode and set the default org as above authorized org.
  4. Try to use the below command to convert the source format of Custom Label to MDApi format.

package.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>CustomLabel</name>
    </types>
    <version>49.0</version>
</Package>

Command used to convert:
sfdx force:source:convert -x ./manifest/package.xml -d ./metadataPackage

Expected result

The custom Label should be converted to mdapi format and we should see a folder name with metadataPackage inside the project folder

Actual result

Getting an error stating ERROR running force:source:convert: The package root directory is empty.

Additional information

image

SFDX CLI Version

sfdx-cli/7.75.1-5585088c75 win32-x64 node-v12.18.3

SFDX plugin Version

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.22.0
@salesforce/sfdx-scanner 2.3.0
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 50.0.13 (pre-release)
├─ custom-metadata 1.0.10
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
├─ salesforcedx-templates 49.5.0
├─ salesforce-alm 50.0.13
└─ apex 0.1.0
sfdx-cli 7.75.1 (core)

OS and version:
Microsoft Windows 10 Enterprise

@shetzel
Copy link
Contributor

shetzel commented Oct 20, 2020

This is now fixed with CLI v7.76.1 and salesforcedx plugin v50.1.1

@shetzel shetzel closed this as completed Oct 20, 2020
@amphro amphro added the bug Issue or pull request that identifies or fixes a bug label Oct 21, 2020
@shetzel
Copy link
Contributor

shetzel commented Oct 21, 2020

I closed this by mistake. This has not yet been fixed.

@shetzel
Copy link
Contributor

shetzel commented Oct 23, 2020

I added a partial fix for custom labels in the current release candidate. Can you try installing that to see if it unblocks you?
sfdx plugins:install salesforcedx@latest-rc

It's a partial fix because it converts/deploys all custom labels in the project versus just the labels defined in the manifest. Converting/deploying specific labels is coming soon. I will keep this open until that fix is in the release.

@saicharanreddyk
Copy link
Author

Thank you @shetzel for the fix. Unfortunately, I am still not able to convert them.

image

C:\Users\Desktop\customLabel>sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.1 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/analytics 0.22.0
@salesforce/sfdx-scanner 2.3.0
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
auth 1.3.0 (core)
config 1.1.9 (core)
generator 1.1.3 (core)
salesforcedx 50.3.1 (latest-rc)
├─ templates 50.1.0
├─ custom-metadata 1.0.10
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
├─ salesforce-alm 50.3.1
└─ apex 0.1.2
sfdx-cli 7.77.0 (core)
sfdx-mohanc-plugins 0.0.73
shane-sfdx-plugins 4.41.2
├─ @mshanemc/plugin-streaming 1.1.7
└─ @mshanemc/sfdx-sosl 1.1.0

C:\Users\Desktop\customLabel>sfdx force:source:convert -x ./manifest/package.xml -d ./metadataPackage
ERROR running force:source:convert: The package root directory is empty.

But Using this below command worked

C:\Users\Desktop\customLabel>sfdx force:source:convert -m CustomLabel -d convertedLabel
Source was successfully converted to Metadata API format and written to the location: C:\Users\Desktop\customLabel\convertedLabel

Thanks.

@shetzel
Copy link
Contributor

shetzel commented Oct 26, 2020

@saicharanreddyk - what is the content of your manifest? Is the path correct?

@saicharanreddyk
Copy link
Author

saicharanreddyk commented Oct 27, 2020

@shetzel
manifest.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>CustomLabel</name>
    </types>
    <version>50.0</version>
</Package>

Project folder CustomLabels
package.xml is under ==> CustomLabels/manifest/package.xml

I am not sure what has changed but it started working now. I haven't changed any structure / package.xml / command to execute. All remain the same.

image

@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-9299072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

6 participants