Error Starting Peertube “no such file or directory, open ‘/var/www/peertube/storage/tmp/plugins-global.css”

systemctl status peertube shows the following error.

Error: ENOENT: no such file or directory, open ‘/var/www/peertube/storage/tmp/plugins-global.css’

Looks like an error because the global.css file is not there. You can temporarily fix the issue by creating the file.

su peertube
touch /var/www/peertube/storage/tmp/plugins-global.css

Probably an issue with a plugin being installed or something of the sort.

Peertube – Change Video Settings/Channels from Command Line

Since Peertube uses a Postgres database, we can log in and manually do bulk changes to videos. Things like updating a channel ID, Category, or Privacy can all be easily changed and it is easy to do bulk changes.

Access the Database

Login as the peertube user via ssh

ssh peertube@peertube-ip

Connect to postgres

psql peertube_prod

View videos

select * from video;

There is a bit much information, lets clean it up a bit

select name,category,id,"channelId" from video;

View all the channels. The id field is the channelId that is used in the above video table.

select id,name from "videoChannel";

Change video channel

update video set "channelId" = 100 where id = 123;

Replace 100 with the actual channelId and 123 with the id of the video. Can use the above commands to find that info.

Change Privacy Settings

The privacy settings are what determine if a video is Public, Private etc.

The following command can update the privacy setting for a video

update video set privacy = 3 where id = 101;

There are 4 privacy settings. Change 3 to one of the following.

1 = Public
2 = Unlisted
3 = Private
4 = Internal

Change 101 to the video id you want to change.

You can change the privacy settings for all videos in a channel with something like the following

update video set privacy = 4 where "channelId" = 100;

Fix Peertube youtube-dl not Downloading

Issue was not being able to import a video into Peertube using a URL.

Peertube was set up to use youtube-dl which is in /var/www/peertube/storage/bin/youtube-dl. Further investigation showed that Peertube calls it with python.

For example

python youtube-dl video-to-download

Usually Python refers to Python 2 where as Python3 refers to Python 3.

We can create a symlink so that python = python3

sudo ln -s /usr/bin/python3 /usr/bin/python

This way when Peertube runs python, it technically will run it with python3.

Note you will probably run into issues if you do have Python 2 installed and need it. In my case, python was not installed and didn’t reference anything.