Access Denied when I run 'rustup doc'
Asked Answered
B

6

7

When I run rustup doc --book I get this:

Access to the file was denied.

The file at file:///home/ken/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/index.html is not readable. It may have been removed, moved or file permissions may be preventing access.

I've reinstalled, I've tried using chmod -R 777 on the directory. What else is there to try? The files are there.

Brianna answered 3/5, 2019 at 0:48 Comment(6)
Check with getfacl on the file and all parent folders. Check if xdg-open file:///home/ken/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/index.html works.Theirs
xdg_open results in the same access denied in browser. getfacl output indicates that the folders are owned by my user, and my username is under "group" as well as owner.Brianna
Can you try xdg-open with some other HTML file on your system? And can you try xdg-mime query default text/html?Theirs
default is firefox, xdg-open works fine with other HTML filesBrianna
I'm a bit lost there. Last idea, can you try xdg-mime query filetype index.html and xdg-mime query default $(xdg-mime query filetype index.html)?Theirs
first returns: text/html, the second: firefox_firefox.desktop. again these are not on files in the Rust book dir. I had installed Rust via apt and then uninstalled, then reinstalled with the .sh script on the website. Baffling problemBrianna
A
4

As mentioned by C F M G, if you use a browser installed with Snap then it will not work. I tried this with the Firefox snap and got the same message as you, but was able to access the docs when using Ungoogled Chromium installed from Flatpak.

Autoerotism answered 22/7, 2022 at 14:56 Comment(1)
Works on Edge 107.0.1418.35 installed from official microsoft web site.Shawanda
D
3

Check if you are using a browser on snap; in this case apparmor restricts access to local files. you can fix this by replacing the snap version.

Derrek answered 24/10, 2021 at 17:53 Comment(0)
C
1

What browser do you use?. I use Brave and the same error occured to me. I solved it changing the default browser to Chromium. After that, all work perfectly.

Coordination answered 2/3, 2020 at 0:40 Comment(0)
W
1

Try changing your browser. It didn't work for me with Chromium but Firefox works like a charm

Westsouthwest answered 2/4, 2021 at 23:53 Comment(0)
E
1

Couldn't open the Rust Document,the reason is chrom/firefix installed by snap!!!

Elvaelvah answered 27/1, 2023 at 14:3 Comment(0)
A
0

It's because your browser is installed via snap.

You can either change your default browser, or reinstall it outside of snap, or just run a local web server in the documents folders.

cd into $HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html
run python3 -m http.server or php -S 127.0.0.1:8000

Source: https://github.com/rust-lang/rust/issues/61796#issuecomment-1261282044

Ancilla answered 18/6 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.