You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have my octoprint root directory at /etc/octoprint. Restoring from a backup fails because the octoprint user doesn't have permission to create files in /etc which is expected behavior:
Uploading backup, this can take a while. Please wait...
Restoring from backup...
Unpacking backup to /tmp/tmplba213wr...
Unpacked
Renaming /etc/octoprint to /etc/octoprint.bck...
Removing temporary unpacked folder
Error while running restore
Traceback (most recent call last):
File "/usr/lib/python3.11/shutil.py", line 825, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/etc/octoprint' -> '/etc/octoprint.bck'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/octoprint/plugins/backup/__init__.py", line 1323, in _restore_backup
shutil.move(basedir, basedir_backup)
File "/usr/lib/python3.11/shutil.py", line 841, in move
copytree(src, real_dst, copy_function=copy_function,
File "/usr/lib/python3.11/shutil.py", line 561, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/shutil.py", line 459, in _copytree
os.makedirs(dst, exist_ok=dirs_exist_ok)
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/etc/octoprint.bck'
Restore failed! Check the above output and octoprint.log for reasons as to why.
Removing temporary zip
This following can and should always fail because octoprint should never get write permissions to the parent directory:
Default behavior of OctoPrint sets the basedir parameters to /home/pi/.octoprint/ and the files are installed in /home/pi/OctoPrint/ following official documentation. If you want to put the install files elsewhere you need to make adjustments to the service files to run OctoPrint as root, which is not a recommended approach for obvious security reasons. I question why you installed into etc though?
Thank you for the response @jneilliii . I run octoprint as a service on my raspberry pi along with a lot of other services. I believe it's common for linux services to keep their configuration files under /etc/ (such as /etc/nginx, /etc/apache, etc).
There's no octoprint home directory or user on my system for security reasons.
I don't use the octoprint image, rather I install the software myself. Otherwise it works great!
stephen-mw
added a commit
to stephen-mw/raspberrypi
that referenced
this issue
Feb 27, 2024
- There are some issues when running octoprint in a different directory thatn home.
- see: OctoPrint/OctoPrint#4961
- Some updates for installing kiwix software.
The problem
I have my octoprint root directory at
/etc/octoprint
. Restoring from a backup fails because the octoprint user doesn't have permission to create files in/etc
which is expected behavior:This following can and should always fail because octoprint should never get write permissions to the parent directory:
One workaround is to put octoprint in a subdirectory where it can have parent permissions such as
/etc/octoprint/octoprint
.That has the following drawbacks:
I'd like to propose the following fix:
Thoughts on these changes? I can start working on it.
Did the issue persist even in safe mode?
Yes, it did persist
If you could not test in safe mode, please state why ("currently printing" is NOT an excuse!)
No response
Version of OctoPrint
octoprint, version 1.9.3
Operating system running OctoPrint
Debian GNU/Linux 12 (bookworm) (rasberry pi 4)
Printer model & used firmware incl. version
No response
Browser and version of browser, operating system running browser
No response
Checklist of files to include below
Additional information & file uploads
octoprint-systeminfo-20240225162317.zip
The text was updated successfully, but these errors were encountered: