salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Cannot deploy custom label using VSCode extension
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:
I've added this label to my package xml to ensure proper deployment of my components during migration from one org to another:
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:
- Create a custom label in the org using the UI
- Retrieve the created label using the VSCode extension
- Add the new label to the manifest (package.xml)
- 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
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
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.
Additional Information
sfdx version: @salesforce/cli/2.21.8 darwin-arm64 node-v20.10.0 salesforce extension pack version: v59.9.0
link to bug W-13887806
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!
Closing this issue as there are no new cases and we've received no response from user.