iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.08k stars 1.78k forks source link

[Bug] Healthchecks error 500 keep restarting container #2619

Closed martadinata666 closed 1 year ago

martadinata666 commented 2 years ago

Describe the bug

The current compose file has healtchecks, and resulting error 500 after few hours running, making container unusable as container will keep restart because unhealthy status.

Steps to Reproduce

  1. Deploy compose
  2. Check logs, Err 500
  3. Container not responding due restart (unhealthy)

Solution right now Remove the healtchecks line in compose, and redeploy, so the container keep running.

...
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1 #resulting error 500
      interval: 30s
      timeout: 5s
      retries: 2
...
SamantazFox commented 2 years ago

There was a recent change at youtube that made all instance break. Please check #2577

martadinata666 commented 2 years ago

I think this a different issue, maybe API request limit, fixed after few hours removing healthchecks. But thanks for refering current issues.

invidious_app.1.kmbn4pueny73@homelab    | [production] Invidious is ready to lead at http://0.0.0.0:3000
invidious_app.1.kmbn4pueny73@homelab    | 2021-11-15 13:54:14 UTC [info] 500 GET /api/v1/comments/jNQXAC9IVRw 152.96ms
invidious_app.1.hziqzdnsa7l3@homelab    | [production] Invidious is ready to lead at http://0.0.0.0:3000
invidious_app.1.hziqzdnsa7l3@homelab    | 2021-11-15 13:56:20 UTC [info] 500 GET /api/v1/comments/jNQXAC9IVRw 172.62ms
SamantazFox commented 2 years ago

I think this a different issue, maybe API request limit, fixed after few hours removing healthchecks. But thanks for refering current issues.

I'll reopen the issue, then. We had the same problem with the captcha job always checking the same URLs.

TheFrenchGhosty commented 2 years ago

@SamantazFox We should just check an internal URL (like the setting page), it's not as good but it's enough to check if the instance is up.

martadinata666 commented 2 years ago

That will do, this like is my self running

healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/preferences || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
invidious_app.1.iia2se97v0ir@homelab    | [production] Invidious is ready to lead at http://0.0.0.0:3000
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:54:04 UTC [info] 200 GET /preferences 452.45µs
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:54:34 UTC [info] 200 GET /preferences 507.46µs
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:55:05 UTC [info] 200 GET /preferences 402.76µs
unixfox commented 2 years ago

That will do, this like is my self running

healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/preferences || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
invidious_app.1.iia2se97v0ir@homelab    | [production] Invidious is ready to lead at http://0.0.0.0:3000
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:54:04 UTC [info] 200 GET /preferences 452.45µs
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:54:34 UTC [info] 200 GET /preferences 507.46µs
invidious_app.1.iia2se97v0ir@homelab    | 2021-11-16 11:55:05 UTC [info] 200 GET /preferences 402.76µs

I think the point of using the API comments is that it's a component that talk with youtube servers so if something is wrong then a restart may fix the issue.

Whereas, there are hardly any issue with the preferences page.

SamantazFox commented 2 years ago

I think the point of using the API comments is that it's a component that talk with youtube servers so if something is wrong then a restart may fix the issue.

Whereas, there are hardly any issue with the preferences page.

True. We could use the trending page, instead. And maybe also reduce the frequency to once every minute ?

unixfox commented 2 years ago

The trending page is a good idea and about the frequency I think the point is restarting as soon as there is a bug so not sure about expending the amount of time.

SamantazFox commented 2 years ago

mmmh, yeah, that's right.

nocturn9x commented 2 years ago

I kept having this issue too. Getting rid of the health check fixed the problem

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.

Bidonh commented 1 year ago

I just got that same problem, unhealthy checks and error 500. I fixed it by checking the trending page.

 healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/feed/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2