Error while installing Peertube on my VPS

Hello!
I hope that you are doing well.
I tried to install peertube on my vps a few days ago.
I have this error :

The discussion must continue here.
Do you have any idea?
Many thanks in advance

On the github discussion, your last step was to re-install yarn.
So you have to do this again:

cd /var/www/peertube/peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile

Thank you for your answer
I did it.
I have this yet:

yarn install v1.22.15
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ test -n "$NOCLIENT" || (cd client && yarn install --pure-lockfile)
yarn install v1.22.15
[1/4] Resolving packages...
success Already up-to-date.
Done in 3.04s.
Done in 6.14s.
debian@vps-ba5d339e:/var/www/peertube/peertube-latest$ sudo systemctl status ngi                                                                             nx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en
  Drop-In: /etc/systemd/system/nginx.service.d
           └─override.conf
   Active: active (running) since Wed 2021-11-24 22:48:27 CET; 2 days ago
     Docs: man:nginx(8)
  Process: 21407 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process
  Process: 21410 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (cod
  Process: 21412 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
 Main PID: 21411 (nginx)
    Tasks: 34 (limit: 2319)
   Memory: 33.3M
   CGroup: /system.slice/nginx.service
           ├─21411 nginx: master process /usr/sbin/nginx -g daemon on; master_pr
           └─21413 nginx: worker process

Warning: Journal has been rotated since unit was started. Log output is incomple
lines 1-17/17 (END)...skipping...
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/nginx.service.d
           └─override.conf
   Active: active (running) since Wed 2021-11-24 22:48:27 CET; 2 days ago
     Docs: man:nginx(8)
  Process: 21407 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 21410 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 21412 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
 Main PID: 21411 (nginx)
    Tasks: 34 (limit: 2319)
   Memory: 33.3M
   CGroup: /system.slice/nginx.service
           ├─21411 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─21413 nginx: worker process

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Have you tried restarting the peertube service ? systemctl restart peertube.
If this does not work, check the status with systemctl status peertube. Or read the journal with journalctl -feu peertube.

When you did the installation, have you carefully follow each step? Have you checked the dependencies guide (it is the very first step in PeerTube documentation and refers to PeerTube documentation) ?

With the journalctl, I have this error:

 [video.maxime-luce.fr:443] 2021-11-27 14:25:32.571 warn: Emailer is disabled so the contact form will not work.
Nov 27 14:25:33 vps-ba5d339e peertube[14661]: [video.maxime-luce.fr:443] 2021-11-27 14:25:33.259 error: Error in Redis client. {
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:   "err": {
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "stack": "Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "message": "Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "errno": "ECONNREFUSED",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "code": "ECONNREFUSED",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "syscall": "connect",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "address": "127.0.0.1",
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:     "port": 6379
Nov 27 14:25:33 vps-ba5d339e peertube[14661]:   }
Nov 27 14:25:33 vps-ba5d339e peertube[14661]: }
Nov 27 14:25:33 vps-ba5d339e systemd[1]: peertube.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 27 14:25:33 vps-ba5d339e systemd[1]: peertube.service: Failed with result 'exit-code'.
Nov 27 14:25:33 vps-ba5d339e systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Nov 27 14:25:33 vps-ba5d339e systemd[1]: peertube.service: Scheduled restart job, restart counter is at 11.
Nov 27 14:25:33 vps-ba5d339e systemd[1]: Stopped PeerTube daemon.
Nov 27 14:25:33 vps-ba5d339e systemd[1]: Started PeerTube daemon.
Nov 27 14:25:38 vps-ba5d339e peertube[14676]: [video.maxime-luce.fr:443] 2021-11-27 14:25:38.078 warn: Emailer is disabled so the contact form will not work.
Nov 27 14:25:38 vps-ba5d339e peertube[14676]: [video.maxime-luce.fr:443] 2021-11-27 14:25:38.789 error: Error in Redis client. {
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:   "err": {
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "stack": "Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "message": "Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "errno": "ECONNREFUSED",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "code": "ECONNREFUSED",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "syscall": "connect",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "address": "127.0.0.1",
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:     "port": 6379
Nov 27 14:25:38 vps-ba5d339e peertube[14676]:   }
Nov 27 14:25:38 vps-ba5d339e peertube[14676]: }

So it comes from the nginx file
What should I do ?

Logs says that peertube cant connect to the redis server.

Check that you have installed the redis server.
Check that it is running (systemctl status redis).
Check the peertube config files (production.yaml). The file must have the correct configuration in the redis server.

Read carrefully the documentation, and check if you missed something else (postgres server ?)

I haven’t installed redis. This was not mentionned. Should I do ? Why ?
Many thanks in advance

I have an idea that might help.

Is it a new VPS with nothing else running on it? In that case, if you just like to start using Peertube, install Yunohost on your VPS and then use the Yunohost manager to install Peertube.

That way, I only had a problem to find my password before I could start posting videos.

Even if you already installed some other services on your VPS, but not with loads of data, I would suggest having a look at Yunohost. It is a very friendly system with an active community.

Check again the dependencies guide: https://docs.joinpeertube.org/dependencies
It is the step 6:

I haven’t see this on this guide:

Yet, I installed it and I start again all the services.
I have this in the journalctl:

Nov 28 11:27:50 vps-ba5d339e systemd[1]: peertube.service: Main process exited,                                                                              code=exited, status=255/EXCEPTION
Nov 28 11:27:50 vps-ba5d339e systemd[1]: peertube.service: Failed with result 'e                                                                             xit-code'.
Nov 28 11:27:50 vps-ba5d339e systemd[1]: peertube.service: Service RestartSec=10                                                                             0ms expired, scheduling restart.
Nov 28 11:27:50 vps-ba5d339e systemd[1]: peertube.service: Scheduled restart job                                                                             , restart counter is at 13401.
Nov 28 11:27:50 vps-ba5d339e systemd[1]: Stopped PeerTube daemon.
Nov 28 11:27:50 vps-ba5d339e systemd[1]: Started PeerTube daemon.
Nov 28 11:27:58 vps-ba5d339e peertube[8951]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:27:58.809 warn: Emailer is disabled so the contact form will not work.
Nov 28 11:28:00 vps-ba5d339e peertube[8951]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:00.069 error: Error in Redis client. {
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:   "err": {
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "stack": "Error: Redis connecti                                                                             on to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379\n    at TCPCon                                                                             nectWrap.afterConnect [as oncomplete] (net.js:1144:16)",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "message": "Redis connection to                                                                              localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "errno": "ECONNREFUSED",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "code": "ECONNREFUSED",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "syscall": "connect",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "address": "127.0.0.1",
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:     "port": 6379
Nov 28 11:28:00 vps-ba5d339e peertube[8951]:   }
Nov 28 11:28:00 vps-ba5d339e peertube[8951]: }
Nov 28 11:28:00 vps-ba5d339e systemd[1]: peertube.service: Main process exited,                                                                              code=exited, status=255/EXCEPTION
Nov 28 11:28:00 vps-ba5d339e systemd[1]: peertube.service: Failed with result 'e                                                                             xit-code'.
Nov 28 11:28:00 vps-ba5d339e systemd[1]: peertube.service: Service RestartSec=10                                                                             0ms expired, scheduling restart.
Nov 28 11:28:00 vps-ba5d339e systemd[1]: peertube.service: Scheduled restart job                                                                             , restart counter is at 13402.
Nov 28 11:28:00 vps-ba5d339e systemd[1]: Stopped PeerTube daemon.
Nov 28 11:28:00 vps-ba5d339e systemd[1]: Started PeerTube daemon.
Nov 28 11:28:09 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:09.983 warn: Emailer is disabled so the contact form will not work.
Nov 28 11:28:11 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:11.211 info: Database peertube_prod is ready.
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.037 info: Creating application account.
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.046 info: Creating a default OAuth Client.
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.056 info: Creating the administrator.
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.077 info: Client id: 5a8vk5gk3uw7vo41tryikxzgslow8t6r
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.078 info: Client secret: SNmUVcftabc33JjFlfJyA1Llf6rBZsFW
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.127 info: Generating a RSA key...
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.438 info: Generating a RSA key...
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.439 info: Generating a RSA key...
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.773 info: Username: root
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.774 info: User password: dajowupikodijuyo
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.783 error: Cannot use SMTP server because of lack of configuration.                                                                              PeerTube will not be able to send mails!
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.858 info: Cleaning HTML cache.
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.941 info: HTTP server listening on localhost:9000
Nov 28 11:28:12 vps-ba5d339e peertube[9180]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:12.942 info: Web server: https://video.maxime-luce.fr
Nov 28 11:28:50 vps-ba5d339e systemd[1]: Stopping PeerTube daemon...
Nov 28 11:28:50 vps-ba5d339e systemd[1]: peertube.service: Main process exited,                                                                              code=killed, status=15/TERM
Nov 28 11:28:50 vps-ba5d339e systemd[1]: peertube.service: Succeeded.
Nov 28 11:28:50 vps-ba5d339e systemd[1]: Stopped PeerTube daemon.
Nov 28 11:28:50 vps-ba5d339e systemd[1]: Started PeerTube daemon.
Nov 28 11:28:54 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:54.931 warn: Emailer is disabled so the contact form will not work.
Nov 28 11:28:56 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:56.227 info: Database peertube_prod is ready.
Nov 28 11:28:56 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:56.452 error: Cannot use SMTP server because of lack of configuration.                                                                              PeerTube will not be able to send mails!
Nov 28 11:28:56 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:56.648 info: Cleaning HTML cache.
Nov 28 11:28:56 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:56.709 info: HTTP server listening on localhost:9000
Nov 28 11:28:56 vps-ba5d339e peertube[9712]: [video.maxime-luce.fr:443] 2021-11-                                                                             28 11:28:56.710 info: Web server: https://video.maxime-luce.fr


If you try to connect to Redis manually, does it allow connections? On my instance, running telnet:

# telnet localhost 6379
Trying ::1...
Connected to localhost.
Escape character is '^]'.
quit
+OK
Connection closed by foreign host.

Does that work for you?

Thank you for your answer.
Yes, it works with telnet, I have this:


debian@vps-ba5d339e:~$ telnet localhost 6379
Trying ::1...
Connected to localhost.
Escape character is '^]'.
quit
+OK
Connection closed by foreign host.

I just notice: we both have this line,

::1 is IPv6. Your log says 127.0.0.1 is not answering, ie, IPv4. Does that also work for you? Try adding -4 to telnet:

# telnet -4 localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
quit
+OK
Connection closed by foreign host.

I have the same:

debian@vps-ba5d339e:~$ telnet -4 localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
quit
+OK
Connection closed by foreign host.

I’m out of ideas.

You could try to increase Peertube logging to debug, maybe that writes some more information to the log about what exactly is happening.

fraco@myhost:/var/www/peertube$ cat config/production.yaml | grep debug
  level: 'debug' # debug/info/warning/error

At debug, journalctl gives me a whole bunch of SQL when starting Peertube, some smtp-resated information, but, scanning the log, no Redis related lines.

Would Yunohost be an option for you, or is getting things running part of the fun?

I change something in the nginx file because there was a conflict with another domain and it works!!
https://video.maxime-luce.fr/
Thank you very much!
Now I add my instance and try to launch videos
Have a great evening!

Wohoo! Have a lot of fun, I’ll check back later to see the growing video library :slight_smile:

The first step of the guide, in bold, is: «Follow the steps of the dependencies guide.».
Check the dependencies again. It’s not because Peertube started that you won’t have any problem (for example if you have not installed ffmepg, you won’t be able to add videos).