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

Upgrade option doesn't pull existing version information correctly #28

Closed
corrigac opened this issue Jun 9, 2020 · 7 comments
Closed

Comments

@corrigac
Copy link

corrigac commented Jun 9, 2020

sudo rocketchatctl update --version 3.3.0 breaks on a test failure due to incorrect PORT data extraction

running with -x shows the issue:

  • latest_rocketchat_version=3.3.0commit
  • get_rocketchat_current_version
  • systemctl status rocketchat
    ++ cat /lib/systemd/system/rocketchat.service
    ++ grep PORT
    ++ awk -F= '{print $3}'
  • PORT='mongodb://localhost:27017/rocketchat?replicaSet'
    ++ curl 'http://localhost:mongodb://localhost:27017/rocketchat?replicaSet/api/info'
    ++ cut '-d"' -f4
  • current_rocketchat_version=

Line 757 - get_rocketchat_current_version() can mistakenly extract environment settings for Mongodb,
possible re-write may be:
get_rocketchat_current_version(){

if PORT=`systemctl status rocketchat | grep Process.Port | awk '{ print $10 }'`; then
    current_rocketchat_version=$(curl http://localhost:$PORT/api/info 2>/dev/null |cut -d\" -f4)
else
    print_rocketchat_not_running_error_and_exit
fi

}

@corrigac corrigac changed the title Upgrade option doesn't pull existing version information corretclu Upgrade option doesn't pull existing version information correctly Jun 9, 2020
@geekgonecrazy
Copy link
Collaborator

Just out of curiosity did you modify the service file manually?

@corrigac
Copy link
Author

Yes, as per proposed change

@geekgonecrazy
Copy link
Collaborator

I mean did you modify it since initial install? Before the issue. Or was it untouched since initial install by rocketchatctl.

Just want to understand if this is an issue that happens with rocketchatctl installer or only if someone modified the file between install and update

@corrigac
Copy link
Author

Ah, No I'd only touched rocketchatctl after I found that it wasn't working for me.

@frdmn
Copy link
Contributor

frdmn commented Dec 13, 2020

@corrigac just to rule out a modified systemd unit file... can you copy and paste it here so we can rule out any special characters that might interfer here? What's your exact content of /lib/systemd/system/rocketchat.service?

@corrigac
Copy link
Author

corrigac commented Dec 14, 2020 via email

@frdmn
Copy link
Contributor

frdmn commented Dec 14, 2020

This is not a default unit file generated by rocketchatctl as far as I can tell - which is probably also why the parsing of the specified PORT failed previously.

The unit file currently should look like this: https://github.com/RocketChat/install.sh/blob/master/rocketchatctl#L480-L496

@frdmn frdmn closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants