I have been having terrible permission issues I could not fix with chmod or running an application in sudo. I have had several instances where I'm trying to access files from an application and the permission is denied. The file I'm editing within the application I had saved in my home folder, but its true location is somewhere else with elevated privileges. Then when I try to open the file in my browser it also has permission issues and denies it. I tried installing the applications without flatpak or snap and still the same issues. Why I'm I not prompted for a password when it comes to applications accessing files.
I basically had to resort to making a seperate sudo account to get anything to work right after hours of troubleshooting.
What application / applications are you doing that causes this behaviour to manifest itself? And by true location, what do you mean by that? If a file gets saved to home, that's where it realistically should be, unless I'm misunderstanding that.
If you can give paths as to the files you're having issues with, we can see what might be causing this. A path to where you saved it and a path to this "true" location should help in figuring out what's happening here.
It was vscode and chromium broswer. In vscode I saved the files to home/code and while being represented there could not be accessed by chromium. When checking the properties it says the file location is in a root folder. I thought this might be a flatpak or snap virtualization thing so I tried reinstalling with .deb with sudo but it also saved files this way. When I tried going into that folder and changing the file permissions it said access denied parent folder has elevated permissions. But this is in root so ofcourse that's the case.
Chromium couldn't access the files. I tried elevating permissions of the file location with chmod and running apps in sudo and still nothing. I was troubleshooting with chatgpt for an entire day and nothing worked. It finally told me to make a sudo account and that worked.
It can't be that changing a root folders permissions is safe. Making a custom sudo account can't be safe either. This issue has me super frustrated even though I got around it.
Cold you send an image of the file properties if at all? That should show the path that the file is located. Because if you've saved to ~/home/code, that should have permissions, but i'm wondering if that's what the case is or if something else has happened (since originally, from my understanding, you had the application installed as a flatpak/snap?)
It says the file location is in home in file explorer but when I open the file it opens in /run/user/1000. When I reference js files they don't open. Nothing i reference can function normally.
This is in the default account not the sudo one I made via terminal. That one has no issues.
Just regular flatpak and snap installs through the default software app. I tried everything without sudo first and then tried installing with sudo privileges and still had issues.
In your previous screenshot, the $HOME/code location shows there are a lot of files and folders, but now from the terminal there are only two. Can you compare this side by side (open the file manager on that location, and then on the side run the same command again showing the contents of it)? Again, before opening any other programs.
You also cut off the output from the last command. I'm actually not interested in the Snap volumes, but any external drives you may have. You can narrow down the results with:
I use VSCodium flatpak and default browser Firefox as whatever it was and I never have this problem either.
Anyhoo, latest stable is 1.94 - looks like Snap version in the store is latest stable, Flatpak is showing 1.93.1, no idea what .deb is but you can try updating.
I think I had several vscode extensions that wouldn't work properly due to permissions (with no way to give each permissions). So I may have tried a sudo flatpak reinstall. But then I uninstalled and no matter what vscode would keep saving files in home/code but all my browsers would open them in run/user/1000 location.
I would start by removing VSCode and your Chromium browser entirely, making sure that you also delete any files it leaves behind like cache, workspaces, etc. Obviously, backup anything that's important. Then, reinstall it using the native .deb format.
At the very least, if you really prefer Flatpak, use Flatseal to grant permissions where needed, instead of using sudo. That's just a terrible suggestion on ChatGPT's part, and one of the reasons is a horrible tool for troubleshooting.
As for opening .html files specifically, it would be better to use a web server to handle this. Use an extension like Live Server on VSCode. If you are still having trouble, try using Python's built-in server (Python comes by default on most Linux distributions):