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

sphinx-version-warning might require write permissions in /usr/local/lib #22

Open
aanm opened this issue Nov 5, 2018 · 11 comments
Open
Labels
bug Something isn't working

Comments

@aanm
Copy link
Contributor

aanm commented Nov 5, 2018

Exception occurred:
  File "/usr/local/lib/python3.6/site-packages/versionwarning/signals.py", line 66, in generate_versionwarning_data_json
    os.mkdir(data_path)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/site-packages/versionwarning/_static/data'

@humitos let me know if you need more info

@humitos
Copy link
Owner

humitos commented Nov 5, 2018

Yes. Please.

How are you installing it?
How are you executing it?
Is that local or at read the docs?

@aanm
Copy link
Contributor Author

aanm commented Nov 5, 2018

@humitos in a container.

If you want, the "easiest" way to replicate it is to do:

$ git clone --single-branch -b pr/add-warning-in-docs https://github.com/cilium/cilium.git
$ cd cilium
$ git reset --hard HEAD~1
$ make render-docs

you will see something like:

docker container run --rm -ti -u $(id -u):$(id -g aanm) -v $(pwd):/srv/ cilium/docs-builder /bin/bash -c 'make html'
! (sphinx-build -b spelling -d "_build/doctrees" "." "_build/spelling" -q -E  && touch check-build.ok) \
        | grep -v -e "tabs assets" -e "misspelled words"
/usr/local/lib/python3.6/site-packages/sphinx/application.py:402: RemovedInSphinx20Warning: app.info() is now deprecated. Use sphinx.util.logging instead.
  RemovedInSphinx20Warning)

Exception occurred:
  File "/usr/local/lib/python3.6/site-packages/versionwarning/signals.py", line 66, in generate_versionwarning_data_json
    os.mkdir(data_path)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/site-packages/versionwarning/_static/data'
The full traceback has been saved in /tmp/sphinx-err-5wajn1p1.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:56: check-build] Error 1
make: *** [Makefile:279: render-docs] Error 2

make render-docs will create a image with the dependencies already installed, after that it will run 'make html inside that container as a non-root user. That's where it fails.

@humitos
Copy link
Owner

humitos commented Nov 5, 2018

I know the issue. I'll fix it this week. Thanks for the report

@humitos humitos added the bug Something isn't working label Nov 8, 2018
@aanm
Copy link
Contributor Author

aanm commented Jan 3, 2019

@humitos any updates ?

@humitos
Copy link
Owner

humitos commented Jan 3, 2019

Hi! I had no time to take a look at this yet 😞. I'm sorry.

@humitos
Copy link
Owner

humitos commented Jan 3, 2019

In case you want to play a little with this, the problem is at this line

https://github.com/humitos/sphinx-version-warning/blob/master/versionwarning/signals.py#L7

That path should be something writable by the user without root permissions. Currently, it's based on the signals.py file but it should probably based on the directory of where the user is executing the command.

@humitos
Copy link
Owner

humitos commented Jan 3, 2019

In case you want to play a little with this,

... and propose a PR ;)

@pgajdos
Copy link

pgajdos commented Mar 27, 2019

This happens to me too while building python-marshmallow (as non-root user).

@humitos
Copy link
Owner

humitos commented Mar 28, 2019

@pgajdos how are you installing the extension? are you also using docker? are you building under Read the Docs?

@pgajdos
Copy link

pgajdos commented Apr 1, 2019

I am installing it in minimal change root (automated build of python-marshmallow).
Here is the log.

@pgajdos
Copy link

pgajdos commented Apr 1, 2019

(If I should perform some tests on the change root, let me know.)

qmonnet added a commit to qmonnet/cilium that referenced this issue Apr 8, 2022
Update the version of the base image used for the docs-builder image.

A few packages have changed name and need to be updated. The path for
the workaround in the add-on for printing a warning banner on older
versions of the documentation also needs an update (alas, the related
issue humitos/sphinx-version-warning#22 is
still not solved).

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
nbusseneau pushed a commit to cilium/cilium that referenced this issue Apr 12, 2022
Update the version of the base image used for the docs-builder image.

A few packages have changed name and need to be updated. The path for
the workaround in the add-on for printing a warning banner on older
versions of the documentation also needs an update (alas, the related
issue humitos/sphinx-version-warning#22 is
still not solved).

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
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
Development

No branches or pull requests

3 participants