-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
manage.py maintenance_mode on/off
changes permissions of state file
#172
Comments
Note that we can fix this by manually running |
@amstilp thank you for reporting this. Yes, much probably the issue has been introduced by #162. This is the function that writes the file atomically and that should also set the right permissions: If you can figure out where the problem is in the function above that would be great, alternatively I'll debug as soon as I can. |
Thanks for looking into it! Yeah, I see what you're saying -
I'm happy to try it in a pull request and see if it works on our servers. |
@amstilp could you try to install |
That fixed it! Thanks for the quick update! |
@amstilp good news, thanks for the feedback! I'm going to publish a patch release. |
@amstilp fixed in |
This update fixes a bug where the permissions of the maintenance mode state file are not properly maintained (due to the implementation in python-fsutil). v0.21.1 of django maintenance mode requires the version of python-fsutil where this bug is fixed. See fabiocaccamo/django-maintenance-mode#172 for info.
This update fixes a bug where the permissions of the maintenance mode state file are not properly maintained (due to the implementation in python-fsutil). v0.21.1 of django maintenance mode requires the version of python-fsutil where this bug is fixed. See fabiocaccamo/django-maintenance-mode#172 for info.
This update fixes a bug where the permissions of the maintenance mode state file are not properly maintained (due to the implementation in python-fsutil). v0.21.1 of django maintenance mode requires the version of python-fsutil where this bug is fixed. See fabiocaccamo/django-maintenance-mode#172 for info.
Awesome, thanks. I've updated to the new version! |
I ran into related issues when intially running I was also running into a problem where permission was being denied to create a |
@TurtleCode84 when the state file is created, it has some "default" permissions, only in subsequent overwrites the state file inherits permissions from the existing state file. Some improvements that could be done by this package are:
@amstilp @reitermarkus what do you think about this? |
Either of those options makes sense to me. I'm not sure it's worth having a setting for the permissions, since you can pretty easily change them as a one-time step and then they will remain going forward. |
@amstilp I agree, thinking about it, it doesn't make much sense to give the possibility to decide the permissions, but it makes more sense to inherit the permissions from the directory. |
Python version
3.8.10
Django version
4.2.8
Package version
0.21.1
Current behavior (bug description)
After running
python manage.py maintenance_mode on
orpython manage.py maintenance_mode off
, the permissions of theconfig/settings/maintenance_mode_state.txt
file are changed from-rw-r--r--
to-rw-------
. With our setup, the maintenance mode file cannot be ready by apache and causes our site to throw server/500 errors when trying to load it.This is new behavior, I think introduced by #162.
Expected behavior
The permissions of the
maintenance_mode_state.txt
file remain the same when runningpython manage.py maintenance_mode on/off
.Upvote & Fund
The text was updated successfully, but these errors were encountered: