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: No such file or directory #1104

Closed
ImJohnMDaniel opened this issue Aug 4, 2021 · 23 comments
Closed

sfdx: No such file or directory #1104

ImJohnMDaniel opened this issue Aug 4, 2021 · 23 comments
Labels
investigating We're actively investigating this issue

Comments

@ImJohnMDaniel
Copy link

Summary

I received the following error message on Monday August 2nd, 2021.

sfdx: No such file or directory
“/Users/johndoe/.local/share/sfdx/client/bin/sfdx: line 16: /Users/johndoe/.local/share/sfdx/client/bin/../7.110.0-85b006b/bin/sfdx: No such file or directory

In the end, I found that the entire "/Users/johndoe/.local/share/sfdx/client/bin/../7.110.0-85b006b" folder had been completely wiped out. The "current" folder symbolic link seemed to still point to the 7.110.0 directory, but the folder itself was gone. I have no idea how this happened. One minute it was working. The next minute it was not. I had to run the full uninstall sequence and then reinstall the CLI.

Steps To Reproduce:

Unable to reproduce at this time.

System Information

{
        "cliVersion": "sfdx-cli/7.110.0",
        "architecture": "darwin-x64",
        "nodeVersion": "node-v14.17.3",
        "pluginVersions": [
                "@dx-cli-toolbox/sfdx-toolbox-package-utils 0.7.1 (link) /Users/john/workspace/_cli-related/sfdx-toolbox-package-utils",
                "@dx-cli-toolbox/sfdx-toolbox-utils 0.0.2 (link) /Users/john/workspace/_cli-related/sfdx-toolbox-utils",
                "@oclif/plugin-autocomplete 0.3.0",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.2.2 (core)",
                "@oclif/plugin-not-found 1.2.4 (core)",
                "@oclif/plugin-plugins 1.10.0 (core)",
                "@oclif/plugin-update 1.4.0-3 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.0 (core)",
                "@oclif/plugin-which 1.0.3 (core)",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "@salesforce/sfdx-trust 3.6.0 (core)",
                "alias 1.1.10 (core)",
                "apex 0.2.2 (core)",
                "auth 1.7.1 (core)",
                "config 1.2.13 (core)",
                "custom-metadata 1.0.12 (core)",
                "data 0.5.2 (core)",
                "generator 1.1.7 (core)",
                "limits 1.2.1 (core)",
                "org 1.6.7 (core)",
                "salesforce-alm 52.1.0 (core)",
                "schema 1.0.8 (core)",
                "sfdmu 4.4.3",
                "sfdx-cli 7.110.0 (core)",
                "shane-sfdx-plugins 4.43.0",
                "├─ @mshanemc/plugin-streaming 1.1.7",
                "└─ @mshanemc/sfdx-sosl 1.1.0",
                "soqlx-opener 0.1.12",
                "telemetry 1.2.2 (core)",
                "templates 52.1.0 (core)",
                "user 1.3.1 (core)"
        ],
        "osVersion": "Darwin 20.6.0"
}

Additional information

There is a minor discussion on the Trailblazer Community about this issue as it was seen by a second individual at the same time. The link to that thread is https://trailblazers.salesforce.com/0D54S00000Br4bl

FYI @mshanemc, @amphro, and @clairebianchi

@ImJohnMDaniel ImJohnMDaniel added the investigating We're actively investigating this issue label Aug 4, 2021
@github-actions
Copy link

github-actions bot commented Aug 4, 2021

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.

@yippie
Copy link

yippie commented Aug 4, 2021

A co-worker and I both had this exact same thing happen to us overnight last night as well.

@JimBTek
Copy link

JimBTek commented Aug 4, 2021

Same on Mac OS Big Sur 11.4

/.local/share/sfdx/client/bin/../7.110.0-85b006b/bin/sfdx: No such file or directory

Edit: This is with the executable .pkg installer that auto updates, not the node version

Edit 2: I am still on Bash vs. zsh for what it's worth. but we had users on zsh report it a week ago and it self resolved.

@mshanemc
Copy link
Contributor

mshanemc commented Aug 4, 2021

Anyone see this not on MacOS?

@yippie
Copy link

yippie commented Aug 4, 2021

This report in the vs-code extension repo appears to be on windows forcedotcom/salesforcedx-vscode#3471

@jwalke
Copy link

jwalke commented Aug 4, 2021

We're experiencing this issue as well

mshanemc added a commit to oclif/plugin-update that referenced this issue Aug 4, 2021
there's something wrong with line 288.  This gives us more time to figure that out
cf: forcedotcom/cli#1104
@mshanemc
Copy link
Contributor

mshanemc commented Aug 4, 2021

This is happening in oclif's autoupdate functionality (and only applies to binary installs, not those who installed via npm -g sfdx-cli)

We're doing tomorrow's scheduled RC promotion in the next 10 minutes or so to prevent this from happening to anyone else, while fixing oclif for tomorrow's RC so it doesn't happen in the future.

For those that it already happened to, you'll want to delete Users/you/.local/share/sfdx (or whatever the windows equivalent is) and reinstall. All your configs and auths are stored in your projects and homedir so you won't lose those.

@mshanemc mshanemc pinned this issue Aug 4, 2021
mshanemc added a commit to oclif/plugin-update that referenced this issue Aug 4, 2021
there's something wrong with line 288.  This gives us more time to figure that out
cf: forcedotcom/cli#1104
@aheber
Copy link

aheber commented Aug 4, 2021

I had this on Windows on Monday evening. I had to rip out DX and reinstall from the binary. Hasn't come back yet.

@zerkz
Copy link

zerkz commented Aug 4, 2021

Also had this happen -- our CI server was affected, runing on linux/CentOS 7, non-npm version.

@ImJohnMDaniel
Copy link
Author

@mshanemc, so this issue was the result because we all updated the CLI two weeks ago and OCLIF automatically removed as part of a "clean-up process" after two weeks. Is that correct?

@mshanemc
Copy link
Contributor

mshanemc commented Aug 5, 2021

@ImJohnMDaniel yes. That code in oclif looks for files without a "touch" for 2 weeks and deletes them (!)

@ImJohnMDaniel
Copy link
Author

Understood. Makes sense.

So would this have been a recent OCLIF change? What SFDX CLI versions would have been affected?

@mshanemc
Copy link
Contributor

mshanemc commented Aug 5, 2021

No code in the oclif plugin had changed in a long time. The bug surfaced because we hadn't promoted a RC for a few weeks, something we hadn't done before.

When the autoupdate ran, it looked at your current CLI version not being changed for over 2 weeks and deleted it (?!)

@ImJohnMDaniel
Copy link
Author

Gotcha. Thanks for the info and quick fix! I appreciate it.

@AndrewRayCode
Copy link

I'm hitting this as well:

sfdx force:auth:web:login --setdefaultdevhubusername --instanceurl https://test.salesforce.com --setalias Whatever
/Users/whatever/.local/share/sfdx/client/bin/sfdx: line 16: /Users/whatever/.local/share/sfdx/client/bin/../7.110.0-85b006b/bin/sfdx: No such file or directory

See also #718 - How does the CLI team consider the tradeoffs of the convenience of an auto-updating tool, vs one that introduces non-deterministic breaking changes in local developer environments and ci systems? sfdx has introduced many hard stop breaking changes that are rolled out to users automatically.

Could you also please post a public advisory on this issue on public Salesforce developer channels? From this @mshanemc are you saying that the fix is to completely nuke and reinstall sfdx locally? Given there are multiple tickets open for this long, could you make the fix more official and public?

@JimBTek
Copy link

JimBTek commented Aug 9, 2021

See also #718 - How does the CLI team consider the tradeoffs of the convenience of an auto-updating tool, vs one that introduces non-deterministic breaking changes in local developer environments and ci systems? sfdx has introduced many hard stop breaking changes that are rolled out to users automatically.

you should not be using the .pkg installer for Continuous Integration. Use the Node version and you can force a specific version, etc.

And yeah it is easily fixable if you just delete that folder and either reinstall it with the .pkg which will keep you on the auto-update track, OR use the Node version and it never updates automatically, you have to sfdx update

I'm sure Shane and the team are dealing with plenty of issues over this, but the fix only takes like 5 minutes to resolve for now.

@ghoshdipan-ck
Copy link

Hey, I'm facing this issue.
13:36:19.122 sfdx force:config:set defaultusername=bpQA /Users/ghoshdipan/.local/share/sfdx/client/bin/sfdx: line 16: /Users/ghoshdipan/.local/share/sfdx/client/bin/../7.209.6-8ba3197/bin/sfdx: No such file or directory 13:36:19.156 sfdx force:config:set defaultusername=bpQA ended with exit code 1
Does anyone know how to solve this one? Kind of urgent for me as switching ORG's also isn't possible now.

@Tamashreeck
Copy link

I am also facing the same issue. Because of this org changing is also impossible and npm commands are also not executing.

Screenshot 2023-09-04 at 2 10 16 PM

@mshanemc
Copy link
Contributor

mshanemc commented Sep 4, 2023

@ghoshdipan-ck @Tamashreeck can you open a new issue? I don't think it's going to be the same problem as this one, even though it's the same error message.

@bastarte
Copy link

bastarte commented Sep 5, 2023

@ghoshdipan-ck @Tamashreeck can you open a new issue? I don't think it's going to be the same problem as this one, even though it's the same error message.

I think it's worth linking to this more recent issue. I can't say if it's actually the same, but both #1104 and #2447 happen when there is no update on the CLI for some weeks.

To sum-up the solution provided in #2447, it's basically to reinstall and turn off auto-update or to switch to v2 (recommended).

(edit: wrong issue number #2132 => #2447)

@mshanemc
Copy link
Contributor

mshanemc commented Sep 5, 2023

@bastarte for the most recent reincarnation of it, I've added a pinned issue here #2447 (you don't have to create an issue)

@ptlSathyanarayanan
Copy link

Hey I'm Facing this issue
Error: D:\sf\client\node_modules@oclif\plugin-plugins\node_modules\npm\bin\npm-cli.js install
» @salesforce/lwc-dev-server@latest --omit dev --no-audit --loglevel=notice --no-fund exited with code 1
» Try this: Run with DEBUG=@oclif/plugin-plugins* to see debug output.

@mshanemc
Copy link
Contributor

mshanemc commented Apr 9, 2024

@ptlSathyanarayanan that's unrelated. Open an issue with all the useful information instead of tagging onto this one

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