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

Yacron HTTP server failing with: KeyError: "Key not found: 'Accept'" #45

Closed
vcajes opened this issue Apr 22, 2021 · 3 comments
Closed

Comments

@vcajes
Copy link

vcajes commented Apr 22, 2021

  • Yet Another Cron version: 0.11.2
  • Python version: the one bundled on the tagged 0.11.2 on the release page
  • Operating System: debian-stable

Description

The web listen config fails to parse requests coming from the kubernetes health checks.

What I Did

The yacron config

web:
  listen:
    - http://0.0.0.0:8072

The kubernetes healt check config:

        readinessProbe:
          httpGet:
            path: /status
            port: 8072
            scheme: HTTP

The output logs:

INFO:aiohttp.access:10.101.111.72 [22/Apr/2021:16:35:57 +0000] "GET /status HTTP/1.1" 500 244 "-" "kube-probe/1.19"
ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
  File "aiohttp/web_protocol.py", line 418, in start
  File "aiohttp/web_app.py", line 458, in _handle
  File "yacron/cron.py", line 182, in _web_get_status
  File "multidict/_multidict_py.py", line 74, in __getitem__
  File "multidict/_multidict_py.py", line 69, in getone
KeyError: "Key not found: 'Accept'"

Apparently it doesn't know how to pare the Accept header or something.

Thanks team!

@gjcarneiro
Copy link
Owner

Ah, yes, looking at the line in question, it is obvious that it would crash if the Accept header is missing. Is a simple fix.

@vcajes
Copy link
Author

vcajes commented Apr 22, 2021

Awesome, thanks @gjcarneiro ! When are you planning to make a release binary with this fix included? This will allow use to with kubernetes :)

https://github.com/gjcarneiro/yacron/releases/

Thank you a lot! Great work on this project!

@gjcarneiro
Copy link
Owner

I made a new release 0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants