forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
493 stars 78 forks source link

Breaking changes in salesforcedx Docker image #1123

Closed AndrewRayCode closed 3 years ago

AndrewRayCode commented 3 years ago

Working version:

docker run -it salesforce/salesforcedx:7.98.0-slim bash
type -a sfdx
sfdx is /usr/local/lib/nodejs/bin/sfdx

Bad publish:

docker run -it salesforce/salesforcedx:7.112.0-slim bash
root@be551c929869:/# type -a sfdx
sfdx is /root/sfdx/bin/sfdx

Same for salesforce/salesforcedx:7.113.0-slim

github-actions[bot] commented 3 years ago

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.

WillieRuemmele commented 3 years ago

Hi @AndrewRayCode the slim build doesn't include node. use the full build if you need node

AndrewRayCode commented 3 years ago

This isn't related to node. You changed where sfdx is installed, from /usr/local to /root. A breaking change with no warning/messaging/release notes

AndrewRayCode commented 3 years ago

Example of broken behavior

docker run -it salesforce/salesforcedx:7.113.0-slim bash

root@c5bd3a234a29:/# sfdx
Salesforce CLI...

root@c5bd3a234a29:/# timeout 120m sfdx force:source:deploy
timeout: failed to run command 'sfdx': No such file or directory

This command works fine on older versions. Seems like a bad PATH setup maybe

cristiand391 commented 3 years ago

Hi @AndrewRayCode, yes, it looks like a bad PATH setup, updating the path should work:

export PATH="/root/sfdx/bin:$PATH"
timeout 120m sfdx force

I guess this is because the previous installation dir was referenced as a full path in PATH while the new one isn't:

echo $PATH
~/sfdx/bin:...
AndrewRayCode commented 3 years ago

@cristiand391 Sure, if you run your container as root. That fix doesn't work for the rest of us

AndrewRayCode commented 3 years ago

For non-root user, here's the hack workaround I found:

FROM salesforce/salesforcedx:7.113.0-slim
WORKDIR /my/appfolder
RUN mv /root/sfdx .
RUN chown -R app:app ./sfdx

This works because ~/sfdx/bin is on the path, which clearly won't work if sfdx is installed in /root. ~ expands to the current workdir (apparently) for non-root user. This hack to workaround your breaking change bug is bad because the mv command takes a long time due to lots of nested files.

My sfdx auto updated. So many breaking changes. Also new feature where sfdx deletes itself after 2 weeks. Rolling back doesn't work, you have to find the hidden rollback instructions of completely uninstalling and manually installing from hidden download link, by the time I see that I'm 2 days into debugging issues already. Can't deploy to sandbox, can't deploy on CI. After losing some days to triaging sandbox deploy package bugs, since no one on salesforce platform team helping with this 8 day incident, find out that sfdx no longer reports deploy errors to sandboxes in vscode, so dev process is broken too. Then find out there's bad docker image publish. CI doubly broken, both test runs and deploys. Again you haven't rolled back these bad releases, haven't released hotfixes, haven't added official messaging, no release notes. Lose another half day to fixing our CI system, need different hack for CI (runs as user) vs tests (runs as root).

The issues just keep coming, and we're 8 days in. It doesn't look like you're treating this like an incident, there's not going to be a post mortem, just lots of frustrated developers. @cristiand391 @WillieRuemmele i'm sharing this because i'm out of energy now. can you please just let me know when you've published a corrected hotfix docker image so we can use it and I can remove my hack.

mahbouf commented 3 years ago

I am also encountering the same issue. We were using salesforce/salesforcedx which was looking for latest and starting Thursday Aug 12 deployments have been failing with an error that Latest can not be found . Changed the tag version to different recent ones such as latest-full and 7.113.0-full etc and got different error messages including "org not found " .

Workaround which worked for me : Used salesforce/salesforcedx:7.81.0-full and deployments are working now .

But still waiting for a reply from Salesforce support to provide a permanent solution.

uip-robot-zz commented 3 years ago

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

cristiand391 commented 3 years ago

@AndrewRayCode Thank you for reporting and sorry for the inconvenience. A new batch of docker images with the fix has been published. Current tags with the fix:

➜  ~ docker run -it salesforce/salesforcedx:7.115.0-slim bash
root@2d33f4df5ed5:/# type -a sfdx
sfdx is /usr/local/sfdx/bin/sfdx
root@2d33f4df5ed5:/# timeout 120m sfdx version
sfdx-cli/7.115.0 linux-x64 node-v14.17.5

Please note that latest-slim still has this bug (it's just previous latest-rc with a new tag), once we release a new version of sfdx the current rc image with the fix will be promoted to latest-slim.