Error updating from rocket.chat_latest.tgz from from 7.2.1 to 7.7.0 python 3 version
Description:
While trying to update Rocket Chat from 7.2.1 to 7.7.0 , it's giving an error.
The problem seems to be related to Python 3 version
I had to update Python3 v=3.7.3 and had to update to 3.8.2 using: curl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz tar -xf Python-3.8.2.tar.xz make -j 2 (VM have 2 cores) sudo make altinstall and run: sudo update-alternatives --config python3 Only after that, I managed to complete the update!
Suggestion to fix: add python minimal version to https://docs.rocket.chat/docs/deploy-on-debian and Engine versions in https://github.com/RocketChat/Rocket.Chat/releases
Steps to reproduce:
- having python3 --version = Python 3.7.3
- sudo systemctl stop rocketchat.service
- sudo mv /opt/Rocket.Chat{,old_7.2.1}
- curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat_latest.tgz
- sudo n 22.14.0
- tar xzf /tmp/rocket.chat_latest.tgz -C /tmp
- cd /tmp/bundle/programs/server
- npm install --production or npm install or npm i
Expected behavior:
install without errors
Actual behavior:
fail to install
Server Setup Information:
- Version of Rocket.Chat Server: 7.2.1 -> 7.7.0
- License Type: Starter
- Number of Users: 12
- Operating System: Debian GNU/Linux 10 (4.19.0-23-amd64)
- Deployment Method: tar
- Number of Running Instances: 1
- DB Replicaset Oplog: oplog Enabled
- NodeJS Version: v22.14.0
- MongoDB Version: MongoDB 6.0.16-13
Client Setup Information
- Desktop App or Browser Version:
- Operating System:
Additional context
install node npm-rebuild.js
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
npm error code 1
npm error path /tmp/bundle/programs/server/npm/node_modules/gc-stats
npm error command failed
npm error command sh -c node-gyp-build
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/tmp/bundle/programs/server/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/tmp/bundle/programs/server/npm/node_modules/gc-stats/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/tmp/bundle/programs/server/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/user/.cache/node-gyp/22.14.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/home/user/.cache/node-gyp/22.14.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/tmp/bundle/programs/server/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/home/user/.cache/node-gyp/22.14.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/tmp/bundle/programs/server/npm/node_modules/gc-stats',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error File "/tmp/bundle/programs/server/node_modules/node-gyp/gyp/gyp_main.py", line 42, in
Relevant logs:
npm error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3" (...) npm error if CC := os.environ.get("CC_target") or os.environ.get("CC"): npm error ^ npm error SyntaxError: invalid syntax
This line uses the walrus operator (:=), which was introduced in Python 3.8.
hello, I had the same error, but then I realized that I hadn't installed node js 22 version.
solution: sudo apt purge nodejs sudo rm /etc/apt/sources.list.d/nodesource.list curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt update sudo apt install nodejs sudo n 22.14.0
It worked.
Hello @MarlynxLinux, as you can see in the logs, I already updated Node.js; It was running in [email protected] (I saw on the release page that it was a requirement).
The only way it worked was after updating Python 3 to 3.8.2 and doing sudo update-alternatives --config python3 (tried before running this step, and this line npm error gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3" still appeared)!
That's why I asked to add Python version as a requirement.
Solution
- cd
- curl -O https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
- tar -xf Python-3.8.2.tar.xz
- cd Python-3.8.2
- ./configure --enable-optimizations
- nproc (to get the number of of processing units available for the next step)
- make -j 2
- sudo make altinstall
- python3.8 --version
- sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
- sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 2
- sudo update-alternatives --config python3
- (Select version 3.8)
- cd </tmp/bundle/programs/server> && npm install --production
@peterupriuse The Debian 10 buster support life ended on June 30, 2024
It's time to upgrade