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

PermissionError: [Errno 13] Permission denied: '/boot/grub/grub.cfg' #84

Open
LeanderJDev opened this issue Dec 12, 2024 · 4 comments
Open

Comments

@LeanderJDev
Copy link

I'm running ubuntu 24.04 and am trying to install matter. But after installation when I just ran ./matter.py as is, I got a permission error

[I] [ Matter GRUB THEME ] [I] Argument -i required. Which icons go to which grub entries? [I] Your grub entries are: Traceback (most recent call last): File "/home/leanderj/.matter/./matter.py", line 874, in <module> do_preinstall_hint() File "/home/leanderj/.matter/./matter.py", line 518, in do_preinstall_hint do_list_grub_cfg_entries() File "/home/leanderj/.matter/./matter.py", line 567, in do_list_grub_cfg_entries with open(GRUB_CFG_PATH, "r", newline="") as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/boot/grub/grub.cfg'

running it with sudo it is able to detect all the grub entries correctly. But when I try to set icons with sudo, the permission don't get passed to inkscape (at least that's what I think is happening)

`
[I] Begin Matter install
[I] Build theme from user preferences
[I] Convert icons
Inkscape 1.3.1 (9b9bdc1480, 2023-11-25, custom)

mkdir: cannot create directory ‘/run/user/0’: Permission denied
Authorization required, but no authorization protocol specified

** (inkscape:115235): WARNING **: 18:54:02.700: Can't open file: /root/temp.svg (doesn't exist)

** (inkscape:115235): WARNING **: 18:54:02.700: Can't open file: /root/temp.svg (doesn't exist)
ink_file_open: '/root/temp.svg' cannot be opened!
InkscapeApplication::document_open: Failed to open: /root/temp.svg
ConcreteInkscapeApplication::on_open: failed to create document!
ConcreteInkscapeApplication::on_open: failed to create document!
ConcreteInkscapeApplication::on_open: failed to create document!
ConcreteInkscapeApplication::on_open: failed to create document!
ConcreteInkscapeApplication::on_open: failed to create document!
ConcreteInkscapeApplication::on_open: failed to create document!
[I] Build font

[I] Prepare installation directory
[I] Clean install directory
[I] Copy built theme to installation directory
[I] Patch /etc/default/grub with Matter Theme Overrides
[E] Invalid icon name: ubuntu
[E] Icons present are: []
`

All the instructions also don't have to use sudo, where am I going wrong?

@mateosss
Copy link
Owner

That's unexpected, you should be asked for sudo permissions while running the script.
Meanwhile, you can just run it as sudo and it should be the same.

@LeanderJDev
Copy link
Author

So I poked around a bit. There's the function check_root_or_prompt() to check for root access. But in do_preinstall_hint() it never gets called, this would explain why that get's a permission error.

But when I give the icons to the script it goes to do_install() which calls check_root_or_prompt() but only after prepare_source_dir() which needs access to grub.cfg for checking if the icon count matches the grub entry count.

Maybe this is also a problem with the permissions on my grub.cfg, but I would have thought that root access is needed to access grub.cfg?

@LeanderJDev
Copy link
Author

So the error happens in inkscape_convert_svg2png
There inkscape tries to save temp.svg at /root/temp.svg and fails because the file doesn't exist.

@LeanderJDev
Copy link
Author

I was actually able to solve the issue by just installing inkscape as a Debian package and not as a Snap package(and then running it with sudo). But the issue of do_preinstall_hint still persists (when running without sudo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants