alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
3.97k stars 264 forks source link

MeTube Webpage not working on Portainer #337

Closed vishalkrv closed 8 months ago

vishalkrv commented 8 months ago

Running the application on Portainer and the container is up without any error however the web page is not coming up.

Docker Compose

version: "3"
services:
  metube:
    image: ghcr.io/alexta69/metube
    container_name: metube
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Kolkata
      - 'YTDL_OPTIONS={"add-metadata":true}'
    volumes:
      - /mnt/passport/youtube:/downloads
    ports:
      - 9995:8081
    restart: unless-stopped

Log

Setting umask to 022

Creating download directory (/downloads), state directory (/downloads/.metube), and temp dir (/downloads)

Changing ownership of download and state directories to 1000:1000

Running MeTube as user 1000:1000

INFO:main:Listening on 0.0.0.0:8081

DEBUG:asyncio:Using selector: EpollSelector

INFO:ytdl:waiting for item to download

I ran the ping command from within the container and below is the error

/app # ping www.google.com
ping: bad address 'www.google.com'
/app # 
PikuZheng commented 8 months ago

??? mine works fine image

PikuZheng commented 8 months ago

Log

Setting umask to 022

Creating download directory (/downloads), state directory (/downloads/.metube), and temp dir (/downloads)

Changing ownership of download and state directories to 1000:1000

Running MeTube as user 1000:1000

INFO:main:Listening on 0.0.0.0:8081

DEBUG:asyncio:Using selector: EpollSelector

INFO:ytdl:waiting for item to download

it looks works fine. use http://yourPortainerIP:9995/

I ran the ping command from within the container and below is the error

/app # ping www.google.com
ping: bad address 'www.google.com'
/app # 

it looks like some issue of network. please go to networks in portainer and check which network is using for metube

gnattu commented 8 months ago

I'm concerned that this issue may be affected by the notoriously bad DNS compatibility problem present in all musl-based distros and Docker images, including Metube. The DNS compatibility is so problematic that it leads to issues from time to time. For example alpinelinux/docker-alpine#155 and kubernetes/kubernetes#112135. The bottom line is, if musl doesn't cooperate well with your DNS server's behavior, it can result in DNS resolution errors.

One common cause, even in simple setups, is that musl queries both A and AAAA records at the same time, and the failure of the AAAA query would even fail the A query. If the DNS server rejects the AAAA resolution because it doesn't support AAAA records and returns a DNS_RCODE_REFUSED, musl will fail the resolution immediately, even if the DNS server later returns an A record. What about when the server does not respond to AAAA at all? Musl will wait for the AAAA response until it times out, and the worst part is that the timed-out AAAA query will fail the A query as well.

Similar problems can also occur when there are multiple upstream DNS servers, and the address is not resolvable in all of them. This issue is even documented by Alpine Linux. Such behavior is caused by the flawed design of musl, and there is little you can do about it. Alpine Linux recommends setting up a local DNS caching server using Dnsmasq and using that as the DNS for your musl-based systems if you are experiencing DNS compatibility issues. A faster way to check if it is indeed the DNS issue is to manually set the DNS to 8.8.8.8 for the container. As far as I know, Google's DNS works fine with musl.

PikuZheng commented 8 months ago

I've been using alpine for a long time and never had this problem. DNS server returns SOA for AAA query when no AAA record exists, instead of server reject. if it's not, try to change to a pretty dns server

vishalkrv commented 8 months ago

Log

Setting umask to 022

Creating download directory (/downloads), state directory (/downloads/.metube), and temp dir (/downloads)

Changing ownership of download and state directories to 1000:1000

Running MeTube as user 1000:1000

INFO:main:Listening on 0.0.0.0:8081

DEBUG:asyncio:Using selector: EpollSelector

INFO:ytdl:waiting for item to download

it looks works fine. use http://yourPortainerIP:9995/

I ran the ping command from within the container and below is the error

/app # ping www.google.com
ping: bad address 'www.google.com'
/app # 

it looks like some issue of network. please go to networks in portainer and check which network is using for metube

Thanks. It was mistake of my own, I had setup as a stack so portainer created a separate host which didn't have access. I deleted and created a simple container and it worked.