marcopeocchi / yt-dlp-web-ui

A terrible web ui for yt-dlp. Designed to be self-hosted.
Mozilla Public License 2.0
657 stars 67 forks source link

fork/exec /usr/local/bin/yt-dlp: no such file or directory #113

Closed MK99MA closed 5 months ago

MK99MA commented 6 months ago

Hello,

first of all thank you for creating this project, unfortuantely I'm currently running into an issue with it which got me stuck at a deadend as it seems.

I'm trying to run the web ui on my raspberry pi 4 using the provided docker container. To do so, I'm using this command:

docker run -d --name=ytdlp --restart unless-stopped -p 8090:3033 -v /home/pi/ytdlp:/home/pi/ytdlp -v /home/pi/ytdlp:/config marcobaobao/yt-dlp-webui:master

(here might be already some obvious issue, but at least the UI is starting and I can access it) Now when I try to add a youtube link to test the download, either the window to star the download closes itself without doing anything, or gets stuck (if the option for the format selection is enabled) after greying out the 'Start' button. After checking the docker logs (docker logs ytdlp) I can see this message:

2023/12/09 20:35:55 fork/exec /usr/local/bin/yt-dlp: no such file or directory
panic: fork/exec /usr/local/bin/yt-dlp: no such file or directory

goroutine 44 [running]:
log.Panicln({0x2ec5f24, 0x1, 0x1})
    /usr/local/go/src/log/log.go:398 +0x84
github.com/marcopeocchi/yt-dlp-web-ui/server/internal.(*Process).Start(0x2956dc0)
    /usr/src/yt-dlp-webui/server/internal/process.go:111 +0x630
github.com/marcopeocchi/yt-dlp-web-ui/server/internal.(*MessageQueue).Subscriber.func1(0x2956dc0)
    /usr/src/yt-dlp-webui/server/internal/message_queue.go:51 +0x24
created by github.com/marcopeocchi/yt-dlp-web-ui/server/internal.(*MessageQueue).Subscriber
    /usr/src/yt-dlp-webui/server/internal/message_queue.go:50 +0x30
2023/12/09 20:35:57  Successfully restored session 
2023/12/09 20:35:57  Successfully serialized session 

However the file exists in the path /usr/local/bin/ and I'm also able to use the command yt-dlp. (using it without options gives me the help message, providing an url did download the video) Permissions are set / given according to the installation instructions of yt-dlp itself. I also tried running the UI without the file being there, after reinstalling it and setting the permissions again, in the end I always end up with the above message.

I hope you can give me an headsup here, it's probably something very obvious or stupid on my end...

Thank you.

marcopeocchi commented 6 months ago

Hello @MK99MA,

First of all you're pulling the master tag (the image could be outdated). Either pull ghcr.io/marcopeocchi/yt-dlp-web-ui:master or marcobaobao/yt-dlp-webui:latest.

Furthermore, colud be a typo, but your mapping the downloads volume wrong. It should be -v /home/pi/ytdlp:/downloads

Let me know if this solves the issue.

MK99MA commented 6 months ago

Hello @marcopeocchi ,

I was actually pulling the master tag, as the latest did not work at all on the RPi4, so when it mentioned this tag as an alternative I tried it with that. So I was already aware that it could be outdated, but unfortunately I didn't even get to this step with the latest tag before (I will try again in a few minutes)

EDIT: As you can see there doesn't seem to be a matching manifest. I think the RPi in question is running an older version of Raspbian, it's been some time, but I think there were some reasons why it is still running on that version. image

About the typo, I think this actually stems from some experiments with the vars, so it was probably a leftover from that and could indeed be a reason. I'll check that too.

EDIT2: As I couldn't proceed with testing after pulling the latest tag I just gave it a try after fixing the typo / wrong var with: docker run -d --name=ytdlp --restart unless-stopped -p 8090:3033 -v /home/pi/ytdlp:/downloads -v /home/pi/ytdlp:/config marcobaobao/yt-dlp-webui:master

I don't get the error in the log that way, but it also doesn't seem to do anything after clicking 'Start' now: chrome_furvVg1OSC

One thing I noticed after changing the command however is that it also says 0GB on the top right, before it would show ~60GB (the size of an usb drive thats mounted in /home/pi/ytdlp).

marcopeocchi commented 6 months ago

Hi @MK99MA,

I'll try the arm64 image on my Mac this evening because it seems very strange.

I'll keep you informed.

MK99MA commented 6 months ago

Hi @marcopeocchi,

were you able to try the image? If not it's fine, I'm just being curious.

marcopeocchi commented 6 months ago

Hello @MK99MA!

Sorry but I've been a little overworked 😞. I've tried the image on my Mac and everything's fine.

The arm64 and amd64 containers should be identical the only thing different is the compilation target and the python 3 interpreter used by yt-dlp.

This weekend I'll be less busy and I'll perform other tests.

MK99MA commented 6 months ago

Hello @marcopeocchi,

no worries, like I said it would've been fine if you weren't able to have a look. My curiosity just got the better of me.

Are there perhaps things I could additionally test on my end? I also didn't have the chance to do much this week because of work and another "project" I started, but if there is something that comes to mind to narrow down my / the issue I'd be glad to help out.

marcopeocchi commented 6 months ago

i retested, rebuilt the image on arm64 and everything works fine. The following image is yt-dlp-webui arm64 running on docker desktop for mac. image image

One thing that hopped in my mind is that mapping the same folder to downloads and config volumes is not a great idea.

Try first omitting the config volume, if it works map config to a different folder.

marcopeocchi commented 6 months ago

After re-inspecting the terminal screenshot you posted:

Are you running (it seems raspbian) with the 32bit image? If yes, the arm/v7 image has been recently deprecated. I suggest you using a 64bit image for your raspberry pi 4, furthermore many docker images are dropping arm/v7 support recently. I mainly dropped it for saving CI/CD build time.

edit: wrong /home/pi/ytdlp folder permissions? can you post the ls -la output of the . entry?

MK99MA commented 6 months ago

Yes you're actually right.

I updated my RPi4 and RPi3B before, but I had to restore a backup (which was still using the old image). Somehow I thought it was on the 3B which is also running "more important". I was pretty sure the newer RPi was also the one which is running on the "new" version but I was obviously mistaken (I also didn't really check for it which probably could've saved quite some time...)

About the permissions: Should have all permissions (I tested alot with this at first because I thought this was a likely culprit), but for now I'm taking care of the version,

MK99MA commented 6 months ago

Hi @marcopeocchi ,

because of the holidays I got the time and (found some) motivation to update my RPi4 to the 64bit image (and to install it on an external SSD while I was at it). Now after pulling the latest docker image almost everything seems to be working as intended:

image

However I seem to have run into a new 'issue'. I downloaded the above video as a test. It was also displayed in the Archive tab as intended. I selected the video and used the delete option on the lower right. After that the site got stuck in this loading screen:

image

I can't select anything else, only if I open the webpage again (which puts me back to Home) I can interact with it again. If I click on archive again I end up in the same situation. If I download a new(?) or the same video again, then it works again. It looks like the empty download directory is causing some issues here (after it had a file before). Same when I had two files in there. I could delete the first just fine, but when I tried to delete the last remaining file I got the endless loading circle again (though I had to click on archive again, as the site wasn't auto refreshed like when I removed the first file.

That being said I noticed the following too in this case: I selected Video1 and deleted it, it was properly removed from the list and (I assume, didn't check it then) removed on the RPi. Then I selected Video 2 and clicked on delete and it asked me for confirmation to delete both videos. So the selection list wasn't cleared after using the delete function. Maybe that is intended or is a direct cause of the issue I'm noticing, but I thought I'd mention it here too.

Do you want me to create a new issue for the above? In theory this issue is resolved by using the latest image (which wasn't possible before because of the outdated OS)

EDIT: Is there a built in way to change the favicon?^^

EDIT2: I get the loading too if there was no file deleted before just by clicking on Archive while it's empty.

EDIT3: image causes this when trying to dl it from the archive, likely because of the , in the filename: image See https://medium.com/@obetoferreira/how-to-fix-the-net-err-response-headers-multiple-content-disposition-error-847903f41c7f

Also downloading the Audio with medium quality (opus) resulted in a .webm file too, m4a did set the correct filetype. If I don't use the format selection but enable the option to extract audio it does however save the file as a .opus file.

marcopeocchi commented 6 months ago

Hello @MK99MA!

Surely there's a lot in your issue and I thank you for finding all this small problems. I'll go by points:

Lastly there's no need to create a new issue at the moment. If there's anything new you may put it in a new issue. Thank you!

MK99MA commented 6 months ago

Hi @marcopeocchi.

Thank you for your response addressing the individual points. I didn't want to overload the comment, I just wrote down / added what I found. Unfortunately my RPi4 seems to be broken (well, I'll definitely know tomorrow when the micro-hdmi adapter arrives I was missing so I can actually check the boot messages) so I didn't test any further.

The download button seems like a nice addition (interestingly enough I came from a different fork of the same UI which was mentioned in the issue, so looks like you're doing things right with your project^^)

Is the last paragraph also already addressed in the current version? Or do you need some more information perhaps? Like I said I can't test it before tomorrow (on the new Pi or the fixed old one), so if that'd be the case I'll add my findings. Perhaps this was a one time occurence too.

marcopeocchi commented 6 months ago

Hello @MK99MA,

I hope that your raspberry is fine 😃. About the opus audio: webm is used as a contanier for both video and audio, so a opus encoded audio with .webm extension is pretty standard.

One thing that you can do is adding a template with -S ext:opus as content. This will map the extension to .opus

MK99MA commented 6 months ago

Hi @marcopeocchi,

so far it looks like it can be saved. Ah I see, I didn't know this, but I also expected it would give me the exact file type which was selected. I didn't think of this possibility either, as it was also marked as a video file in the archive (at least the icon was like this). Using the template you mentioned is something I'll try to do as soon as everything is running again.

MK99MA commented 5 months ago

Hi @marcopeocchi,

I'll finally close this issue now. Everything is currently working and the favicon thing is probably something that might be adressed in the frontend refacturing you announced (and isn't really important to me, I was just curious).

Thank you for all your replies.

Offtopic: I was able to save the RPi but damn it was a wild ride.. and for some reason both images (microSD and a pretty fresh one on an external SSD) require me to mount them using their UUID instead of the (default) PARTUUID which still confuses me to this day... Well.. it works again (for now).