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

Rocketchatctl update command fails #17264

Closed
adsellor opened this issue Apr 11, 2020 · 8 comments
Closed

Rocketchatctl update command fails #17264

adsellor opened this issue Apr 11, 2020 · 8 comments
Labels
feat: rocketchatctl stat: stale Stale issues will be automatically closed if no activity subj: deployment

Comments

@adsellor
Copy link

Description:

When running rocketchattcl update and check-update commands I get an error
/usr/local/bin/rocketchatctl: line 897: [: 3.1.0: unary operator expected

Steps to reproduce:

  1. Get last version of rocketchatctl
  2. Run rocketchatctl update or rocketchatctl check-update
@gabrielsors
Copy link

Same issue here... on Ubuntu 18.04.4 LTS

Current update available for RocketChat server: from 3.0.4 to 3.1.1.

~# rocketchatctl update
Updates could be risky, you can use the backup option # rocketchatctl backup, to create a backup of the rocketchat database first. Please check that you have enough space in your system to store the backup.
/usr/local/bin/rocketchatctl: line 900: [: 3.1.1: unary operator expected
Could not determine if updates available for RocketChat server.

After few minutes i try again and it's work...

@smb
Copy link

smb commented May 24, 2020

It's an issue with https://releases.rocket.chat/latest/info - if it responds with "Service Unavailable" (for me: right now) which can't be compared to the current version and the updater fails because it can't handle the server error.

@marcotrevisan
Copy link

I also get the following error:
/usr/local/bin/rocketchatctl: line 900: [: 3.3.3commit: unary operator expected

Output of 'curl https://releases.rocket.chat/latest/info':

{"tag":"3.3.3","commit":"f9553e4d8f6b8042a0fabbbaf9c931cc1b28155b","key":"build/rocket.chat-3.3.3.tgz","etag":"0d673e54bb26bd0c22e53554f7a53c8c-20","count":8052}

@jmessy919
Copy link

jmessy919 commented Aug 3, 2020

Same issue here trying to update from 3.5.0 to 3.5.1. Any advice on how we can safely update RocketChat to the latest version? Thanks.

Edit: Tried using rocketchatctl update again and it worked the 3rd time. Nothing changed on my end.

@geekgonecrazy
Copy link
Contributor

If this happens to anyone else can you execute:
echo $(curl https://releases.rocket.chat/latest/info 2>/dev/null |grep -w tag |awk -F: '{print $2}'|awk -F'"' '{print $2}')

This is what’s being executed: https://github.com/RocketChat/install.sh/blob/master/rocketchatctl#L754

Which is what is looked at on https://github.com/RocketChat/install.sh/blob/master/rocketchatctl#L900

@Deleetdk
Copy link

My attempt:

root@rocketchat:~#  sudo systemctl status rocketchat.service
● rocketchat.service - The Rocket.Chat server
   Loaded: loaded (/lib/systemd/system/rocketchat.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-08-18 18:23:34 UTC; 3s ago
 Main PID: 3051 (node)
    Tasks: 11 (limit: 2361)
   CGroup: /system.slice/rocketchat.service
           └─3051 /usr/bin/node /opt/Rocket.Chat/main.js

Aug 18 18:23:34 rocketchat systemd[1]: Started The Rocket.Chat server.
root@rocketchat:~#  sudo rocketchatctl update
Updates could be risky, you can use the backup option # rocketchatctl backup, to create a backup of the rocketchat database first. Please check that you have enough space in your system to store the backup.
/usr/local/bin/rocketchatctl: line 900: [: 3.5.2: unary operator expected
Could not determine if updates available for RocketChat server.
root@rocketchat:~# echo $(curl https://releases.rocket.chat/latest/info 2>/dev/null |grep -w tag |awk -F: '{print $2}'|awk -F'"' '{print $2}')
3.5.2
root@rocketchat:~# rocketchatctl check-updates
Updates could be risky, you can use the backup option # rocketchatctl backup, to create a backup of the rocketchat database first. Please check that you have enough space in your system to store the backup.
RocketChat server already in latest version.
root@rocketchat:~# rocketchatctl update
Updates could be risky, you can use the backup option # rocketchatctl backup, to create a backup of the rocketchat database first. Please check that you have enough space in your system to store the backup.
RocketChat server already in latest version.

After running these and waiting a few minutes, the server became responsive again. I initially got into this mess by running the update:

root@rocketchat:~# rocketchatctl update
Current update available for RocketChat server: from 2.4.9 to 3.5.2commit
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   132  100   132    0     0   1137      0 --:--:-- --:--:-- --:--:--  1137
100  158M  100  158M    0     0  75.7M      0  0:00:02  0:00:02 --:--:-- 84.8M
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> fibers@4.0.3 install /tmp/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

make: Entering directory '/tmp/bundle/programs/server/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
  CXX(target) Release/obj.target/fibers/src/coroutine.o
  CC(target) Release/obj.target/fibers/src/libcoro/coro.o
  SOLINK_MODULE(target) Release/obj.target/fibers.node
  COPY Release/fibers.node
make: Leaving directory '/tmp/bundle/programs/server/node_modules/fibers/build'
Installed in `/tmp/bundle/programs/server/node_modules/fibers/bin/linux-x64-57-glibc/fibers.node`
npm WARN lifecycle meteor-dev-bundle@~install: cannot run in wd meteor-dev-bundle@ node npm-rebuild.js (wd=/tmp/bundle/programs/server)
added 146 packages from 122 contributors and audited 147 packages in 8.15s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Waiting up to 60 seconds for RocketChat server to be active ... 2
RocketChat server not running. Cancelling
root@rocketchat:~# reboot
Connection to IP closed by remote host.
Connection to IP closed.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stat: stale Stale issues will be automatically closed if no activity label Oct 18, 2020
@frdmn
Copy link
Contributor

frdmn commented Dec 13, 2020

Closing in favor of RocketChat/install.sh#34

@frdmn frdmn closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: rocketchatctl stat: stale Stale issues will be automatically closed if no activity subj: deployment
Projects
None yet
Development

No branches or pull requests

10 participants