paukstelis / octoprint_deploy

Bash script for rapid deployment of multiple octoprint instance on a single machine
MIT License
416 stars 40 forks source link

instance creation permission error #71

Open grantcoultrup opened 1 year ago

grantcoultrup commented 1 year ago

Hi, I am encountering an error creating the first instance.

It looks like error code 13: PermissionError: [Errno 13] Permission denied: '/home/ampelOctopi1//.e3s1plus/config.yaml'

Even though this error is received, it looks like the instance was still created (for example, I can "delete instance" and this instance is available to be deleted. Same for the associated USB camera.

When running Utility > Instance Status, I see that the instance failed.

Any known fix? Thanks!

Screenshot 2023-03-14 110614

paukstelis commented 1 year ago

Can you verify that you have a config.yaml file in ~/.octoprint? You could do this with: ls ~/.octoprint/config.yaml

paukstelis commented 1 year ago

Further, you could verify the permissions in that directory: ls -la ~/.octoprint

grantcoultrup commented 1 year ago

Can you verify that you have a config.yaml file in ~/.octoprint? You could do this with: ls ~/.octoprint/config.yaml

yep I've got config.yaml file.

Screenshot 2023-03-14 at 11 25 54 AM
paukstelis commented 1 year ago

If you create a new instance, does that new directory also contain the config.yaml? ls -la ~/.e3s1plus in your example

grantcoultrup commented 1 year ago

If you create a new instance, does that new directory also contain the config.yaml? ls -la ~/.e3s1plus in your example

it doesn't look like it... just in the root directory.

Screenshot 2023-03-14 at 11 32 58 AM
paukstelis commented 1 year ago

The problem is that the config.yaml file is owned be root. It is not clear why that happened, as the script just copies everything from .octoprint (which doesn't have those permissions).

grantcoultrup commented 1 year ago

The problem is that the config.yaml file is owned be root. It is not clear why that happened, as the script just copies everything from .octoprint (which doesn't have those permissions).

got it... I'm not 100% proficient so this may be a dumb question... can I duplicate the .yaml file and then copy it to the instance directory? If so could you share some direct for that process?

paukstelis commented 1 year ago

Doing a little searching it seems that there is a sed command in the script that can lead to random permission changes on some systems. It is not something I have observed before. I think there is fairly simple fix. I will implement in a new branch and have you test that out. Will get back shortly.

paukstelis commented 1 year ago

Do the following: git -C octoprint_deploy pull git -C octoprint_deploy checkout permission run script: sudo octoprint_deploy/octoprint_deploy.sh delete the instance, then remake it

grantcoultrup commented 1 year ago

Hm, still having issue... see image

Screenshot 2023-03-14 at 12 22 06 PM
paukstelis commented 1 year ago

A different issue, however.

sudo systemctl status instancename

On Tue, Mar 14, 2023, 3:23 PM grantcoultrup @.***> wrote:

Hm, still having issue... see image [image: Screenshot 2023-03-14 at 12 22 06 PM] https://user-images.githubusercontent.com/71242310/225114751-5451721a-a5a0-45c3-9d47-a71fba58e5c6.png

— Reply to this email directly, view it on GitHub https://github.com/paukstelis/octoprint_deploy/issues/71#issuecomment-1468697412, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGYDYRSHOCJNXJMFNM2MGXLW4DARRANCNFSM6AAAAAAV2ZLK4E . You are receiving this because you commented.Message ID: @.***>

grantcoultrup commented 1 year ago

A different issue, however. sudo systemctl status instancename

Still only seeing config.

Screenshot 2023-03-14 at 12 43 13 PM

yaml file in the root directory

paukstelis commented 1 year ago

Sorry, ended up in a meeting. You need to give your instance name: sudo sytemctl status e3s1plus

paukstelis commented 1 year ago

see what error you get from the status command. Then try changing file ownership and restarting the instance: sudo chown ampelOctopi1 ~/.e3s1plus/config.yaml; sudo chgrp ampelOctopi1 ~/.e3s1plus/config.yaml sudo systemctl restart e3s1plus