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 Deploying w Unreleased API Version by Default #1656

Closed
scottbcovert opened this issue Aug 4, 2022 · 9 comments
Closed

sfdx Deploying w Unreleased API Version by Default #1656

scottbcovert opened this issue Aug 4, 2022 · 9 comments
Labels
investigating We're actively investigating this issue

Comments

@scottbcovert
Copy link

scottbcovert commented Aug 4, 2022

Summary

This AM I started having issues with sfdx force:source:deploy -p ... pushing source w/ API version 56.0 (upcoming/unreleased Winter '23) by default. I eventually just forced the API version used by sfdx to be 55.0 but another dev just reported seeing the same thing also starting this AM. We both initially were on sfx-cli/7.161.0 and then upgraded to sfdx-cli/7.162.0 with no effect.

Steps To Reproduce:

Repository to reproduce: dreamhouse-lwc

  1. Remove the specific sourceApiVersion value from sfdx-project.json that would otherwise force sfdx to deploy using v55.0
  2. Run sfdx force:source:deploy -p force-app against a new scratch org spun up with Summer '22 (v55.0)
  3. Confirm deployment fails with the following message Error package.xml Invalid version specified:56.0

Expected result

sfdx should use latest released version of API (v55.0) for deployment, which should then succeed.

Actual result

sfdx attempts to deploy using unreleased API version v56.0, which results in the deployment failing.

System Information

  • I am using zsh
{
        "cliVersion": "sfdx-cli/7.162.0",
        "architecture": "darwin-x64",
        "nodeVersion": "node-v14.16.1",
        "pluginVersions": [
                "@oclif/plugin-autocomplete 0.3.0 (core)",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.3.1 (core)",
                "@oclif/plugin-not-found 1.2.6 (core)",
                "@oclif/plugin-plugins 1.10.11 (core)",
                "@oclif/plugin-update 1.5.0 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.3 (core)",
                "@oclif/plugin-which 1.0.4 (core)",
                "@salesforce/sfdx-plugin-lwc-test 1.0.0 (core)",
                "alias 2.1.0 (core)",
                "apex 1.1.0 (core)",
                "auth 2.2.3 (core)",
                "community 2.0.0 (core)",
                "config 1.4.14 (core)",
                "custom-metadata 2.0.0 (core)",
                "data 2.1.1 (core)",
                "generator 2.0.2 (core)",
                "info 2.0.1 (core)",
                "limits 2.0.1 (core)",
                "org 2.0.7 (core)",
                "rest-explorer 0.0.0",
                "salesforce-alm 54.6.4 (core)",
                "schema 2.1.1 (core)",
                "sfdx-cli 7.162.0 (core)",
                "shane-sfdx-plugins 4.43.0",
                "├─ @mshanemc/plugin-streaming 1.1.7",
                "└─ @mshanemc/sfdx-sosl 1.1.0",
                "signups 1.2.0 (core)",
                "source 2.0.11 (core)",
                "telemetry 2.0.0 (core)",
                "templates 55.0.0 (core)",
                "trust 2.0.2 (core)",
                "user 2.1.0 (core)"
        ],
        "osVersion": "Darwin 18.7.0"
}
@scottbcovert scottbcovert added the investigating We're actively investigating this issue label Aug 4, 2022
@github-actions
Copy link

github-actions bot commented Aug 4, 2022

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.

@chivalry
Copy link

chivalry commented Aug 4, 2022

I'm seeing the same error this morning with sfdx force:source:push --loglevel fatal --forceoverwrite until I add "sourceApiVersion": "55.0" to sfdx-project.json.

@peternhale peternhale added the bug Issue or pull request that identifies or fixes a bug label Aug 4, 2022
@git2gus
Copy link

git2gus bot commented Aug 4, 2022

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

@peternhale peternhale added the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label Aug 4, 2022
@peternhale
Copy link
Contributor

peternhale commented Aug 4, 2022

Thanks for reporting the issue. We have determined the cause. The workaround will require the presence of property sourceApiVersion in your project json.

@peternhale peternhale removed the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label Aug 4, 2022
@forcedotcom forcedotcom deleted a comment from github-actions bot Aug 4, 2022
@scottbcovert
Copy link
Author

Thanks for jumping on this, @peternhale

@tehnrd
Copy link

tehnrd commented Aug 6, 2022

I also started to see this and some really unhelpful error messages. I am using VS Code (Salesforce Extension Pack 55.8.0) to deploy and kept receiving the following response even when I knew 100% there were changes to deploy:

=== Pushed Source
No results found

I eventually looked at the Deployment Status in Setup, and this is where I saw the deploys failed with the following Invalid version specified error. And while the error references package.xml I am doing source development to a scratch org and do not have a package.xml file.
Screen Shot 2022-08-05 at 11 48 00 PM

It is also worth noting that I have set the "sourceApiVersion": "52.0", value in the project.json file, but it is not being used by SFDX in VS Code.

My workaround, for now, is to manually run sfdx commands and not use VS Code to deploy on save, as this does not currently work.

@tehnrd
Copy link

tehnrd commented Aug 6, 2022

Update on my issue. I have a monorepo with the managed package, some AWS code, and documentation. In the root of the entire project directory, I have a lightweight sfdx-project.json file as this is required for the SFDX tools within VS Code to load. I have another sfdx-project.json in the package directory for package-specific properties such as versioning, namespace, etc.

Adding sourceApiVersion to the root sfdx-project.json file resolved my issue.

{
  "sourceApiVersion": "55.0",
  "packageDirectories": [
    {
      "path": "packages/package/force-app",
      "default": true
    },
    {
      "path": "packages/package/unpackaged",
      "default": false
    }
  ]
}

@peternhale peternhale removed the bug Issue or pull request that identifies or fixes a bug label Aug 8, 2022
@pgonzaleznetwork
Copy link

@mshanemc is the solution to this to always specify the sourceApiVersion?

@mshanemc
Copy link
Contributor

yeah, I'd always recommend specifying sourceApiVersion in the project. The sf project generate command should set that up for you automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

6 participants