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

[Q] Issues with Python 3.10 whitenoise 4 and Graphite Web 1.1.10 #2791

Closed
nook24 opened this issue Dec 8, 2022 · 3 comments
Closed

[Q] Issues with Python 3.10 whitenoise 4 and Graphite Web 1.1.10 #2791

nook24 opened this issue Dec 8, 2022 · 3 comments

Comments

@nook24
Copy link
Contributor

nook24 commented Dec 8, 2022

I'm running Graphite Web within a Docker Container. For this I have build my own Docker image. All related files can be found here: https://github.com/it-novum/graphing-docker/tree/master/graphite-web

Unfortunately I'm unable to run the latest version Graphite Web 1.1.10. Depending on what I try, i get different error messages, so I'm sorry upfront for the long issue text :)

First things first. Everything is working fine as long as I go with Python 3.8 and Graphite Web 1.1.6.
So this works without any issues:

  • Graphite Web: 1.1.6
  • Alpine Linux: 3.13
  • Python: 3.8.15
    • whitenoise 3.3.1
    • django 2.2.28

In the next step I tried to install Graphite Web 1.1.10. This fails due to a wrong WhiteNoise configuration:

  • Graphite Web: 1.1.10
  • Alpine Linux: 3.13
  • Python: 3.8.15
    • whitenoise 4.1.4 (as requirements.txt wants it)
    • django 3.0.14
Your WhiteNoise configuration is incompatible with WhiteNoise v4.0
This can be fixed by following the upgrade instructions at:
http://whitenoise.evans.io/en/stable/changelog.html#v4-0

Due to i did not want to use an old Alpine Linux anyway, i decided to check what happens with the latest version. This is where the fun starts.

  • Graphite Web: 1.1.10
  • Alpine Linux: 3.17 (latest)
  • Python: 3.10.8
    • whitenoise 4.1.4
    • django 3.0.14

If I run the install using Python 3.10 (and ignoring all deprecation warnings pip3 prints) , I get the exact same error as with Python 3.8:

Your WhiteNoise configuration is incompatible with WhiteNoise v4.0
This can be fixed by following the upgrade instructions at:
http://whitenoise.evans.io/en/stable/changelog.html#v4-0

If i add the --use-pep517 option to the pip3 install command to resolve warinigs like this

  DEPRECATION: whitenoise is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451

I end up with this error message ModuleNotFoundError: No module named 'graphite.settings' and most of the Graphite related files are missing:

/ # ls -la /opt/graphite/
total 0
drwxr-xr-x    1 root     root            29 Dec  8 14:03 .
drwxr-xr-x    1 root     root            22 Dec  8 14:02 ..
drwxr-xr-x    1 root     root            25 Dec  8 14:03 conf
drwxr-xr-x    3 root     root            21 Dec  8 14:03 lib
drwxr-xr-x    1 root     root            22 Dec  8 14:02 webapp

For comparison the working installation using Graphite 1.1.6 and Python 3.8

/ # ls -la /opt/graphite/
total 4
drwxr-xr-x    1 root     root            20 Dec  8 11:55 .
drwxr-xr-x    1 root     root            22 Dec  8 11:55 ..
drwxr-xr-x    2 root     root          4096 Dec  8 11:55 bin
drwxr-xr-x    1 root     root            21 Dec  8 11:55 conf
drwxr-xr-x    3 root     root            80 Dec  8 11:55 examples
drwxr-xr-x    5 root     root            70 Dec  8 11:55 lib
drwxr-xr-x    7 root     root            69 Dec  8 11:55 storage
drwxr-xr-x    1 root     root            22 Dec  8 11:55 webapp
@nook24 nook24 added the question label Dec 8, 2022
@deniszh
Copy link
Member

deniszh commented Dec 8, 2022

If I run the install using Python 3.10 (and ignoring all deprecation warnings pip3 prints) , I get the exact same error as with Python 3.8:

That's strange. Whitenoise 4 was introduced in #2333 and I don't see how it can fall back to old behavior. Do you have changes from #2333 incorporated in your wsgi.py and app_settings.py ?

If i add the --use-pep517 option to the pip3 install command to resolve warinigs like this ... I end up with this error message ModuleNotFoundError: No module named 'graphite.settings' and most of the Graphite related files are missing

They are not missing but installed in different path. Prefix doesn't work well with new pip and virtualenv, not sure how to fix that yet. But that's different story from whitenoise issue, though

@nook24
Copy link
Contributor Author

nook24 commented Dec 9, 2022

That's strange. Whitenoise 4 was introduced in #2333 and I don't see how it can fall back to old behavior. Do you have changes from #2333 incorporated in your wsgi.py and app_settings.py ?

Thanks for pointing me into the right direction. I have patched my custom wsgi.py and now it is working like expacted with Graphite Web: 1.1.10, whitenoise 4.1.4 and Python 3.10.8
https://github.com/it-novum/graphing-docker/blob/769f5d523203a238073bbe65a5c90f5d5f58f53d/graphite-web/wsgi.py

They are not missing but installed in different path. Prefix doesn't work well with new pip and virtualenv, not sure how to fix that yet. But that's different story from whitenoise issue, though

Ah ok I see. So this is probably something that needs to be addressed by you / the Graphite developers itself? I saw this open PR
#2409 which has the goal to remove the /opt/graphite prefix at all.
But i think this should be part of a separate issue.

From my side, we could close this one down. Many thanks again for your fast help :)

@stale
Copy link

stale bot commented Mar 20, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 20, 2023
@nook24 nook24 closed this as completed Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants