Closed Pofilo closed 5 years ago
Please copy the related row so I can reproduce (in the videoImport
table)
I'm not using PostgreSQL so much, tell me if I'm doing wrong:
sudo -u postgres psql
\c peertube_prod
\dt
Result is:
List of relations
Schema | Name | Type | Owner
--------+----------------------+-------+----------
public | account | table | peertube
public | accountVideoRate | table | peertube
public | actor | table | peertube
public | actorFollow | table | peertube
public | application | table | peertube
public | avatar | table | peertube
public | oAuthClient | table | peertube
public | oAuthToken | table | peertube
public | scheduleVideoUpdate | table | peertube
public | server | table | peertube
public | tag | table | peertube
public | user | table | peertube
public | video | table | peertube
public | videoAbuse | table | peertube
public | videoBlacklist | table | peertube
public | videoCaption | table | peertube
public | videoChangeOwnership | table | peertube
public | videoChannel | table | peertube
public | videoComment | table | peertube
public | videoFile | table | peertube
public | videoImport | table | peertube
public | videoRedundancy | table | peertube
public | videoShare | table | peertube
public | videoTag | table | peertube
public | videoView | table | peertube
(25 rows)
And then, I do my select * from videoImport;
and the result is:
ERROR: relation "videoimport" does not exist
LINE 1: select * from videoImport;
Why does my relation is transformed to videoimport instead of videoImport ?
Sorry for my noobyness about PostgreSQL :/
SELECT * FROM "videoImport";
I give you both lines, the first one is the one with the error:
id | targetUrl | magnetUri | torrentName | state | error | userId | videoId | createdAt | updatedAt
----+------------------------------------------------------------------------------+-----------+-------------+-------+---------------------------+--------+---------+----------------------------+----------------------------
1 | https://peertube.waifus.eu/videos/watch/217eefeb-883d-45be-b7fc-a788ad8507d3 | | | 2 | | 2 | | 2018-09-01 23:42:55.41+02 | 2018-09-01 23:43:26.405+02
2 | https://peertube.waifus.eu/videos/watch/217eefeb-883d-45be-b7fc-a788ad8507d3 | | | 2 | | 2 | 299 | 2018-09-01 23:45:55.506+02 | 2018-09-01 23:46:26.101+02
So the videoId is missing but the state is at 2
.
I'll make some tries to reproduce the bug.
If we don't succeed to reproduce it, as it appears in peertube-v1.0.0-beta.11, we may believe it has been fixed since as some works has be done to imports.
To anyone having this problem, delete the line with:
delete from "videoImport" where id = 1
There is also an error in video import script where if youtube-dl returns an error because the video can't be downloaded the rest of the videos don't get imported, what we should do is continue on error, or rather use the youtube-dl flag --ignore-errors
here is the output of the error I get when a video can't be imported the rest of the video don't import either. We should catch the promise error and also use the --ignore-errors
flag.
(node:21561) UnhandledPromiseRejectionWarning: Error: Command failed: /var/www/peertube/versions/peertube-v1.0.0-beta.15/node_modules/youtube-dl/bin/youtube-dl --dump-json -f best http://www.youtube.com/watch?v=DLBcFVbUs_0
ERROR: This video contains content from kaze, who has blocked it in your country on copyright grounds.
at ChildProcess.exithandler (child_process.js:276:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:21561) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (re$
(node:21561) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I'm gonna try to solve this and make a pull request
Closing this issue: the origin issue seems to have been fixed.
PeerTube version or URL: PeerTube v1.0.0-rc.1 but happens since peertube-v1.0.0-beta.11
Browser name/version: not relevant
NodeJS version: v8.12.0
What is the expected behaviour?
In video imports, when an import fails, all four columns should be filled and a little arrow allows us to see more about the error.
One time, I made an import and tried to cancel it and it failed. It looks like the database was not filled correctly so the columns are shifted as shown in this image:
Is there a way to fix the database (aka removing this line) with a script or by hand ? I f there is one, I can use it to clean my instance and I could try to reproduce the thing (import a video and cancel it).