I tried to use the /update.sh script to update and it failed. The manual update showed that my node.js was out of date so I upgrade to v20.16.0.
Everything in the update process looked like it went well, but my service will not start.
Aug 21 09:36:46 mainserver systemd[1]: Started PeerTube daemon.
Aug 21 09:36:46 mainserver systemd[174008]: peertube.service: Changing to the requested working directory failed: No such file or directory
Aug 21 09:36:46 mainserver systemd[174008]: peertube.service: Failed at step CHDIR spawning /usr/bin/node: No such file or directory
Aug 21 09:36:46 mainserver systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Aug 21 09:36:46 mainserver systemd[1]: peertube.service: Failed with result ‹ exit-code ›.
Aug 21 09:36:47 mainserver systemd[1]: peertube.service: Scheduled restart job, restart counter is at 4.
Aug 21 09:36:47 mainserver systemd[1]: Stopped PeerTube daemon.
/usr/bin shows node as: -rwxr-xr-x 1 root root 82609040 Aug 8 2023 node
I dont know how to get my instance back up and running
I found that /versions/peertube-latest symlink was renamed to cdpeertube-latest. I have seemingly corrected that issue, but now it fails to start on:
Aug 21 15:34:01 mainserver systemd[1]: Started PeerTube daemon.
Aug 21 15:34:04 mainserver peertube[257086]: file:///var/www/peertube/versions/peertube-v6.2.1/node_modules/execa/lib/utils/max-listeners.js:1
Aug 21 15:34:04 mainserver peertube[257086]: import {addAbortListener} from ‹ node:events ›;
Aug 21 15:34:04 mainserver peertube[257086]: ^^^^^^^^^^^^^^^^
Aug 21 15:34:04 mainserver peertube[257086]: SyntaxError: The requested module ‹ node:events › does not provide an export named ‹ addAbortListener ›
Aug 21 15:34:04 mainserver peertube[257086]: at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
Aug 21 15:34:04 mainserver peertube[257086]: at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
Aug 21 15:34:04 mainserver peertube[257086]: at async Promise.all (index 0)
Aug 21 15:34:04 mainserver peertube[257086]: at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
Aug 21 15:34:04 mainserver peertube[257086]: at async loadESM (node:internal/process/esm_loader:91:5)
Aug 21 15:34:04 mainserver peertube[257086]: at async handleMainPromise (node:internal/modules/run_main:65:12)
Aug 21 15:34:04 mainserver systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Aug 21 15:34:04 mainserver systemd[1]: peertube.service: Failed with result ‹ exit-code ›.
I did have to upgrade node.js prior to upgrade. I have ran the lock file command many time.
Hi, I would do so, take the manual [Production Manual | PeerTube Documentation] (Production guide | PeerTube documentation) and would install step-by-step all the dependencies, and PeerTube itself. Thus, what is already installed will not be installed, and what is not correct will be corrected. After that, I would re-upload all the files(backups), PeerTube to the config folder, or edit new ones by adding a domain and so on. In general, it is better to make backups via FTP from time to time. But this is only my suggestion, since from what you write it is difficult to understand what is really so)
Al
https://you.com/search?q=Everything+in+the+update+process+looked+like+it+went+well%2C+but+my+service+will+not+start.
Aug+21...&cid=c1_f336be09-138c-45ba-bb71-09e08d111b67&tbm=youchat
Good advice. I wiped out the install directory and started from scratch. The service will still no longer start, this is the error:
Started PeerTube daemon.
Aug 21 16:52:53 mainserver peertube[279703]: file:///var/www/peertube/versions/peertube-v6.2.1/node_modules/execa/lib/utils/max-listeners.js:1
Aug 21 16:52:53 mainserver peertube[279703]: import {addAbortListener} from ‹ node:events ›;
Aug 21 16:52:53 mainserver peertube[279703]: ^^^^^^^^^^^^^^^^
Aug 21 16:52:53 mainserver peertube[279703]: SyntaxError: The requested module ‹ node:events › does not provide an export named ‹ addAbortListener ›
Aug 21 16:52:53 mainserver peertube[279703]: at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
Aug 21 16:52:53 mainserver peertube[279703]: at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
Aug 21 16:52:53 mainserver peertube[279703]: at async Promise.all (index 0)
Aug 21 16:52:53 mainserver peertube[279703]: at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
Aug 21 16:52:53 mainserver peertube[279703]: at async loadESM (node:internal/process/esm_loader:91:5)
Aug 21 16:52:53 mainserver peertube[279703]: at async handleMainPromise (node:internal/modules/run_main:65:12)
Aug 21 16:52:53 mainserver systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Aug 21 16:52:53 mainserver systemd[1]: peertube.service: Failed with result ‹ exit-code ›.
I have verified the dependencies are installed via the install tutorial. I can change the peertube-latest symlink back to 6.0.3 and the service starts.
The missing function was added in Node 18:
https://nodejs.org/api/events.html#eventsaddabortlistenersignal-listener
So it seems you are still using Node <=16 (at least for the Peertube user).
How did you install node 20?
Try to follow the Peertube dependencies guide to install node (v18 to be sure it will work, as it is the official recommandation for Peertube 6.0)
server@mainserver:~$ node -v
v20.16.0
I had to upgrade on my first attempt.
Is the peertube user using the same version?
sudo -u peertube node -v
(with some setup, the node version can differ between users)