Can't create symbolic link

So the instructions say to create a symbolic link between the peertube-latest directory. But this gives an error that the file already exists. (it’s a regular file and not a directory). So then I delete it and remake it a directory (mkdir). Then I get this issue even as root:

sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest

ln: failed to create symbolic link './peertube-latest/peertube-': Permission denied

I tried chmod 750 that directory

(following commands must be run as root user)

Your VERSION var is empty. You forgot this line from the documentation (or did it in another term):

VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest Peertube version is $VERSION"

The current version is 5.1.0, and I assume it is the version you are trying to install. So you can replace this line by:

VERSION=v5.1.0

To fix your setup, once you set the VERSION variable, you have to delete the peertube-latest file or directory, and try again to create the link:

cd /var/www/peertube # assuming this is your peertube dir
rm peertube-latest
chown peertube:peertube . # just in case, set the owner to peertube:peertube
sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest

I replace that version # in the VERSION defining command or go into a config file?

Open a term as root user, and copy/paste these lines one by one (if your peertube dir in not /var/www/peertube, just change the dir on the first line):

cd /var/www/peertube # assuming this is your peertube dir
VERSION=v5.1.0
rm peertube-latest
chown peertube:peertube .
sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest

If you need more explication, ask. I don’t know what’s your bash level.

Hi John, this worked. the symbolic link was made. I appreciate your help so much. I’m sorry I’m pretty new and now stuck in a different spot…

I was following a video guide and when I did the Certbot, the video guide didn’t include the --post-hook restart:

sudo certbot certonly --standalone --post-hook « systemctl restart nginx »

And so I got the Certs, but can’t restart it…

sudo systemctl reload nginx
nginx.service is not active, cannot reload.

sudo systemctl restart nginx

Job for nginx.service failed because the control process exited with error code.
See "systemctl status

nginx.service" and « journalctl -xe » for details.

:/var/www/peertube$ systemctl status nginx.service

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
     Active: failed (Result: exit-code) since [time]; 1min>
       Docs: man:nginx(8)
    Process: 57217 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>
        CPU: 21ms
lines 1-6/6 (END)

You probably have a syntax error in your nginx config file.
Try to restart nginx, then use journalctl to look for an error message:

systemctl restart nginx && journalctl -feu nginx

Use ctrl+c to stop journalctl once you got the error message.

Yeah apparently some issue with the SSL certification:


Apr 13 00:59:50 9ig6pa30-1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 13 00:59:50 9ig6pa30-1 systemd[1]: Started A high performance web server and a reverse proxy server.
Apr 15 01:27:15 9ig6pa30-1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 15 01:27:15 9ig6pa30-1 systemd[1]: nginx.service: Succeeded.
Apr 15 01:27:15 9ig6pa30-1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Apr 15 01:31:17 9ig6pa30-1 systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.
Apr 15 01:31:59 9ig6pa30-1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 15 01:31:59 9ig6pa30-1 nginx[57217]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/[domainexample.net]/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/[domainexample.net]/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Apr 15 01:31:59 9ig6pa30-1 nginx[57217]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 15 01:31:59 9ig6pa30-1 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 15 01:31:59 9ig6pa30-1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 15 01:31:59 9ig6pa30-1 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 15 23:04:22 9ig6pa30-1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 15 23:04:22 9ig6pa30-1 nginx[70924]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/[domainexample.net]/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/[domainexample.net]/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Apr 15 23:04:22 9ig6pa30-1 nginx[70924]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 15 23:04:22 9ig6pa30-1 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 15 23:04:22 9ig6pa30-1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 15 23:04:22 9ig6pa30-1 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 17 02:07:00 9ig6pa30-1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 17 02:07:00 9ig6pa30-1 nginx[84853]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/[domainexample.net]/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/[domainexample.net]/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Apr 17 02:07:00 9ig6pa30-1 nginx[84853]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 17 02:07:00 9ig6pa30-1 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 17 02:07:00 9ig6pa30-1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 17 02:07:00 9ig6pa30-1 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

But in the folder, there clearly is the file:


root@server:/etc/letsencrypt/live/exampledomain.net# ls
cert.pem  chain.pem  fullchain.pem  privkey.pem  README

In the following documentation:

It says « Replace [peertube-domain] with the domain for the peertube server.». [ and ] must also be replaced.
So, edit your /etc/nginx/sites-enabled/peertube file, and remove the [ and ] around your domain name.

Ok this worked. That was a stupid mistake on my part, thank you. I got the Nginx server running! However, we are now stuck at the final part of running the actual software:

$ sudo systemctl enable --now peertube

Created symlink /etc/systemd/system/multi-user.target.wants/peertube.service → /etc/systemd/system/peertube.service.

But all we get is error logs:

Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Start request repeated too quickly.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: Failed to start PeerTube daemon.

There is not enough log here to see what’s wrong. The interesting part is truncated.

However, the first line tells me it is probably an issue in the peertube config file. Check your /var/www/peertube/config/production.yml file, and check again the documentation to find what you did wrong, or what your forgot.

The only parts I changed from the production.yml file are the hostname and the admin email to send to me. Here’s the full journal log:

-- Journal begins at Wed 2023-04-12 05:07:23 UTC. --
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 18 03:02:32 9ig6pa30-1 peertube[97170]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Start request repeated too quickly.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 18 03:02:32 9ig6pa30-1 systemd[1]: Failed to start PeerTube daemon.
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]: /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     ^
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  53 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  54 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  55 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]: -----------------------------------------^
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  57 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  58 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Config.util.parseFile (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853:11)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:649:26
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Array.forEach (<anonymous>)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Config.util.loadFileConfigs (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:648:16)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at new Config (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:113:27)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 1.
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 04:41:16 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]: /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     ^
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  53 |  ...
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  54 |  ...
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  55 |  ...
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]: -----------------------------------------^
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  57 |  ...
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:  58 |  ...
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Config.util.parseFile (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853:11)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:649:26
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Array.forEach (<anonymous>)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Config.util.loadFileConfigs (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:648:16)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at new Config (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:113:27)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 19 04:41:17 9ig6pa30-1 peertube[108789]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 19 04:41:17 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 04:41:17 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:17 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 2.
Apr 19 04:41:17 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 04:41:17 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]: /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     ^
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  53 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  54 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  55 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]: -----------------------------------------^
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  57 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:  58 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Config.util.parseFile (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853:11)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:649:26
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Array.forEach (<anonymous>)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Config.util.loadFileConfigs (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:648:16)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at new Config (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:113:27)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 19 04:41:18 9ig6pa30-1 peertube[108797]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 3.
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]: /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     ^
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  53 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  54 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  55 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]: -----------------------------------------^
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  57 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:  58 |  ...
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Config.util.parseFile (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853:11)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:649:26
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Array.forEach (<anonymous>)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Config.util.loadFileConfigs (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:648:16)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at new Config (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:113:27)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 19 04:41:18 9ig6pa30-1 peertube[108806]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 04:41:18 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 4.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]: /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     ^
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  53 |  ...
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  54 |  ...
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  55 |  ...
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]: -----------------------------------------^
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  57 |  ...
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:  58 |  ...
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Config.util.parseFile (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:853:11)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at /var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:649:26
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Array.forEach (<anonymous>)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Config.util.loadFileConfigs (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:648:16)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at new Config (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:113:27)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Object.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/config/lib/config.js:1510:31)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Module._compile (internal/modules/cjs/loader.js:1114:14)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Module.load (internal/modules/cjs/loader.js:979:32)
Apr 19 04:41:19 9ig6pa30-1 peertube[108813]:     at Function.Module._load (internal/modules/cjs/loader.js:819:12)
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Start request repeated too quickly.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 04:41:19 9ig6pa30-1 systemd[1]: Failed to start PeerTube daemon.

It seems you just leaked something that looks like your database password (in the logs you pasted).
You should change it.

The error says YAMLException: bad indentation of a mapping entry, and then points out the issue.
Your YAML file is invalid, because your password contains a single quote (') that is not escaped.

Easiest way to fix: change your database password for something that does not contain single quote.

1 « J'aime »

This is a great point. So I fixed the password issue in the YAML config file. Then updated the actual peertube user passwd with the system. And even added a « secrets » using OpenSSL from the peertube user. But alas now I have some type of password authentication error. Is this due to the postgres database not being updated with the new password?

Apr 19 23:52:24 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 23:52:24 9ig6pa30-1 systemd[1]: peertube.service: Consumed 4.340s CPU time.
Apr 19 23:52:24 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 965.
Apr 19 23:52:24 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 23:52:24 9ig6pa30-1 systemd[1]: peertube.service: Consumed 4.340s CPU time.
Apr 19 23:52:24 9ig6pa30-1 systemd[1]: Started PeerTube daemon.
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]: [exampledomain.net:443] 2023-04-19 23:52:27.438 info: Using following configuration file hierarchy: /var/www/peertube/config/default.yaml -> /var/www/peertube/config/production.yaml.
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]: [exampledomain.net:443] 2023-04-19 23:52:27.441 warn: Emailer is disabled so the contact form will not work.
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]: [exampledomain.net:443] 2023-04-19 23:52:27.715 error: Unable to connect to PostgreSQL database. {
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:   "err": {
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:     "stack": "SequelizeConnectionError: password authentication failed for user \"peertube\"\n    at Client._connectionCallback (/var/www/peertube/versions/peertube-v5.1.0/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:143:24)\n    at Client._handleErrorWhileConnecting (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg/lib/client.js:316:19)\n    at Client._handleErrorMessage (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg/lib/client.js:336:19)\n    at Connection.emit (events.js:400:28)\n    at /var/www/peertube/versions/peertube-v5.1.0/node_modules/pg/lib/connection.js:119:12\n    at Parser.parse (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/parser.js:40:17)\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/index.js:11:42)\n    at Socket.emit (events.js:400:28)\n    at addChunk (internal/streams/readable.js:293:12)\n    at readableAddChunk (internal/streams/readable.js:267:9)\n    at Socket.Readable.push (internal/streams/readable.js:206:10)\n    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:     "message": "password authentication failed for user \"peertube\"",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:     "name": "SequelizeConnectionError",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:     "parent": {
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "stack": "error: password authentication failed for user \"peertube\"\n    at Parser.parseErrorMessage (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/parser.js:287:98)\n    at Parser.handlePacket (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/parser.js:126:29)\n    at Parser.parse (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/parser.js:39:38)\n    at Socket.<anonymous> (/var/www/peertube/versions/peertube-v5.1.0/node_modules/pg-protocol/dist/index.js:11:42)\n    at Socket.emit (events.js:400:28)\n    at addChunk (internal/streams/readable.js:293:12)\n    at readableAddChunk (internal/streams/readable.js:267:9)\n    at Socket.Readable.push (internal/streams/readable.js:206:10)\n    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "message": "password authentication failed for user \"peertube\"",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "length": 104,
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "name": "error",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "severity": "FATAL",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "code": "28P01",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "file": "auth.c",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "line": "331",
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:       "routine": "auth_failed"
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:     }
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]:   }
Apr 19 23:52:27 9ig6pa30-1 peertube[129482]: }
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: peertube.service: Main process exited, code=exited, status=255/EXCEPTION
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: peertube.service: Failed with result 'exit-code'.
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: peertube.service: Consumed 4.283s CPU time.
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: peertube.service: Scheduled restart job, restart counter is at 966.
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: Stopped PeerTube daemon.
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: peertube.service: Consumed 4.283s CPU time.
Apr 19 23:52:27 9ig6pa30-1 systemd[1]: Started PeerTube daemon.



Yes. The password I mentionned was the database password.
Just read the logs you posted on your previous message:

Apr 19 04:41:16 9ig6pa30-1 peertube[108779]: Error: Cannot parse config file: '/var/www/peertube/config/production.yaml': YAMLException: bad indentation of a mapping entry (56:98)
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  53 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  54 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  55 |  ...
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  56 |  ... MpMM=g|Ig:s@,nD11111111117aIG'vc2Hu'
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]: -----------------------------------------^
Apr 19 04:41:16 9ig6pa30-1 peertube[108779]:  57 |  ...

The arrow shows you the single quote in the password, that made the config file invalid.
In the error message, (56:98) means that the error is somewhere around the line 56, column 98.

Line 56 in production.yaml is the postgresql password. And of course, if you changed it in the config file, you must set the same password for the database user (i mean, posgresql password, not system password).
To change the posgresql password for the peertube user, connect to the DB, and execute following request:

ALTER USER peertube WITH PASSWORD 'new_password';

Holy shit that worked. It ran now. I really appreciate your help with this. Can I send you a crypto tip? Give me a Bitcoin or Monero wallet.

1 « J'aime »

No crypto for me.
My work and help can be rewarded throught my Liberapay account: JohnLivingston's profile - Liberapay

1 « J'aime »

Hey I’m living outside my country of origin, which makes banking difficult. I also am not in the EU. Can you please consider accepting a donation in Solana? It is very environmentally friendly if that is the reason for not wanting crypto.

Solana maxamixes the hardware’s use and is Proof of Stake. Unlike Bitcoin, it is not mined. Paypal web servers create more electric waste than Solana

It’s not worth a tip. I would have to create a wallet, find an operator to convert to euros, and do some extra paperwork to declare everything for taxes.