[GH-ISSUE #122] Watchtower Updated Image - Internal Server Error, KeyError: only_send_if_media #31

Closed
opened 2026-09-02 13:09:00 +02:00 by TheLovinator · 2 comments
Owner

Originally created by @EthanC on GitHub (Jul 16, 2023).
Original GitHub issue: https://github.com/TheLovinator1/discord-twitter-webhooks/issues/122

I'm running Watchtower to monitor for Docker image updates. After updating from image 4cf490a83362 to 15400a125ce6, I see an Internal Server Error upon attempting to access the Web UI.

Related #118

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     REDACTED - "GET / HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/botuser/.local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/botuser/.local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
    await super().__call__(scope, receive, send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/discord_twitter_webhooks/main.py", line 56, in index
    list_of_groups = [get_group(reader, group) for group in groups]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/discord_twitter_webhooks/main.py", line 56, in <listcomp>
    list_of_groups = [get_group(reader, group) for group in groups]
                      ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/discord_twitter_webhooks/_dataclasses.py", line 89, in get_group
    only_send_if_media=group["only_send_if_media"],
                       ~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'only_send_if_media'
Job "sched_func (trigger: interval[0:15:00], next run at: 2023-07-16 20:40:36 UTC)" raised an exception
Traceback (most recent call last):
  File "/home/botuser/.local/lib/python3.11/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/discord_twitter_webhooks/main.py", line 389, in sched_func
    send_to_discord(reader)
  File "/app/discord_twitter_webhooks/send_to_discord.py", line 241, in send_to_discord
    group = get_group(reader, str(_group))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/discord_twitter_webhooks/_dataclasses.py", line 89, in get_group
    only_send_if_media=group["only_send_if_media"],
                       ~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'only_send_if_media'
Originally created by @EthanC on GitHub (Jul 16, 2023). Original GitHub issue: https://github.com/TheLovinator1/discord-twitter-webhooks/issues/122 I'm running [Watchtower](https://github.com/containrrr/watchtower) to monitor for Docker image updates. After updating from image `4cf490a83362` to `15400a125ce6`, I see an Internal Server Error upon attempting to access the Web UI. Related #118 ``` INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: REDACTED - "GET / HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/botuser/.local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/botuser/.local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__ await super().__call__(scope, receive, send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__ raise exc File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__ raise exc File "/home/botuser/.local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__ raise e File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__ await self.app(scope, receive, send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/home/botuser/.local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/botuser/.local/lib/python3.11/site-packages/fastapi/routing.py", line 190, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/discord_twitter_webhooks/main.py", line 56, in index list_of_groups = [get_group(reader, group) for group in groups] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/discord_twitter_webhooks/main.py", line 56, in <listcomp> list_of_groups = [get_group(reader, group) for group in groups] ^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/discord_twitter_webhooks/_dataclasses.py", line 89, in get_group only_send_if_media=group["only_send_if_media"], ~~~~~^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'only_send_if_media' Job "sched_func (trigger: interval[0:15:00], next run at: 2023-07-16 20:40:36 UTC)" raised an exception Traceback (most recent call last): File "/home/botuser/.local/lib/python3.11/site-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/discord_twitter_webhooks/main.py", line 389, in sched_func send_to_discord(reader) File "/app/discord_twitter_webhooks/send_to_discord.py", line 241, in send_to_discord group = get_group(reader, str(_group)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/discord_twitter_webhooks/_dataclasses.py", line 89, in get_group only_send_if_media=group["only_send_if_media"], ~~~~~^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'only_send_if_media' ```
Author
Owner

@TheLovinator1 commented on GitHub (Jul 16, 2023):

I think this is already fixed: github.com/TheLovinator1/discord-twitter-webhooks@e1e9a435d2, does it work with the latest container?

<!-- gh-comment-id:1637185083 --> @TheLovinator1 commented on GitHub (Jul 16, 2023): I think this is already fixed: https://github.com/TheLovinator1/discord-twitter-webhooks/commit/e1e9a435d2a2353edbdead71660e7e533583a662, does it work with the latest container?
Author
Owner

@EthanC commented on GitHub (Jul 16, 2023):

Ah, yup! Looks like I pulled between the bug and fix.

<!-- gh-comment-id:1637191842 --> @EthanC commented on GitHub (Jul 16, 2023): Ah, yup! Looks like I pulled between the bug and fix.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TheLovinator/discord-twitter-webhooks#31
No description provided.