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

force:source:convert error when deploying child metadata without parent object #1110

Closed
pfordey opened this issue Aug 6, 2021 · 11 comments
Closed
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@pfordey
Copy link

pfordey commented Aug 6, 2021

Summary

When attempting to convert from source to metadata format using force:source:convert where one or more child metadata files are to be deployed but the parent object file is not included the following error is being returned:

Metadata xml file /Users/patrick/SFDXCLI-Issues/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/hed__Term__c.object-meta.xml is forceignored but is required for /Users/patrick/SFDXCLI-Issues/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/fields/Term_Title__c.field-meta.xml

Steps To Reproduce:

Repo with example to reproduce https://github.com/pfordey/SFDXCLI-Issues

run sfdx force:source:convert -d ./mdapi_output_dir and you will get the error provided above. If you remove the parent object metafile from the forceignore file it will then work as expected.

Expected result

Following message appears in terminal - Source was successfully converted to Metadata API format and written to the location: mdapi_output_dir

Actual result

Error is given:

Metadata xml file /Users/patrick/SFDXCLI-Issues/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/hed__Term__c.object-meta.xml is forceignored but is required for /Users/patrick/SFDXCLI-Issues/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/fields/Term_Title__c.field-meta.xml

System Information

{
"cliVersion": "sfdx-cli/7.112.1",
"architecture": "darwin-x64",
"nodeVersion": "node-v14.17.4",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.2.2 (core)",
"@oclif/plugin-not-found 1.2.4 (core)",
"@oclif/plugin-plugins 1.10.1 (core)",
"@oclif/plugin-update 1.4.0-3 (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)",
"@salesforce/sfdx-trust 3.6.0 (core)",
"alias 1.1.10 (core)",
"apex 0.2.3 (core)",
"auth 1.7.1 (core)",
"config 1.2.14 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.0 (core)",
"generator 1.1.7 (core)",
"limits 1.2.1 (core)",
"org 1.6.7 (core)",
"salesforce-alm 52.2.3 (core)",
"schema 1.0.8 (core)",
"sfdx-cli 7.112.1 (core)",
"source 1.0.6 (core)",
"telemetry 1.2.3 (core)",
"templates 52.1.0 (core)",
"user 1.4.0 (core)"
],
"osVersion": "Darwin 20.5.0"
}

@pfordey pfordey added the investigating We're actively investigating this issue label Aug 6, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

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.

@mshanemc
Copy link
Contributor

mshanemc commented Aug 6, 2021

@pfordey what was happening before when you got a success message? The object and all its children were all being ignored and not in the output?

BTW, nice repro-repo.

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Aug 6, 2021
@pfordey
Copy link
Author

pfordey commented Aug 6, 2021

@mshanemc prior to version 7.112 everything was working and the source was converted with the following output:

Source was successfully converted to Metadata API format and written to the location:

The fields for the objects were being correctly pushed into the packaging org and added to the managed package within that org. This was not just fields but also compact layouts, list views, validation rules and actions. Since 7.112 was the current stable release we have been getting the error about requiring the parent object metadata file.

Some extra context:

The SFDX CLI is being installed in a Ubuntu VM that is being called from Github Actions to create a VM to pull down the code, run a number of scripts to take the source format, convert it to the metadata format, create a package.xml with the namespace of the managed package that it is being pushed into added and then deployed into a packaging org with the namespace in the package.xml so that it automatically adds new items to the package.

We do not want to include the complete metadata file for objects as some of those objects, such as the one in the example repo, are part of other managed packages and so including them in our source and being pushed into our packaging org causes issues when those objects are updated by the owner of the dependent package as well as us adding items to the package that we do not want to do. Since the source format does not include any way to push to a packaging org and include what is being pushed into the managed package in that org we can only manually add items to the package that is time consuming and error prone or convert to metadata format, build a package.xml with the name space added to it and then push via the metadata api methods within SFDC CLI.

You are welcome for the repo, it is not hard to make a project and add a few files and it helps me as much as you :)

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Aug 6, 2021
@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug plugin-source and removed investigating We're actively investigating this issue labels Aug 6, 2021
@uip-robot-zz
Copy link

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

@uip-robot-zz
Copy link

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

@azlam-abdulsalam
Copy link

This would break a lot of projects . As @pfordey mentioned in the additional context, we should not be requiring object-meta.xml as these metadata components are individually deployable

@WillieRuemmele
Copy link
Member

Hi @pfordey this should be fixed in the latest-rc build of the cli 1.115.0, you can get it by either sfdx update stable-rc or npm install sfdx-cli@latest-rc --global depending on your preferred install method.

Please let us know if you're still seeing this in 1.115.0 of the CLI

@pfordey
Copy link
Author

pfordey commented Aug 24, 2021

@WillieRuemmele still getting 1.114 coming when running sfdx update, once I see 1.115 I will test and let you know. Thanks.

@WillieRuemmele
Copy link
Member

did you run sfdx update stable-rc? you need to specify stable-rc to get the preview build (115)

@maggiben
Copy link
Contributor

Testing the deployment org with v7.116.0 works as expected, please try upgrading to the latests rc as @WillieRuemmele mentioned earlier: npm install -g sfdx-cli@latest-rc
image

@pfordey
Copy link
Author

pfordey commented Aug 27, 2021

@WillieRuemmele I can confirm that with 1.115.1 the issue is corrected. Thank you.

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
Projects
None yet
Development

No branches or pull requests

7 participants