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

sf project retrieve start is requesting "directory with a valid DX project" even when using METADATA API FORMAT FLAGS #2831

Closed
yurifugi opened this issue Apr 18, 2024 · 9 comments
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@yurifugi
Copy link

Using the latest sf version

❯ sf -v
@salesforce/cli/2.36.8 linux-x64 node-v20.11.1

After issuing the retrieve command, with parameters indicating that the retrieve is for a .zip file containing metadata API format:

sf project retrieve start  \
    --zip-file-name -unpackaged.zip \
    --json \
    --target-metadata-dir . \
    --wait 300 \
    --manifest package.xml \
    --target-org org-prod

the command will return with an error message stating that the command must be run from inside a sfdx project:

{
  "code": 1,
  "context": "RetrieveMetadata",
  "commandName": "RetrieveMetadata",
  "message": "This directory does not contain a valid Salesforce DX project.",
  "name": "InvalidProjectWorkspaceError",
  "status": 1,
  "stack": "InvalidProjectWorkspaceError: This directory does not contain a valid Salesforce DX project.\n    at Messages.createError (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@salesforce/core/lib/messages.js:431:16)\n    at resolveProjectPathSync (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@salesforce/core/lib/util/internal.js:80:24)\n    at SfProject.resolveProjectPathSync (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@salesforce/core/lib/sfProject.js:393:54)\n    at SfProject.getInstance (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@salesforce/core/lib/sfProject.js:360:21)\n    at RetrieveMetadata.run (file:///home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@salesforce/plugin-deploy-retrieve/lib/commands/project/retrieve/start.js:139:68)\n    at async RetrieveMetadata._run (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@oclif/core/lib/command.js:311:22)\n    at async Config.runCommand (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@oclif/core/lib/config/config.js:433:25)\n    at async run (/home/yuri/.local/share/sf/client/2.36.8-fa01960/node_modules/@oclif/core/lib/main.js:92:16)",
  "exitCode": 1,
  "warnings": []
}

For earlier sf versions the retrieve in metadata API format was possible without running the command inside a sfdx directory folder.

Is this the expected behavior now? Or should it still be possible to retieve metadata API format inside a regular directory?

@yurifugi yurifugi added the investigating We're actively investigating this issue label Apr 18, 2024
Copy link

Hello @yurifugi 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Apr 18, 2024
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.

@yurifugi
Copy link
Author

❯ sf version --verbose --json
{
  "architecture": "linux-x64",
  "cliVersion": "@salesforce/cli/2.36.8",
  "nodeVersion": "node-v20.11.1",
  "osVersion": "Linux 5.14.21-150400.24.100-default",
  "rootPath": "/home/yuri/.local/share/sf/client/2.36.8-fa01960",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.13 (core)",
    "@oclif/plugin-commands 3.2.2 (core)",
    "@oclif/plugin-help 6.0.20 (core)",
    "@oclif/plugin-not-found 3.1.1 (core)",
    "@oclif/plugin-plugins 5.0.5 (core)",
    "@oclif/plugin-search 1.0.20 (core)",
    "@oclif/plugin-update 4.2.3 (core)",
    "@oclif/plugin-version 2.0.16 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.15 (core)",
    "@oclif/plugin-which 3.1.7 (core)",
    "@salesforce/cli 2.36.8 (core)",
    "apex 3.1.3 (core)",
    "auth 3.5.1 (core)",
    "data 3.2.4 (core)",
    "deploy-retrieve 3.5.3 (core)",
    "info 3.1.2 (core)",
    "limits 3.2.1 (core)",
    "marketplace 1.1.0 (core)",
    "org 3.6.3 (core)",
    "packaging 2.3.0 (core)",
    "schema 3.2.0 (core)",
    "settings 2.1.2 (core)",
    "sobject 1.2.1 (core)",
    "source 3.2.2 (core)",
    "telemetry 3.1.17 (core)",
    "templates 56.1.0 (core)",
    "trust 3.5.1 (core)",
    "user 3.4.3 (core)"
  ]
}

Copy link

Hello @yurifugi 👋 None of the versions of sf you shared match the latest release.

Shared: 2.36.8, 2.36.8
Latest: 2.37.4

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

@yurifugi
Copy link
Author

Hello,

I have update sf to the lastest version:

❯ sf version --verbose --json
{
  "architecture": "linux-x64",
  "cliVersion": "@salesforce/cli/2.37.4",
  "nodeVersion": "node-v20.11.1",
  "osVersion": "Linux 5.14.21-150400.24.100-default",
  "rootPath": "/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.13 (core)",
    "@oclif/plugin-commands 3.2.2 (core)",
    "@oclif/plugin-help 6.0.20 (core)",
    "@oclif/plugin-not-found 3.1.2 (core)",
    "@oclif/plugin-plugins 5.0.7 (core)",
    "@oclif/plugin-search 1.0.20 (core)",
    "@oclif/plugin-update 4.2.4 (core)",
    "@oclif/plugin-version 2.0.16 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.15 (core)",
    "@oclif/plugin-which 3.1.7 (core)",
    "@salesforce/cli 2.37.4 (core)",
    "apex 3.1.4 (core)",
    "auth 3.5.5 (core)",
    "data 3.2.5 (core)",
    "deploy-retrieve 3.5.6 (core)",
    "info 3.1.3 (core)",
    "limits 3.2.1 (core)",
    "marketplace 1.1.1 (core)",
    "org 4.0.4 (core)",
    "packaging 2.3.0 (core)",
    "schema 3.2.1 (core)",
    "settings 2.1.2 (core)",
    "sobject 1.2.2 (core)",
    "source 3.2.3 (core)",
    "telemetry 3.1.18 (core)",
    "templates 56.1.1 (core)",
    "trust 3.5.4 (core)",
    "user 3.4.3 (core)"
  ]
}

After updating sf, the retrieve command continues returning with error because it was issued not on a sfdx project directory:

❯ sf project retrieve start  --zip-file-name unpackaged.zip --json --target-metadata-dir . --wait 300 --manifest package.xml --target-org org-prod
{
  "code": 1,
  "context": "RetrieveMetadata",
  "commandName": "RetrieveMetadata",
  "message": "This directory does not contain a valid Salesforce DX project.",
  "name": "InvalidProjectWorkspaceError",
  "status": 1,
  "stack": "InvalidProjectWorkspaceError: This directory does not contain a valid Salesforce DX project.\n    at Messages.createError (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@salesforce/core/lib/messages.js:431:16)\n    at resolveProjectPathSync (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@salesforce/core/lib/util/internal.js:80:24)\n    at SfProject.resolveProjectPathSync (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@salesforce/core/lib/sfProject.js:393:54)\n    at SfProject.getInstance (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@salesforce/core/lib/sfProject.js:360:21)\n    at RetrieveMetadata.run (file:///home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@salesforce/plugin-deploy-retrieve/lib/commands/project/retrieve/start.js:139:68)\n    at async RetrieveMetadata._run (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@oclif/core/lib/command.js:311:22)\n    at async Config.runCommand (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@oclif/core/lib/config/config.js:433:25)\n    at async run (/home/yuri/.local/share/sf/client/2.37.4-fb2a8ae/node_modules/@oclif/core/lib/main.js:92:16)",
  "exitCode": 1,
  "warnings": []
}

@github-actions github-actions bot added validated Version information for this issue has been validated investigating We're actively investigating this issue and removed more information required Issue requires more information or a response from the customer labels Apr 18, 2024
@jhgihub0
Copy link

I have the same issue #2832. It seems it started with 2.36.2

@mshanemc
Copy link
Contributor

duplicate of #2832 (I know this was one was in a couple hours earlier, but I saw the other one first)

@mshanemc
Copy link
Contributor

found the bug, have a fix coming

@jhgihub0
Copy link

2.39.4 fixed for me

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 validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants