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 delete source" crashs at metadata which exists in the org, but not in the DX project #2836

Closed
OpaSteve opened this issue Apr 22, 2024 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@OpaSteve
Copy link

Summary

Since 2.36.x of the CLI the command project delete source is not working properly and results in an error message

Error (10): c.walkContent is not a function or its return value is not iterable

This happens with metadata, which only exists in the org, but not in the local DX project.

CLI versions older than 2.36 work properly.

Steps To Reproduce

Enter

sf project delete source -m <metadata-type:metadata-name> -o <yourOrg>

i. e.

sf project delete source -m ValidationRule:bla__c.ruleNotInLocalProject -o "Fancy Org"

Expected result

Either the existing metadata has been deleted in my org, or the message "No Validation Rule named: bla__c.ruleNotInLocalProject" appears.

Actual result

Error (10): c.walkContent is not a function or its return value is not iterable

System Information

Terminal window of Visual Studio Code or windows cmd shell (same result). CLI version @salesforce/cli/2.37.4 win32-x64 node-v20.11.1.

sf version --verbose
CLI Version:
@salesforce/cli/2.37.4

Architecture:
win32-x64

Node Version:
node-v20.11.1

Plugin Version:
@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)

OS and Version:
Windows_NT 10.0.19044

Shell:
cmd.exe

Root Path:
C:\Users\Stefan\AppData\Local\sf\client\2.37.4-fb2a8ae

sf doctor:

{
  "versionDetail": {
    "architecture": "win32-x64",
    "cliVersion": "@salesforce/cli/2.37.4",
    "nodeVersion": "node-v20.11.1",
    "osVersion": "Windows_NT 10.0.19044",
    "rootPath": "C:\\Users\\Stefan\\AppData\\Local\\sf\\client\\2.37.4-fb2a8ae",
    "shell": "cmd.exe",
    "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)"
    ]
  },
  "sfdxEnvVars": [],
  "sfEnvVars": [
    [
      "SF_AUTOUPDATE_DISABLE",
      "false"
    ],
    [
      "SF_BINPATH",
      "C:\\Users\\Stefan\\AppData\\Local\\sf\\client\\bin\\sf"
    ]
  ],
  "cliConfig": {
    "arch": "x64",
    "bin": "sf",
    "binAliases": [
      "sfdx"
    ],
    "binPath": "C:\\Users\\Stefan\\AppData\\Local\\sf\\client\\bin\\sf",
    "cacheDir": "C:\\Users\\Stefan\\AppData\\Local\\sf",
    "channel": "stable",
    "configDir": "C:\\Users\\Stefan\\AppData\\Local\\sf",
    "dataDir": "C:\\Users\\Stefan\\AppData\\Local\\sf",
    "debug": 0,
    "dirname": "sf",
    "errlog": "C:\\Users\\Stefan\\AppData\\Local\\sf\\error.log",
    "flexibleTaxonomy": true,
    "home": "C:\\Users\\Stefan",
    "isSingleCommandCLI": false,
    "name": "@salesforce/cli",
    "nsisCustomization": "scripts/nsis.nsi",
    "platform": "win32",
    "root": "C:\\Users\\Stefan\\AppData\\Local\\sf\\client\\2.37.4-fb2a8ae",
    "shell": "cmd.exe",
    "theme": {
      "bin": "blueBright",
      "command": "blueBright",
      "dollarSign": "green",
      "flag": "green",
      "flagDefaultValue": "blueBright",
      "flagOptions": "blueBright",
      "flagRequired": "red",
      "sectionHeader": "blue",
      "topic": "blueBright"
    },
    "topicSeparator": " ",
    "userAgent": "@salesforce/cli/2.37.4 win32-x64 node-v20.11.1",
    "valid": true,
    "version": "2.37.4",
    "warned": false,
    "windows": true,
    "_base": "@oclif/core@3.26.2",
    "_commands": {},
    "_topics": {},
    "commandPermutations": {
      "validPermutations": {}
    },
    "pluginLoader": {
      "options": {
        "root": "C:\\Users\\Stefan\\AppData\\Local\\sf\\client\\2.37.4-fb2a8ae\\dist"
      },
      "errors": [],
      "plugins": {},
      "pluginsProvided": false
    },
    "topicPermutations": {
      "validPermutations": {}
    },
    "nodeEngine": ">=18.0.0"
  },
  "pluginSpecificData": {
    "@salesforce/plugin-deploy-retrieve": [
      {
        "sourceApiVersion": "59.0",
        "targetOrgApiVersion": "59.0"
      }
    ],
    "@salesforce/plugin-auth": [
      {
        "isUsingGenericKeychain": true,
        "sfCryptoV2Support": true,
        "cryptoVersion": "v1"
      }
    ]
  },
  "diagnosticResults": [
    {
      "testName": "salesforcedx plugin not installed",
      "status": "pass"
    },
    {
      "testName": "no linked plugins",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-deploy-retrieve] sourceApiVersion matches default target org max apiVersion",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-auth] CLI supports v2 crypto",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-auth] CLI using stable v1 crypto",
      "status": "pass"
    },
    {
      "testName": "using latest or latest-rc CLI version",
      "status": "unknown"
    }
  ],
  "suggestions": [
    "Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.",
    "Check http://status.salesforce.com for general Salesforce availability and performance.",
    "Couldn't determine latest CLI version due to:\nnpm ERR! code SELF_SIGNED_CERT_IN_CHAIN\nnpm ERR! errno SELF_SIGNED_CERT_IN_CHAIN\nnpm ERR! request to https://dev-repos-prod-web.services.debeka.de/artifactory/api/npm/npm-virtual/@salesforce%2fcli failed, reason: self-signed certificate in certificate chain\n\nnpm ERR! A complete log of this run can be found in: C:\\Progs\\nodejs\\npm-cache\\_logs\\2024-04-22T08_38_55_303Z-debug-0.log\n"
  ],
  "logFilePaths": [],
  "commandExitCode": 0
}

Additional information

image

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

@github-actions github-actions bot added the validated Version information for this issue has been validated label Apr 22, 2024
@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Apr 22, 2024
Copy link

git2gus bot commented Apr 22, 2024

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

@mshanemc
Copy link
Contributor

workaround: the bug happens when we're building the prompt to tell you what's going to be delete. --no-prompt will skip that and get you around the bug.

Fix in progress.

@OpaSteve
Copy link
Author

Thanks for the workaround hint! This helps while we are waiting for the fix.

@jshackell-sfdc
Copy link
Collaborator

This issue is fixed in version 2.39.6 of Salesforce CLI.

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

No branches or pull requests

3 participants