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

Incompatibility between Kopf and New python-json-logger Version Causes Startup Crash" #1146

Closed
leroyshirto opened this issue Dec 12, 2024 · 3 comments · Fixed by #1149
Closed
Labels
bug Something isn't working

Comments

@leroyshirto
Copy link

Long story short

A new version of python-json-logger breaks compatibility with kopf, causing kopf to crash with the error No module named 'pythonjsonlogger.jsonlogger' due to the dependency not being pinned. This issue is documented here: nhairs/python-json-logger#29. Pinning python-json-logger to version 2.0.7 resolves the problem.

Kopf version

1.37.3

Kubernetes version

v1.28.7+6e2789b

Python version

3.12

Code

No response

Logs

Traceback (most recent call last):
  File "/usr/local/bin/kopf", line 5, in <module>
    from kopf.cli import main
  File "/usr/local/lib/python3.12/site-packages/kopf/__init__.py", line 111, in <module>
    from kopf._core.actions.loggers import (
  File "/usr/local/lib/python3.12/site-packages/kopf/_core/actions/loggers.py", line 16, in <module>
    import pythonjsonlogger.jsonlogger
ModuleNotFoundError: No module named 'pythonjsonlogger.jsonlogger'

Additional information

No response

@leroyshirto leroyshirto added the bug Something isn't working label Dec 12, 2024
@jmandl
Copy link

jmandl commented Dec 12, 2024

Meanwhile you can set this version to your requirements.txt file:

aiohappyeyeballs==2.4.4
aiohttp==3.11.10
aiosignal==1.3.1
async-timeout==5.0.1
attrs==24.2.0
click==8.1.7
frozenlist==1.5.0
idna==3.10
iso8601==2.1.0
kopf==1.37.3
multidict==6.1.0
propcache==0.2.1
python-json-logger==2.0.7
PyYAML==6.0.2
typing_extensions==4.12.2
yarl==1.18.3

@johnson2427
Copy link

python-json-logger changed their pythonjsonlogger.jsonlogger to pythonjsonlogger.json in python-json-logger>=3.1.0

Install python-json-logger==3.0.0 until this is resolved

@nolar
Copy link
Owner

nolar commented Dec 13, 2024

The fix is released in Kopf 1.37.4.

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
4 participants