-
Notifications
You must be signed in to change notification settings - Fork 144
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
Upgrading from <8.5.0 to 8.13.0 fails on MacOS #4457
Comments
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
The affected code in the agent repository: This was introduced in #1392 |
We did try to handle this in #4193 |
❯ cat ~/Downloads/script.sh
#!/bin/sh
# Fix up the symlink and exit
set -e
symlink="/Library/Elastic/Agent/elastic-agent"
if test -L "$symlink"; then
symlinkTarget="data/elastic-agent-533443/elastic-agent.app/Contents/MacOS/elastic-agent"
if test -f "data/elastic-agent-8.13.0-533443/elastic-agent.app/Contents/MacOS/elastic-agent"; then
symlinkTarget="data/elastic-agent-8.13.0-533443/elastic-agent.app/Contents/MacOS/elastic-agent"
ln -sfn "$symlinkTarget" "$symlink"
fi%
❯ shellcheck ~/Downloads/script.sh
In /Users/cmackenzie/Downloads/script.sh line 8:
if test -L "$symlink"; then
^-- SC1046 (error): Couldn't find 'fi' for this 'if'.
^-- SC1073 (error): Couldn't parse this if expression. Fix to allow more checks.
In /Users/cmackenzie/Downloads/script.sh line 13:
fi
^-- SC1047 (error): Expected 'fi' matching previously mentioned 'if'.
^-- SC1072 (error): Expected 'fi'. Fix any mentioned problems and try again.
For more information:
https://www.shellcheck.net/wiki/SC1046 -- Couldn't find 'fi' for this 'if'.
https://www.shellcheck.net/wiki/SC1047 -- Expected 'fi' matching previously...
https://www.shellcheck.net/wiki/SC1072 -- Expected 'fi'. Fix any mentioned ... |
I think this is broken for any version before 8.5 from the description in #1392, not just 7.17 |
yes exactly, any upgrade from agent <8.5.0 will have the same problem, luckily the fix is the same of all of them. A PR will be up soon |
Upgrading from 7.17.x to 8.13.0 reports a syntax error in the elastic agent script, eventually resulting in a rollback to the previous version. (Upgrading the same configuration to 8.12.2 is successful, as is upgrading 8.11.1 to 8.13.0):
8.13.0
The Agent will go from "upgrading" to "healthy" while remaining at the old version.
During the upgrade, a shell error is reported while checking the elastic-agent version:
The contents of
/Library/Elastic/Agent/elastic-agent
while it is reporting a syntax error are:The logs reported in Fleet during the failed upgrade (prerelease artifacts URL redacted) are:
upgrade logs
The text was updated successfully, but these errors were encountered: