-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
OctoPrint requires parent folder permissions to restore from backup #4961
Comments
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 There's no I don't use the octoprint image, rather I install the software myself. Otherwise it works great! |
- There are some issues when running octoprint in a different directory thatn home. - see: OctoPrint/OctoPrint#4961 - Some updates for installing kiwix software.
Sounds good, would have been my solution as well. |
I stand corrected, that's not an option. The thing is, right now we are doing two pretty atomic move options. We are basically moving the old config dir out of the way (backing it up in the process) and then put the new one back where it was. If we switch that to emptying the current config folder and then copying (or moving) over individual files from the backup, there's WAY more that can go wrong in the process, at which point the user would be left with a complete mess vs a situation where they just have to rename the created That's too risky. We need an easy way to roll back, and an atomic as possible restore. What I could see working is not moving the directory, but rather zipping it up in itself, then in the next step copy over the backup, and if anything goes wrong in that process, delete everything again apart from the backup zip, and unzipping that again in place before removing it. However, that are still a lot of moving parts that are only ever needed in a setup as mentioned here, which is not the default. So switching everyone over to that would mean everyone who doesn't even need that amount of complexity gets a higher risk of restore failure in exchange, which strikes me as unfair. Supporting both options in parallel could be done (check if the base dir can be moved, if that fails it's apparently not owned by the process, at which point you move over to the other approach), but I'm not sure I want to maintain two process variants. I'll have to mull that over for a bit, and see how bad it really could be if I went that route... |
Ok, that wasn't as bad as I thought. If the initial rename of the basedir to the Will be part of 1.11.0. |
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: