Cli: force:source:deploy fails with single CustomLabel in manifest

Created on 27 Feb 2019  Â·  14Comments  Â·  Source: forcedotcom/cli

Summary

_Fails to deploy using force:source:deploy when the package manifest contains a single CustomLabel_.

Steps To Reproduce:

  1. Create a package manifest with single CustomLabel, manifest/package.xml:
    ```xml


    FOO_BAR
    CustomLabel

    45.0

2.  Add `CustomLabel` to workspace, `force-app/main/default/labels/CustomLabels.labels-meta.xml`:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
    <labels>
        <fullName>FOO_BAR</fullName>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>Foobar label</shortDescription>
        <value>FooBar</value>
    </labels>
</CustomLabels>
  ```
3. Deploy
```sh
  sfdx force:source:deploy -x manifest/package.xml

Expected result

The CustomLabel should have been deployed to the target org.
This is currently possible with Ant Migration Tool.

Actual result

ERROR: The CustomLabel named FOO_BAR was not found in the workspace.

Additional information

Changing the package manifest to use the CustomLabels type instead of CustomLabel works but this is deploying more than I want to push to the sandbox.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

  <types>
    <members>*</members>
    <name>CustomLabels</members>
  </types>

  <version>45.0</version>
</Package>

SFDX CLI Version: sfdx-cli/6.54.4-c01dcc69db (linux-x64) node-v8.9.4

SFDX plugin Version:
@salesforce/plugin-generator 1.0.1 (core)
@salesforce/sfdx-trust 2.0.1 (core)
builtins 1.0.0 (core)
dependencies-cli 1.0.1
salesforcedx 45.3.4 (core)

OS and version: Ubuntu 16.04.5 LTS

bug

Most helpful comment

Here is what works for me:

to pull from a Sandobx/Org:

  <types>
    <members>AcmeLabel</members>
    <members>BetaLabel</members>
    <name>CustomLabel</members>
  </types>

to push to a Sandbox/Org:

  <types>
    <members>*</members>
    <name>CustomLabels</members>
  </types>

– not great, not terrible, but it does the job.

All 14 comments

@alan-morey - Thank you for the thorough report! I reproduced this and the bug fix will be prioritized for a future patch release.

You can take the following steps as a workaround. I understand that it's less than ideal as a workaround but it will deploy just the label.

  1. Run sfdx force:source:convert -d labels_md -r force-app/main/default/labels
  2. Remove all label metadata files you don't want to deploy from ./labels_md/labels
  3. Modify ./labels/package.xml to only have the label you want deployed.
  4. Run sfdx force:mdapi:deploy -d ./labels_md -u your_sandbox

Is it fixed?

No, we have not gotten to this bug yet.

Any update on this yet? I can't convert a project to SFDX until this is fixed. Maybe adding a dummy custom label is a possible workaround? Does it fail if you have 2 labels defined? will try this out...

Please fix it. It blocks our SFDX project and forces us to do manual workaround.

Here is what works for me:

to pull from a Sandobx/Org:

  <types>
    <members>AcmeLabel</members>
    <members>BetaLabel</members>
    <name>CustomLabel</members>
  </types>

to push to a Sandbox/Org:

  <types>
    <members>*</members>
    <name>CustomLabels</members>
  </types>

– not great, not terrible, but it does the job.

@ikopyl thank you. It works!

This should be fixed by the Dec 12th release of the CLI.

image

@zerkz this does not seem to work. Here are details:

CLI version: 7.36.0-b1c4e9c7c8 (latest as of today)

If one label is added to package.xml, then deployment crashes with the following:

ERROR running force:source:deploy:  Maximum call stack size exceeded
at ChildProcess.exithandler (child_process.js:299:12)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.EventEmitter.emit (domain.js:442:20)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
killed: false,
code: 1,
signal: null,
cmd: 'sfdx force:source:deploy -x manifest/package.xml' }

if a wildcard used in members of the CustomLabels type, deployment it goes through.

Can you please provide details on what needs to be done to deploy only one label.

Hi @oxiumio

A few things:

  • The source of release notes I used was from Salesforce's salesforcedx npm module. This is a main dependency of the actual CLI. The notes are provided here - https://developer.salesforce.com/media/salesforce-cli/releasenotes.html . The custom label fix should of came in 47.10.9, but Salesforce never pushed this version to their salesforcedx npm repo, never actually releasing it (https://www.npmjs.com/package/salesforcedx). However this fix SHOULD be included in latest released one (47.14.0).

I haven't actually tested it if it works, but let me know if after updating your CLI it does for you.

You might also be effected by this issue -- https://github.com/forcedotcom/cli/issues/254 which is why its reporting 7.36.

i also faced same issue today 'sfdx force:source:deploy -x manifest/package.xml
ERROR running force:source:deploy: Maximum call stack size exceeded'
error.
i didn't add any custom labels in my package.xml still i am facing issue.
cli version : sfdx -v
sfdx-cli/7.41.0-2a5f766389 win32-x64 node-v10.15.3

please help me for resolution on this?

I can confirm this issue in sfdx-cli/7.75.1-5585088c75 win32-x64 node-v12.18.3

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

Was this page helpful?
0 / 5 - 0 ratings