forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

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

Closed saicharanreddyk closed 2 years ago

saicharanreddyk commented 3 years ago

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. 3) 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 commented 3 years ago

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

shetzel commented 3 years ago

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

shetzel commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

saicharanreddyk commented 3 years ago

@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 commented 3 years ago

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