salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Cannot deploy custom label using VSCode extension

Open laszlo-foldi-attentioncrm opened this issue 1 year ago • 3 comments

Summary

I'm developing a package for our company, and trying to incorporate custom labels to avoid string literals in Apex. I've managed to create a custom label in my org, and retrieved it.

A new folder appeared in my folder structure called labels, and an xml was created: image image

I've added this label to my package xml to ensure proper deployment of my components during migration from one org to another: image

However, when I try to deploy my manifest (right click->SFDX: Deploy Source in Manifest to Org, I get the following error message:

13:30:37.40 Starting Conflict Detection

An error was encountered during conflict detection. MetadataTransferError: Metadata API request failed: This directory does not contain a valid Salesforce DX project.

Steps To Reproduce:

  1. Create a custom label in the org using the UI
  2. Retrieve the created label using the VSCode extension
  3. Add the new label to the manifest (package.xml)
  4. Right click on the xml opened in the editor and click SFDX: Deploy Source in Manifest to Org

Expected result

PS D:\Projects\REDACTED> sfdx force:source:deploy -p ./attentioncrm/main/default/labels Warning: We plan to deprecate this command in the future. Try using the "project deploy start" command instead. Deploying v57.0 metadata to [email protected] using the v58.0 SOAP API. Deploy ID: REDACTED

=== Deployed Source

FULL NAME TYPE PROJECT PATH ───────────────── ──────────── ─────────────────────────────────────────────────────────────────── API_GENERAL_ERROR CustomLabel attentioncrm\main\default\labels\CustomLabels.labels-meta.xml CustomLabels CustomLabels attentioncrm\main\default\labels\CustomLabels.labels-meta.xml Deploy Succeeded.

Actual result

13:30:37.40 Starting Conflict Detection

An error was encountered during conflict detection. MetadataTransferError: Metadata API request failed: This directory does not contain a valid Salesforce DX project.

Additional information

Salesforce Extension Version in VS Code: v58.7.1 image

SFDX CLI Version: PS D:\Projects sfdx version sfdx-cli/7.209.6 win32-x64 node-v18.15.0

OS and version: Windows 11 Microsoft Windows [Version 10.0.22621.1992]

Hi @laszlo-foldi-attentioncrm! I was able to reproduce this error and will be adding a bug to our backlog for this. Thanks for bringing this to our attention

CristiCanizales avatar Aug 04 '23 16:08 CristiCanizales

We are experiencing the same error - whenever we attempt to deploy a CustomLabel we receive the error:

An error was encountered during conflict detection. MetadataTransferError: Metadata API request failed: This directory does not contain a valid Salesforce DX project.

image

image

Additional Information

sfdx version: @salesforce/cli/2.21.8 darwin-arm64 node-v20.10.0 salesforce extension pack version: v59.9.0

image

mattmartin26 avatar Jan 03 '24 01:01 mattmartin26

link to bug W-13887806

diyer avatar Mar 28 '24 20:03 diyer

Hi @laszlo-foldi-attentioncrm and @mattmartin26, we made some changes recently (#5650) that I believe fixed this and I can't reproduce this issue anymore. Would you mind confirming with these vsixes if that's the case? Thanks in advance!

CristiCanizales avatar Jul 03 '24 21:07 CristiCanizales

Closing this issue as there are no new cases and we've received no response from user.

CristiCanizales avatar Jul 15 '24 22:07 CristiCanizales