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

No longer able to install Salesforce CLI on alpine linux (Docker): "env: unrecognized option: S" #3153

Open
gdman opened this issue Dec 16, 2024 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug more information required Issue requires more information or a response from the customer

Comments

@gdman
Copy link

gdman commented Dec 16, 2024

Summary

We run all of our builds in Docker containers using Alpine linux as the base operating system. Since last week our build has started failing - SF will no longer run.

The error message is:
"env: unrecognized option: S"

I've done some investigation, it looks like #!/usr/bin/env node changed to #!/usr/bin/env -S node --no-deprecation as part of this PR: https://github.com/salesforcecli/cli/pull/1971/files. This makes use of the -S option in env but this option isn't available on all operating systems. In particular, this isn't available in Busybox which is what's used in Alpine Linux.

Please could you revert this changes and look to implement another way without use of -S?

Version: 2.69.14

Update:
I have worked around this by adding coreutils (apk add coreutils) into the image. This has the newer version of env which supports the -S argument.

This could still be other cases of the same issue.

@gdman gdman added the investigating We're actively investigating this issue label Dec 16, 2024
Copy link

Hello @gdman 👋 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 Dec 16, 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.

@iowillhoit iowillhoit added the bug Issue or pull request that identifies or fixes a bug label Dec 16, 2024
Copy link

git2gus bot commented Dec 16, 2024

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

@iowillhoit
Copy link
Contributor

Thanks for reporting this @gdman, we are looking into it

@cristiand391
Copy link
Member

I've been playing around with this for a while but can't think of a way to make it work on macos/ubuntu and busybox's env...

even in latest busybox, env is pretty limited and shebang line behave different, can't inline env vars like this:

/ # /usr/bin/env TEST=1 node
Welcome to Node.js v22.12.0.
Type ".help" for more information.
> process.env.TEST
'1'

the suggested way of doing this cross-platform seems to be making a script (sh would be more "portable" and work with alpine), see: https://unix.stackexchange.com/questions/20880/how-can-i-use-environment-variables-in-my-shebang

Given Alpine linux isn't really supported by us (you can't use the official installers, require node's alpine which isn't tier 1 supported) I'm not sure if we would make such a big change like that, we'll discuss with the team what are the options and get back.

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 more information required Issue requires more information or a response from the customer
Projects
None yet
Development

No branches or pull requests

3 participants