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:retrieve into a new project fails to convert object translation #1233

Closed
svenfinitiv opened this issue Oct 12, 2021 · 11 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@svenfinitiv
Copy link

svenfinitiv commented Oct 12, 2021

Summary

We delete the source directory before retrieving to notice deleted artifacts. This never was an issue until recently, now an error is thrown.

Steps To Reproduce:

Repository to reproduce:

package.xml

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Activity.CallDate__c</members>
        <name>CustomField</name>
    </types>
    <types>
        <members>Activity</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Activity-en_US</members>
        <name>CustomObjectTranslation</name>
    </types>
    <version>53.0</version>
</Package>

custom field CallDate__c

<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>CallDate__c</fullName>
    <defaultValue>NOW ()</defaultValue>
    <description>This field enables the user to select a date/time for the LogACall functionality.</description>
    <externalId>false</externalId>
    <label>Call Date</label>
    <required>false</required>
    <type>DateTime</type>
</CustomField>
  1. sfdx force:project:create test
  2. cd test
  3. sfdx force:source:retrieve -u dev -x ../package.xml

Expected result

The custom field and its translation should have been retrieved into the force-app directory.

Actual result

An error message is displayed:
ERROR running force:source:retrieve: Metadata API request failed: Component conversion failed: Unexpected child metadata [.../test/force-app/main/default/objectTranslations/Activity-en_US/CallDate__c.fieldTranslation-meta.xml] found for parent type [CustomObjectTranslation]

System Information

{
	"cliVersion": "sfdx-cli/7.122.1",
	"architecture": "darwin-x64",
	"nodeVersion": "node-v14.18.0",
	"pluginVersions": [
		"@oclif/plugin-autocomplete 0.3.0 (core)",
		"@oclif/plugin-commands 1.3.0 (core)",
		"@oclif/plugin-help 3.2.3 (core)",
		"@oclif/plugin-not-found 1.2.4 (core)",
		"@oclif/plugin-plugins 1.10.1 (core)",
		"@oclif/plugin-update 1.5.0 (core)",
		"@oclif/plugin-warn-if-update-available 1.7.0 (core)",
		"@oclif/plugin-which 1.0.3 (core)",
		"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
		"alias 1.1.21 (core)",
		"apex 0.3.0 (core)",
		"auth 1.7.2 (core)",
		"config 1.2.40 (core)",
		"custom-metadata 1.0.12 (core)",
		"data 0.6.2 (core)",
		"generator 1.2.0 (core)",
		"limits 1.2.2 (core)",
		"org 1.8.1 (core)",
		"salesforce-alm 52.6.0 (core)",
		"schema 1.0.8 (core)",
		"sfdx-cli 7.122.1 (core)",
		"source 1.2.2 (core)",
		"telemetry 1.2.6 (core)",
		"templates 52.4.0 (core)",
		"trust 1.0.8 (core)",
		"user 1.5.0 (core)"
	],
	"osVersion": "Darwin 20.6.0"
}

Additional information

Noticed this behaviour in 7.121.8, tried rc to check if already fixed.

@svenfinitiv svenfinitiv added the investigating We're actively investigating this issue label Oct 12, 2021
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@uwe-voellger
Copy link

Hello, we get this issue with AccountContactRelation and OpportunityTeamMember as well as with one Vlocity object.
After the retrieval failed, one can add an empty object translation file to the right folder and re-run the retrieval, and it is successful.
As already mentioned, formerly there were empty object translation files, which are still exected by @salesforce\source-deploy-retrieve\lib\src\resolve\adapters\decomposedSourceAdapter.js.

@cristiand391 cristiand391 added the bug Issue or pull request that identifies or fixes a bug label Oct 13, 2021
@uip-robot-zz
Copy link

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

@WillieRuemmele
Copy link
Member

Hi @uwe-voellger @svenfinitiv this should be fixed in the latest-rc build of the CLI, v7.125.0

@mshanemc mshanemc closed this as completed Nov 4, 2021
@okhomsielhaddad
Copy link

@WillieRuemmele just updated to v7.125.0 and still getting the same error
image

@Conciscon
Copy link

Updating to 7.126.0 does not help either:
Metadata API request failed: Component conversion failed: Unexpected child metadata [\force-app\main\default\objectTranslations\vlocity_cmt__Interface_BillingInfo__c-en_US\vlocity_cmt__DRBundleName__c.fieldTranslation-meta.xml] found for parent type [CustomObjectTranslation]

@jonathanwiesel
Copy link

Same with 7.127.0

@frankpeleato
Copy link

@WillieRuemmele still experiencing this as of 7.129.0. Can this issue be re-opened?

@WillieRuemmele WillieRuemmele added bug Issue or pull request that identifies or fixes a bug and removed bug Issue or pull request that identifies or fixes a bug labels Nov 30, 2021
@WillieRuemmele
Copy link
Member

Hi @frankpeleato what's the output of sfdx plugins --core? We mention multiple repo's and steps we used to reproduce here are you doing anything different? I'm trying to understand why it's still not working

@frankpeleato
Copy link

@WillieRuemmele

➜  sfdx plugins --core
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.3 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.1 (core)
@oclif/plugin-update 1.5.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
alias 1.1.22 (core)
apex 0.3.0 (core)
auth 1.7.6 (core)
config 1.2.48 (core)
custom-metadata 1.0.12 (core)
data 0.6.5 (core)
generator 1.2.1 (core)
limits 1.2.3 (core)
org 1.9.2 (core)
salesforce-alm 53.4.5 (core)
schema 1.0.10 (core)
sfdx-cli 7.129.0 (core)
source 1.5.3 (core)
telemetry 1.3.0 (core)
templates 52.6.0 (core)
trust 1.0.10 (core)
user 1.5.3 (core)

@shetzel
Copy link
Contributor

shetzel commented Jan 13, 2022

The fix is in the latest CLI release published today. sfdx version 7.133.0

@shetzel shetzel closed this as completed Jan 13, 2022
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 investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests