Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self hosted docker - infrequent nginx error 5XX #3972

Open
1 task
takov751 opened this issue Feb 1, 2025 · 4 comments
Open
1 task

Self hosted docker - infrequent nginx error 5XX #3972

takov751 opened this issue Feb 1, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@takov751
Copy link

takov751 commented Feb 1, 2025

Official Instance

Describe the bug

Following official documentation for self hosted setup
In the docker-compose nginx service showing error 5xx on piped-api endpoints after a day or two until restarted

To Reproduce

  1. I have done a self hosted setup following the official documentation
  2. after a 1-2 days running the nginx service showing error 5xx for almost any piped api address. /config or /feed for example.

In my setup i have a caddy as reverse proxy, but even bypassing that showed the issue remain.

Expected behavior

Not to break.

Logs/Errors

I couldn’t find any useful log or any sign in any related service

Browser, and OS with Version.

Safari/Opera on iOS
Firefox/Edge on Fedora 41

Additional context

To mitigate the issue i have added to my reverse proxy with my own domain

networks:
      default:
        aliases:
          - "papi.example.com"

Then added a healthcheck to the nginx service:

healthcheck:
        test: "if [ 400 -eq $(curl -o /dev/null -sw '%{http_code}' https://papi.example.com/feed) ]; then exit 0;else kill 1;fi"
        start_period: 2m
        interval: 2m

For the last week this solution worked flawlessly , yet i am clueless what causing the nginx to lock up like this

@takov751 takov751 added the bug Something isn't working label Feb 1, 2025
@takov751 takov751 changed the title Self hosted infrequent nginx error 5XX Self hosted docker - infrequent nginx error 5XX Feb 1, 2025
@nyarau
Copy link

nyarau commented Feb 4, 2025

You may want to check logs of your backend container by entering the directory of your compose file and running

docker compose logs piped

@takov751
Copy link
Author

takov751 commented Feb 5, 2025

I have tried to correlate between nginx logs and piped backend logs however i only found this snippet so far other than the current IOS player issue tracked in other issue thread. Is there any way I could make the log more verbose? I couldn't find any mention of that in documentation or anywhere on piped-extractor main repo.

piped-backend  | SLF4J: No SLF4J providers were found.
piped-backend  | SLF4J: Defaulting to no-operation (NOP) logger implementation
piped-backend  | SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
piped-backend  | Feb 04, 2025 12:00:15 AM org.hibernate.Version logVersion
piped-backend  | INFO: HHH000412: Hibernate ORM core version [WORKING]
piped-backend  | Feb 04, 2025 12:00:16 AM org.hibernate.cache.internal.RegionFactoryInitiator initiateService
piped-backend  | INFO: HHH000026: Second-level cache disabled
piped-backend  | Feb 04, 2025 12:00:16 AM org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator initiateService
piped-backend  | INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.hikaricp.internal.HikariCPConnectionProvider
piped-backend  | java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asText()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null
piped-backend  | 	at me.kavin.piped.utils.obj.MatrixHelper.<clinit>(MatrixHelper.java:39)
piped-backend  | 	at me.kavin.piped.Main.lambda$main$2(Main.java:90)
piped-backend  | 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
piped-backend  | 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
piped-backend  | 	at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
piped-backend  | Feb 04, 2025 12:00:16 AM org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl constructDialect
piped-backend  | WARN: HHH90000025: PostgreSQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
piped-backend  | Feb 04, 2025 12:00:17 AM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService
piped-backend  | INFO: HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)

@nyarau
Copy link

nyarau commented Feb 5, 2025

You can expose API server by adding ports to your compose file, then poke it with curl -v http://127.0.0.1:8081/trending?region=US:

    piped:
        image: 1337kavin/piped:latest
        ports:
            - "8081:8080"

You may need to remove the healthcheck and restart: unless-stopped, then let the service fail, so that the logs will stop at the moment it fails.
Make sure that your images are up to date by running docker compose pull then docker compose up -d --force-recreate.

@takov751
Copy link
Author

takov751 commented Feb 5, 2025

I will try , however my whole issue is that the api has no issue. The nginx fails to connect to the api on the docker network periodically. Even though api never stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants