SamTV12345 / PodFetch

A sleek and efficient podcast downloader.
https://samtv12345.github.io/PodFetch
Apache License 2.0
347 stars 25 forks source link

Subscription Empty and appears after config #738

Closed MrSiO closed 5 months ago

MrSiO commented 5 months ago

Describe the bug

(see video) When I first open Podfetch from Android (tried Firefox, Chrome and Inconito) my subscription list appears empty.

Same thing happens on MacOS Safari & Chrome.

I need to go to Setting/Manage Podcast (where I do see my subscription list) and only after that when I go back to Subscription, they appear... This fix will last until I close the browser tab. Have to do this everytime.

https://github.com/SamTV12345/PodFetch/assets/49870576/7b1d3a98-e6e1-4240-b74e-1d8840b45aaf

Reproduction

Follow same steps as show on video using Android device on any browser

System Info

Unable to launch shell on Podfetch Docker container... Issue with image.

Using Docker-Compose in Ubuntu.
Intel NUC
Running version: v4.6.2-3b0758b7 (HEAD)

Used Package Manager

npm

Validations

SamTV12345 commented 5 months ago

Maybe the configuration is wrong. Can you send me your configuration? Maybe also the Devtools responses in the network tab. Thanks :)

MrSiO commented 5 months ago

Maybe the configuration is wrong. Can you send me your configuration? Maybe also the Devtools responses in the network tab. Thanks :)

Here is my Docker-Compose config

version: '3'
services:
  podfetch:
    image: samuel19982/podfetch:latest
    container_name: podfetch
    user: ${UID:-1000}:${GID:-1000}
    ports:
      - "80:8000"
    volumes:
      - /home/user/podfetch_data/podcasts:/app/podcasts
      - /home/user/podfetch_data/db:/app/db
    environment:
      - POLLING_INTERVAL=60
      - SERVER_URL=http://192.168.107.134:80
      - DATABASE_URL=sqlite:///app/db/podcast.db
      - TELEGRAM_BOT_TOKEN=0123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      - TELEGRAM_BOT_CHAT_ID=-58xxxxxxxxxxx
      - TELEGRAM_API_ENABLED=true  
    restart: always    

    networks:
      VLAN-MEDIA:
        ipv4_address: 192.168.107.134

networks:
  VLAN-MEDIA:
    external: true

About the "Devtools" you are talking about, I have no such tabs anywhere.... All I got at the top right is:

podfetch-1

Note that "/home/user/podfetch_data/podcasts" is a mounted folder from a Synology NAS via SMB.

I also found that Podfech logs show this when I refresh the subscriptions that arent shown:

2024-05-11T15:37:27 ❌ - Database error: disk I/O error 2024-05-12T23:02:47 ❌ - Database error: disk I/O error 2024-05-12T23:02:54 ❌ - Database error: disk I/O error

Then if I go to Settings/Manage podcast, then they show up (as seen in the video) but I still get those I/O error logs each time... HUmmmm

Let me know how I can provide you with mode infos but it does seem I have a DB issue....

Thx alot!

kronna commented 5 months ago

I'm having the same issue exactly.

SamTV12345 commented 5 months ago

Maybe the configuration is wrong. Can you send me your configuration? Maybe also the Devtools responses in the network tab. Thanks :)

Here is my Docker-Compose config

version: '3'
services:
  podfetch:
    image: samuel19982/podfetch:latest
    container_name: podfetch
    user: ${UID:-1000}:${GID:-1000}
    ports:
      - "80:8000"
    volumes:
      - /home/user/podfetch_data/podcasts:/app/podcasts
      - /home/user/podfetch_data/db:/app/db
    environment:
      - POLLING_INTERVAL=60
      - SERVER_URL=http://192.168.107.134:80
      - DATABASE_URL=sqlite:///app/db/podcast.db
      - TELEGRAM_BOT_TOKEN=0123456789:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      - TELEGRAM_BOT_CHAT_ID=-58xxxxxxxxxxx
      - TELEGRAM_API_ENABLED=true  
    restart: always    

    networks:
      VLAN-MEDIA:
        ipv4_address: 192.168.107.134

networks:
  VLAN-MEDIA:
    external: true

About the "Devtools" you are talking about, I have no such tabs anywhere.... All I got at the top right is:

podfetch-1

Note that "/home/user/podfetch_data/podcasts" is a mounted folder from a Synology NAS via SMB.

I also found that Podfech logs show this when I refresh the subscriptions that arent shown:

2024-05-11T15:37:27 ❌ - Database error: disk I/O error 2024-05-12T23:02:47 ❌ - Database error: disk I/O error 2024-05-12T23:02:54 ❌ - Database error: disk I/O error

Then if I go to Settings/Manage podcast, then they show up (as seen in the video) but I still get those I/O error logs each time... HUmmmm

Let me know how I can provide you with mode infos but it does seem I have a DB issue....

Thx alot!

Does it work when you change the line user: ${UID:-1000}:${GID:-1000} to
user: ${UID:-0}:${GID:-0}? @kronna @MrSiO

MrSiO commented 5 months ago

Yes! That worked for me.

So clearly an access right that ain't ok.

Since we don't wanna run this as Root (user 0) what would be a permanent fix?

SamTV12345 commented 5 months ago

Yes! That worked for me.

So clearly an access right that ain't ok.

Since we don't wanna run this as Root (user 0) what would be a permanent fix?

Yes it is best practice to run the docker container not as root but docker always creates volumes as root. That is why this fixed the issue permanently.

MrSiO commented 5 months ago

Thx!

On Mon., May 13, 2024, 17:08 SamTV12345, @.***> wrote:

Yes! That worked for me.

So clearly an access right that ain't ok.

Since we don't wanna run this as Root (user 0) what would be a permanent fix?

Yes it is best practice to run the docker container not as root but docker always creates volumes as root. That is why this fixed the issue permanently.

— Reply to this email directly, view it on GitHub https://github.com/SamTV12345/PodFetch/issues/738#issuecomment-2108803190, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4PN4CFL256WAM54UDZEWTZCETWVAVCNFSM6AAAAABHRQGVHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYHAYDGMJZGA . You are receiving this because you were mentioned.Message ID: @.***>

kronna commented 5 months ago

that works for me too, thank you.

SamTV12345 commented 5 months ago

Great that this worked :). I have a documentation website with common pitfalls and installation instructions https://samtv12345.github.io/PodFetch/Installation.html#installation-with-docker-sqlite .

MrSiO commented 5 months ago

The info on that page still states UID:1000. Might want to update the info for future reference.

Thx for your help and great project!

On Tue., May 14, 2024, 16:39 SamTV12345, @.***> wrote:

Great that this worked :). I have a documentation website with common pitfalls and installation instructions https://samtv12345.github.io/PodFetch/Installation.html#installation-with-docker-sqlite .

— Reply to this email directly, view it on GitHub https://github.com/SamTV12345/PodFetch/issues/738#issuecomment-2111100664, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4PN4ERQM5GJCLHDT2LYPDZCJY6XAVCNFSM6AAAAABHRQGVHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGEYDANRWGQ . You are receiving this because you were mentioned.Message ID: @.***>

SamTV12345 commented 5 months ago

The info on that page still states UID:1000. Might want to update the info for future reference. Thx for your help and great project! On Tue., May 14, 2024, 16:39 SamTV12345, @.> wrote: Great that this worked :). I have a documentation website with common pitfalls and installation instructions https://samtv12345.github.io/PodFetch/Installation.html#installation-with-docker-sqlite . — Reply to this email directly, view it on GitHub <#738 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4PN4ERQM5GJCLHDT2LYPDZCJY6XAVCNFSM6AAAAABHRQGVHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGEYDANRWGQ . You are receiving this because you were mentioned.Message ID: @.>

Thanks for the notice. It's actually by design. Running a container as root can be dangerous that is why it is best to create an unprivileged user and allow that user to only write to that folder.

4lloyd commented 4 months ago

I have the same problem when using SQLite. Changing the rights to the db folder won't solve the problem for me for some reason.

Part of my Docker Compose file:

services:
  podfetch:
    image: samuel19982/podfetch:latest
    container_name: podfetch
    user: ${UID:-1000}:${GID:-1000}
    ports:
      - "80:8000"
    volumes:
      - /test/data:/app/podcasts
      - /test/db:/app/db
    environment:
      - POLLING_INTERVAL=60
      - SERVER_URL=http://podfetch.domain.com
      - DATABASE_URL=sqlite:///app/db/podcast.db

I have run the following commands multiple times (also after the error):

sudo chown -R 1000:1000 /test
sudo chmod -R 777 /test

When I change the user to 0:0 in the Docker Compose file then the podcasts will show up. But I don't understand why this is the case as the folders seem to have enough permissions as far as I can see.

I did some further checks with user 1000:1000 configured in the Docker Compose file. The disk I/O error is caused by the following request, which is run when the "All Subscriptions" page is opened: /api/v1/podcasts/search?title=&order=ASC&orderOption=PUBLISHEDDATE&favoredOnly=false

As a test I changed the request data and the following requests work without problems: /api/v1/podcasts/search?title=pd&order=ASC&orderOption=PUBLISHEDDATE&favoredOnly=false (changed title) /api/v1/podcasts/search?title=&order=ASC&orderOption=PUBLISHEDDATE&favoredOnly=true (changed favoredOnly)

When I use the search function on the "All Subscriptions" page and type in some letters (two or more), then the podcasts will start to show.

I find it strange that just in a specific case the search fails. If I manually search then soms results will show and therefore I suspect that the folder rights are ok. Do you maybe have any ideas if something else can cause this problem?

Let me know if you need more information and thank you for the work on this awesome app!