You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in the margin in #33, we often see the "current_rocketchat_version" check fail (on Debian 9.13) when running "rocketchatctl check-updates" and "rocketchatctl update", and that seems to cause additional problems, like in this case (first without debug output, then using "bash -x"):
[… rocketchat has just been backed up and was restarted by the backup command …]
trolls:~ # 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.9.0: unary operator expected
Could not determine if updates available for RocketChat server.
[… immediate retry with debugging enabled …]
trolls:~ # bash -x rocketchatctl update
+ set -o nounset
+ main update
+ local VERSION=latest
+ local -r NODE_VERSION=v12.14.0
+ local -r NPM_VERSION=6.13.4
+ local MONGO_VERSION=
+ local -r 'MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01'
+ local -r 'MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01'
+ local ROCKETCHAT_DOWNLOAD_URL=https://releases.rocket.chat/latest/download
+ local -r NODE_DEB_DOWNLOAD_URL=https://deb.nodesource.com/setup_12.x
+ local -r NODE_RPM_DOWNLOAD_URL=https://rpm.nodesource.com/setup_12.x
+ local -r ROCKETCHAT_DIR=/opt/Rocket.Chat
+ local -r ROCKETCHAT_DIR_UPDATE=/opt/Rocket.Chat.bkup
+ local -r ROCKET_VERSION_INFO_URL=https://releases.rocket.chat/latest/info
+ local -r ROCKETCHATCTL_DOWNLOAD_URL=https://raw.githubusercontent.com/RocketChat/install.sh/master/rocketchatctl
+ local -r ROCKETCHATCTL_DIRECTORY=/usr/local/bin
+ local -r ROCKETCHATCTL_TEMP_DIRECTORY=/tmp
+ local -r TRAEFIK_DOWNLOAD_URL=https://github.com/containous/traefik/releases/download/v1.7.20/traefik
+ local -r CADDY_DOWNLOAD_URL=https://github.com/mholt/caddy/releases/download/v1.0.0/caddy_v1.0.0_linux_amd64.tar.gz
+ local distro=
+ local distro_version=
+ local install_node=0
+ local install_mongo=0
+ local rocket_healthy=0
+ local ROOT_URL=
+ local PORT=3000
+ local BIND_IP=0.0.0.0
+ local bind_loopback=true
+ local webserver=none
+ local install_node_arg=0
+ local use_mongo_arg=0
+ local webserver_arg=0
+ local rocket_mail_arg=0
+ local bind_loopback_arg=0
+ local rocket_domain=
+ local configure_rocketchat=0
+ local configure_webserver=0
+ local root_url_arg=0
++ date +%s
+ local sufix=1606910670
+ local node_path=/usr/bin/node
+ local backup_dir=/tmp
+ local update_node=0
+ '[' 0 -ne 0 ']'
+ '[' 1 -lt 1 ']'
+ [[ -t 0 ]]
+ case $1 in
+ os_supported
+ get_os_distro
+ '[' -r /etc/os-release ']'
++ . /etc/os-release
+++ PRETTY_NAME='Debian GNU/Linux 9 (stretch)'
+++ NAME='Debian GNU/Linux'
+++ VERSION_ID=9
+++ VERSION='9 (stretch)'
+++ VERSION_CODENAME=stretch
+++ ID=debian
+++ HOME_URL=https://www.debian.org/
+++ SUPPORT_URL=https://www.debian.org/support
+++ BUG_REPORT_URL=https://bugs.debian.org/
++ echo debian
+ distro=debian
++ . /etc/os-release
+++ PRETTY_NAME='Debian GNU/Linux 9 (stretch)'
+++ NAME='Debian GNU/Linux'
+++ VERSION_ID=9
+++ VERSION='9 (stretch)'
+++ VERSION_CODENAME=stretch
+++ ID=debian
+++ HOME_URL=https://www.debian.org/
+++ SUPPORT_URL=https://www.debian.org/support
+++ BUG_REPORT_URL=https://bugs.debian.org/
++ echo 9
+ distro_version=9
+ case "$distro" in
+ [[ 9 =~ ((9|10)) ]]
+ do_check_updates
+ get_rocketchat_latest_version
+ command_exists curl
+ command -v curl
++ curl https://releases.rocket.chat/latest/info
++ awk '-F"' '{print $2}'
++ awk -F: '{print $2}'
++ grep -w tag
+ latest_rocketchat_version=3.9.0
+ get_rocketchat_current_version
+ systemctl status rocketchat
++ awk -F= '{print $3}'
++ grep PORT
++ cat /lib/systemd/system/rocketchat.service
+ PORT=3000
++ curl --interface lo http://localhost:3000/api/info
++ cut '-d"' -f4
+ current_rocketchat_version=
+ print_make_backup
+ echo '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.'
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.
+ [[ '' =~ ^([0-2]\..\..)$ ]]
+ version_gt 3.9.0
++ head -n 1
++ printf '%s\n' 3.9.0
++ sort -V
+ test 3.9.0 '!=' 3.9.0
+ '[' 3.9.0 == ']'
/usr/local/bin/rocketchatctl: line 900: [: 3.9.0: unary operator expected
+ print_check_updates_error_and_exit
+ errcho 'Could not determine if updates available for RocketChat server.'
+ echo 'Could not determine if updates available for RocketChat server.'
Could not determine if updates available for RocketChat server.
+ exit 1
I'm going to demonstrate the behavior with the following script, which is largely copy-and-pasted from "rocketchatctl", plus an "until" patch I'm suggesting (ignore the "--interface lo", that's a patch for another day):
trolls:~ # cat test_version.sh
#!/bin/bash
PORT=$(cat /lib/systemd/system/rocketchat.service |grep PORT |awk -F= '{print $3}')
current_rocketchat_version=""
until [ -n "$current_rocketchat_version" ]; do
current_rocketchat_version=$(curl --interface lo http://localhost:$PORT/api/info 2>/dev/null |cut -d\" -f4)
sleep 1
done
trolls:~ #
When running this on our very much non-beefy stage system, it behaves as follows:
As mentioned in the margin in #33, we often see the "
current_rocketchat_version
" check fail (on Debian 9.13) when running "rocketchatctl check-updates
" and "rocketchatctl update
", and that seems to cause additional problems, like in this case (first without debug output, then using "bash -x
"):I'm going to demonstrate the behavior with the following script, which is largely copy-and-pasted from "
rocketchatctl
", plus an "until
" patch I'm suggesting (ignore the "--interface lo
", that's a patch for another day):When running this on our very much non-beefy stage system, it behaves as follows:
So, I suggest a patch similar to the following:
I believe (but I'm not sure) we've also in the past experienced this problem during the post-update startup wait period.
The text was updated successfully, but these errors were encountered: