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

Simple Retrieve or Org Browser does not work #2399

Closed
JodieM opened this issue Aug 10, 2023 · 7 comments
Closed

Simple Retrieve or Org Browser does not work #2399

JodieM opened this issue Aug 10, 2023 · 7 comments
Labels
bug Issue or pull request that identifies or fixes a bug validated Version information for this issue has been validated

Comments

@JodieM
Copy link

JodieM commented Aug 10, 2023

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
    Yes
  • You've searched both open and closed issues for related posts.
    Tried
  • You've used the doctor command to diagnose common issues.
    Yes
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    Yes
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

running sf retrieve start does not retrieve anything.
downloading anything from the org browser does not download anything, but no errors.

Steps To Reproduce

See Video here https://www.loom.com/share/97391521912641a39875a21272162f9f?sid=cf8e0d08-ffc1-4d64-8e7b-a6be12ae47a8
Basic steps

  1. Clone code from main branch on https://github.com/SFDO-Community/Salesforce-Indicators
  2. Create new Scratch org
  3. Deploy code to org
  4. Modify a Lightning Page (eg Lead) to add the component to the page
  5. run sf project retrieve start
sf project retrieve start
(Use `node --trace-warnings ...` to show where the warning was created)
Retrieving v58.0 metadata from [email protected] using the v58.0 SOAP API
Preparing retrieve request... Succeeded
 »   Warning: Nothing retrieved
  1. Open Org Browser
  2. Download newly created Lead Flexipage
  3. No errors, nothing downloaded.

Expected result

I expect any changes made in the org will be retrieved from the org

Actual result

nothing is retrieved.

Troubleshooting:

  • Uninstalled CLI
  • Reinstalled CLI using NPM
  • I initially had the problem in a Hyperforce Org so I craeted a brand new dev hub and a brand new scratch org not on Hyperforce to test that it is not hyperforce related.
  • Nothing related to flexipages is in forceignore
  • source API version is 58.0
  • My scratch org user, my dev hub, and my windows PC are all on the same timezone
  • This is a very new PC and the issue was there before I uninstalled the CLI this time around.
  • I don't think I'm doing anything wrong. I know right clicking on the folder and using the menu command to retrieve will only retrieve files already created. Previously I even tried to create a basic flexi page file and retreive just that using the menu commands and it did not update the file
  • This works and retrieves all my changes sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip
  • doing Select Id, MemberIdOrName, MemberName, MemberType, RevisionNum from SourceMember works and retrieves the following (edited for clarity)
_,"Id","MemberIdOrName","MemberName","MemberType","RevisionNum"
[SourceMember],"0MZ6D00000AiwHNWAZ","0M06D000000PcFUSA0","Lead_Record_Page","FlexiPage","288"
[SourceMember],"0MZ6D00000AiwHSWAZ","Lead","Lead","CustomObject","206"
[SourceMember],"0MZ6D00000AiwHhWAJ","m006D000000EdelQAC","Indicator_Bundle_Item.Lead_ID","CustomMetadata","213"
[SourceMember],"0MZ6D00000AiwHXWAZ","m016D00000060hFQAQ","Indicator_Bundle.Lead","CustomMetadata","209"
[SourceMember],"0MZ6D00000AiwHcWAJ","m036D000000EvFhQAK","Indicator_Item.Lead_ID","CustomMetadata","211"

System Information

Powershell Windows 11

{
  "cliVersion": "@salesforce/cli/2.3.8",
  "architecture": "win32-x64",
  "nodeVersion": "node-v20.3.0",
  "osVersion": "Windows_NT 10.0.22621",
  "shell": "cmd.exe",
  "rootPath": "C:\\Users\\JodieM\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.3 (core)",
    "@oclif/plugin-commands 2.2.21 (core)",
    "@oclif/plugin-help 5.2.15 (core)",
    "@oclif/plugin-not-found 2.3.34 (core)",
    "@oclif/plugin-plugins 3.1.8 (core)",
    "@oclif/plugin-search 0.0.21 (core)",
    "@oclif/plugin-update 3.1.28 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.46 (core)",
    "@oclif/plugin-which 2.2.29 (core)",
    "@salesforce/cli 2.3.8 (core)",
    "apex 2.3.9 (core)",
    "auth 2.8.10 (core)",
    "data 2.5.4 (core)",
    "deploy-retrieve 1.16.5 (core)",
    "info 2.6.35 (core)",
    "limits 2.3.27 (core)",
    "login 1.2.23 (core)",
    "org 2.9.28 (core)",
    "schema 2.3.21 (core)",
    "settings 1.4.21 (core)",
    "sobject 0.1.42 (core)",
    "source 2.10.28 (core)",
    "telemetry 2.2.3 (core)",
    "templates 55.5.7 (core)",
    "trust 2.5.1 (core)",
    "user 2.3.27 (core)"
  ]
}

Additional information

doctor command output

{
  "versionDetail": {
    "cliVersion": "@salesforce/cli/2.3.8",
    "architecture": "win32-x64",
    "nodeVersion": "node-v20.3.0",
    "osVersion": "Windows_NT 10.0.22621",
    "shell": "cmd.exe",
    "rootPath": "C:\\Users\\JodieM\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
    "pluginVersions": [
      "@oclif/plugin-autocomplete 2.3.3 (core)",
      "@oclif/plugin-commands 2.2.21 (core)",
      "@oclif/plugin-help 5.2.15 (core)",
      "@oclif/plugin-not-found 2.3.34 (core)",
      "@oclif/plugin-plugins 3.1.8 (core)",
      "@oclif/plugin-search 0.0.21 (core)",
      "@oclif/plugin-update 3.1.28 (core)",
      "@oclif/plugin-version 1.3.8 (core)",
      "@oclif/plugin-warn-if-update-available 2.0.46 (core)",
      "@oclif/plugin-which 2.2.29 (core)",
      "@salesforce/cli 2.3.8 (core)",
      "apex 2.3.9 (core)",
      "auth 2.8.10 (core)",
      "data 2.5.4 (core)",
      "deploy-retrieve 1.16.5 (core)",
      "info 2.6.35 (core)",
      "limits 2.3.27 (core)",
      "login 1.2.23 (core)",
      "org 2.9.28 (core)",
      "schema 2.3.21 (core)",
      "settings 1.4.21 (core)",
      "sobject 0.1.42 (core)",
      "source 2.10.28 (core)",
      "telemetry 2.2.3 (core)",
      "templates 55.5.7 (core)",
      "trust 2.5.1 (core)",
      "user 2.3.27 (core)"
    ]
  },
  "sfdxEnvVars": [],
  "sfEnvVars": [
    [
      "SF_AUTOUPDATE_DISABLE",
      "true"
    ],
    [
      "SF_DISABLE_AUTOUPDATE",
      "true"
    ],
    [
      "SF_UPDATE_INSTRUCTIONS",
      "Use \"npm update --global @salesforce/cli\" to update npm-based installations."
    ]
  ],
  "cliConfig": {
    "_base": "@oclif/[email protected]",
    "debug": 0,
    "topicSeparator": " ",
    "warned": false,
    "commandPermutations": {
      "validPermutations": {}
    },
    "topicPermutations": {
      "validPermutations": {}
    },
    "_commands": {},
    "_topics": {},
    "root": "C:\\Users\\JodieM\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
    "name": "@salesforce/cli",
    "version": "2.3.8",
    "channel": "stable",
    "valid": true,
    "arch": "x64",
    "platform": "win32",
    "windows": true,
    "bin": "sf",
    "binAliases": [
      "sfdx"
    ],
    "nsisCustomization": "scripts/nsis.nsi",
    "dirname": "sf",
    "flexibleTaxonomy": true,
    "userAgent": "@salesforce/cli/2.3.8 win32-x64 node-v20.3.0",
    "shell": "cmd.exe",
    "home": "C:\\Users\\JodieM",
    "cacheDir": "C:\\Users\\JodieM\\AppData\\Local\\sf",
    "configDir": "C:\\Users\\JodieM\\AppData\\Local\\sf",
    "dataDir": "C:\\Users\\JodieM\\AppData\\Local\\sf",
    "errlog": "C:\\Users\\JodieM\\AppData\\Local\\sf\\error.log",
    "nodeEngine": ">=14.0.0"
  },
  "pluginSpecificData": {
    "@salesforce/plugin-source": [
      {
        "sourceApiVersion": "58.0",
        "targetDevHubApiVersion": "58.0",
        "targetOrgApiVersion": "58.0"
      }
    ]
  },
  "diagnosticResults": [
    {
      "testName": "salesforcedx plugin not installed",
      "status": "pass"
    },
    {
      "testName": "no linked plugins",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-source] sourceApiVersion matches apiVersion",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-source] default target DevHub max apiVersion matches default target org max apiVersion",
      "status": "pass"
    },
    {
      "testName": "[@salesforce/plugin-source] sourceApiVersion matches default target org max apiVersion",
      "status": "pass"
    },
    {
      "testName": "using latest or latest-rc CLI version",
      "status": "pass"
    }
  ],
  "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."
  ],
  "logFilePaths": [],
  "commandExitCode": 0
}```
@JodieM JodieM added the investigating We're actively investigating this issue label Aug 10, 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.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Aug 10, 2023
@cristiand391 cristiand391 added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Aug 15, 2023
@git2gus
Copy link

git2gus bot commented Aug 15, 2023

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

@JodieM
Copy link
Author

JodieM commented Sep 10, 2023

Is there any update or workaround for this issue please? I really need to be able to retrieve something from a scratch org. I am currently setting up my third demo scratch org from scratch due to this issue.

@shetzel
Copy link
Contributor

shetzel commented Sep 10, 2023

I can tell you that the flow you describe absolutely works from the CLI. We have many tests that prove this basic functionality before any changes are made to the CLI plugins and libraries. That said, the video you linked (thank you for that) is mostly from VS Code, so you may want to uninstall VS Code and reinstall. Before you do that though, what you are seeing may be due to targeting the wrong org. If you make changes in a different org then pull (or retrieve) it won't find anything. You can explicitly target the org you want to retrieve from using the CLI (--target-org flag). If the SourceMember query you are running works, then the pull should also work since it runs that same query to build the manifest that it uses for the retrieve.

It might be worth doing your flow only using the CLI from a shell to see if it reproduces. If it doesn't, then I'd suspect something is messed up in VS Code extensions.

@JodieM
Copy link
Author

JodieM commented Sep 11, 2023

OK explicitly setting the org worked and I was able to retrieve, however, I've always created my scratch orgs as the default, only usually have one scratch org on the go, and it's showing in the bottom left hand corner of VSCode as the default. I've followed the steps here https://trailhead.salesforce.com/content/learn/projects/quick-start-salesforce-dx/create-and-test-our-scratch-org and their deploy command doesn't set an org explicitly so I wonder what has changed in the new SF commands that you have to set the org?

@shetzel
Copy link
Contributor

shetzel commented Sep 11, 2023

If you're creating multiple scratch orgs and defaults, it might be replacing 1 default with another. You can check the default (from the CLI) with sf config list. It appears that the mix of VS Code actions and CLI commands with multiple scratch orgs might be causing some confusion. New sf CLI commands work the same way as sfdx CLI commands w.r.t how default orgs are applied.

@shetzel
Copy link
Contributor

shetzel commented Nov 2, 2023

Here is your problem: https://github.com/SFDO-Community/Salesforce-Indicators/blob/main/.forceignore#L22

You can't forceignore **/unpackaged/** or everything from a retrieve will be ignored because that's the directory within the retrieved zip file that all unpackaged metadata goes. E.g., unpackaged/flexipages/Lead_Record_Page
If you comment that entry or remove it, then do your retrieve it works.

Maybe we can add a warning when parsing the .forceignore file if we see something like that.

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

No branches or pull requests

3 participants