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

Error (1): undefinedComponentSet when using new 'sfdx project deploy quick' command #2098

Closed
gdman opened this issue Apr 26, 2023 · 7 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@gdman
Copy link

gdman commented Apr 26, 2023

Summary

New sfdx project deploy quick command fails with error Error (1): undefinedComponentSet. However, deployment in org does proceed and is successful.

sfdx force:mdapi:deploy --validateddeployrequestid xxx continues to work as before.

Have tried sfdx project deploy quick with --use-most-recent and by specifying a job id using --job-id - both fail with the same error.

The deploy commands I'm using are:
sfdx project deploy start --dry-run --test-level RunLocalTests --metadata-dir ./temp/deployMain --wait 1000
and
sfdx project deploy validate --test-level RunLocalTests --metadata-dir ./temp/deployMain --wait 10000

The package contents is a trivial hello world apex class and test.

Steps To Reproduce:

Create a directory with metadata and a package.xml - in this example, a couple of apex classes and a package.xml with ApexClass wildcarded (and nothing else)
Validate: sfdx project deploy start --dry-run --test-level RunLocalTests --metadata-dir ./temp/deployMain --wait 1000
Quick deploy: sfdx project deploy quick --use-most-recent

Actual result

Command fails with error: Error (1): undefinedComponentSet but deployment to environment succeeds.

System Information

{
"cliVersion": "sfdx-cli/7.197.8",
"architecture": "darwin-x64",
"nodeVersion": "node-v18.15.0",
"osVersion": "Darwin 21.6.0",
"shell": "zsh",
"rootPath": "/Users/andrew.goodman/.local/share/sfdx/client/7.197.8-077a68b",
"pluginVersions": [
"@oclif/plugin-autocomplete 2.1.8 (core)",
"@oclif/plugin-commands 2.2.13 (core)",
"@oclif/plugin-help 5.2.9 (core)",
"@oclif/plugin-not-found 2.3.23 (core)",
"@oclif/plugin-plugins 2.4.4 (core)",
"@oclif/plugin-search 0.0.15 (core)",
"@oclif/plugin-update 3.1.10 (core)",
"@oclif/plugin-version 1.3.2 (core)",
"@oclif/plugin-warn-if-update-available 2.0.33 (core)",
"@oclif/plugin-which 2.2.18 (core)",
"apex 2.2.12 (core)",
"auth 2.7.12 (core)",
"community 2.2.9 (core)",
"custom-metadata 2.1.12 (core)",
"data 2.3.10 (core)",
"deploy-retrieve 1.8.12 (core)",
"info 2.6.6 (core)",
"limits 2.3.12 (core)",
"org 2.6.12 (core)",
"packaging 1.16.5 (core)",
"schema 2.3.7 (core)",
"settings 1.4.4 (core)",
"signups 1.4.12 (core)",
"source 2.10.2 (core)",
"telemetry 2.1.3 (core)",
"templates 55.4.7 (core)",
"trust 2.4.7 (core)",
"user 2.3.8 (core)",
"@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
"sfdx-cli 7.197.8 (core)"
]
}

Additional information

StartDryRunAndValidate

ExplicitJobId

@gdman gdman added the investigating We're actively investigating this issue label Apr 26, 2023
@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.

@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels May 1, 2023
@git2gus
Copy link

git2gus bot commented May 1, 2023

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

@WillieRuemmele
Copy link
Member

Hi @gdman we're fixing this error now, but also want to point out that if you're goal is to use a deploy quick command, that you generate the deploy and cache'd ID via the deploy validate command, instead of using deploy start --dry-run. That flag will only show you a dry run of the deploy, while quick deploy requires tests to be run before deploying.

@gdman
Copy link
Author

gdman commented Jun 6, 2023

Hi @gdman we're fixing this error now, but also want to point out that if you're goal is to use a deploy quick command, that you generate the deploy and cache'd ID via the deploy validate command, instead of using deploy start --dry-run. That flag will only show you a dry run of the deploy, while quick deploy requires tests to be run before deploying.

Hi, thanks for taking a look at this issue.

I'm confused by your reply though.

When running force:mdapi:deploy with the --checkonly flag, the deprecation notice says to use project deploy start:
Warning: We plan to deprecate this command in the future. Try using the "project deploy start" command instead.
Warning: The "--apiversion" flag has been deprecated. Use "--api-version" instead.
Warning: The "--targetusername" flag has been deprecated. Use "--target-org | -u" instead.

The release notes also say to use project deploy start in place of force:mdapi:deploy and don't mention project deploy validate.

The help for project deploy start contains a --dry-run argument which I assumed replaces --checkonly and by the help text looks like it does the same thing:
--dry-run Validate deploy and run Apex tests but don’t save to the org.

I see that there is also a project deploy validate which I've assumed was the same as doing project deploy start --dry-run, is that not the case? If so, how are these commands different?

@WillieRuemmele
Copy link
Member

Hey @gdman,

I understand where that confusion could come from. We created the --dry-run flag as a way to see what would happen if you tried to run your deployment against a non-prod environment where you could check dependencies and other things.

If you're wanting to recreate the --checkonly flag, we suggest using the project deploy validate and project deploy quick commands.

The --dry-run CAN produce a valid quick deploy id, but isn't guaranteed to, and was failing when it was deploying metadata format, which you discovered. I've put up a PR salesforcecli/plugin-deploy-retrieve#651 addressing that issue

@gdman
Copy link
Author

gdman commented Jun 6, 2023

Hey @gdman,

I understand where that confusion could come from. We created the --dry-run flag as a way to see what would happen if you tried to run your deployment against a non-prod environment where you could check dependencies and other things.

If you're wanting to recreate the --checkonly flag, we suggest using the project deploy validate and project deploy quick commands.

The --dry-run CAN produce a valid quick deploy id, but isn't guaranteed to, and was failing when it was deploying metadata format, which you discovered. I've put up a PR salesforcecli/plugin-deploy-retrieve#651 addressing that issue

Thanks for the clarification.

@Hemanta-Chandra-POC
Copy link

Hello @WillieRuemmele, @mshanemc,

While updating the command for pipelines to latest SF commands we are facing the same above issue: "undefinedComponentSet".
Command:
DEPLOYID=$(sf data query -q "SELECT Id FROM DeployRequest WHERE CompletedDate = LAST_N_DAYS:7 AND Status = 'Succeeded' AND checkOnly = true order by CompletedDate desc limit 1 " -t -o $(Org-Username) | grep -E '0Af|0Af')

echo "Deployment id is == "${DEPLOYID}
if [[ ${DEPLOYID} == "0Af" ]]; then
echo "Deploying components."
SFDX_DISABLE_DNS_CHECK=true sf project deploy quick --job-id ${DEPLOYID} -w $(WAIT-TIME) -o $(Org-Username)
else
echo "##vso[task.logissue type=error]Quick deployment id not found."
exit 1
fi

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

5 participants