[SOLVED]Certain apps can't determine location of home folder

origamisith

New Member
Joined
Aug 5, 2020
Messages
14
Reaction score
4
Credits
147
I am sorry if this question is vague, but ever since I've installed Arch and i3 on my laptop, there have been persistently annoying bugs related to apps not being able to create, edit, or access folders in my home directory that they need to function. For example, I had to manually specify my i3 config file even though it was in the correct location. IntelliJ Idea wouldn't detect java correctly until I edited an obscure config file such that it used an absolute path instead of "$HOME/myUser/...". I can't run LibreOffice because it can't find my home directory. Picom needs handholding to find its config file, even though it is in the correct location. Again, I need to emphasize: these applications have the right to access my home folder. They just can't find it. Sometimes this can be worked around, but often it can't. Has anyone else experienced this, or have any suggestions?
 


For example, I had to manually specify my i3 config file even though it was in the correct location. IntelliJ Idea wouldn't detect java correctly until I edited an obscure config file such that it used an absolute path instead of "$HOME/myUser/...". I can't run LibreOffice because it can't find my home directory. Picom needs handholding to find its config file, even though it is in the correct location.
So it's only with the applications you mention or with all applications? What do you mean with you had to manually specify your i3 config file? How do you start i3? What happens when you open Libreoffice, do you get an error or something else? Java in home? If you install JRE from the repos it doesn't install it in home but in /usr/lib/jvm/jre-java-?-openjdk. What shell are you using?
 
I've got a question for after you're done with @f33dm3bits's questions.

What is the output of 'echo $HOME' in your terminal? Is it the proper directory?

Make that two questions. Which 'obscure config file' did you edit?
 
And the output of running: env
 
So it's only with the applications you mention or with all applications? What do you mean with you had to manually specify your i3 config file? How do you start i3? What happens when you open Libreoffice, do you get an error or something else? Java in home? If you install JRE from the repos it doesn't install it in home but in /usr/lib/jvm/jre-java-?-openjdk. What shell are you using?
I am using the Bash shell. The value of $HOME is /home/myUser, as it should be. Here is my env.
I'll provide more detail for the anecdotes I mentioned.
For i3 to pick up my config file, in my ~/.xinitrc I have to specify
Code:
i3 -c ~/.config/i3/config
It should be using the config file in this location automatically. If I don't specify the path explicitly, it will not use my config file.

For Picom to pick up my config file, in my ~/.xinitrc I have to specify
Code:
picom --config ~/.config/picom/picom.conf
rather than it using this file automatically.

The same is true for my ~/.config/polybar/launch.sh, where I have use a flag to explicitly state that I want to use /home/myUser/.config/polybar/config.

To get IntelliJ Idea to detect my JDK, at first I fixed the problem by editing the file at /opt/intellij-idea-ultimate-edition/bin/idea.properties and setting a custom paths for the config and system folders so that they would use "/home/myUser" rather than "${user.home}". Here is what that looks like: https://pastebin.com/1Wqs3jNP. I uncommented lines 8 and 13, and then replaced ${user.home} with /home/myUser. Later, I found that IntellIJ had an built-in option to directly edit a user-specific version of this file located at /home/myUser/.config/JetBrains/IntelliJIdea2020.3/idea.properties. This persists better across updates.
I have 5 versions of the JDK installed (from my desperate attempts to fix the problem), and they are all picked up when I run
Code:
archlinux-java status
They all live in /usr/lib/jvm, as they should.

When I attempt to run LibreOffice, an issue occurs similar to what happens here, which is why I suspect it is related to my home folder. The output of running "libreoffice" is
Code:
javaldx failed!
Warning: failed to read path from javaldx
terminate called after throwing an instance of 'com::sun::star::lang::WrappedTargetRuntimeException'
Application Error
 
Last edited:
I don't have any bright ideas right now, but here's something to try. Create another user copy your configurations files(i3, picom etc) to that user. Then try to load i3, picom and polybar the normal way from xinit, as well as seeing if Libreoffice launches without errors from that user. If that user doesn't have any problems and everything works as expected than the problem is with your original user and if it doesn't then the problem is not the user but somewhere else. If your configurations works as expected on that test user you can either backup your original user's configurations, delete the user and recreate it and then see if it works as expected again or can you try and figure out what the problem is with your current user. I would just pick the easy route if it's only a problem with your current user, if the same problem also occurs with your test user than then we'll have to start looking else.
 
You might try putting your $HOME at the beginning of the value for your $PATH var.
 
Finally got around to testing your ideas. Unfortunately, the new user I made had all the same issues. Putting $HOME at the beginning of my $PATH variable also didn't help.
 
If it were me I'd do the following:
- verify the name of your home directory (I know, stupid; it can't be that simple; I'm looking at it right now and it's correct) just check that your home dir is named exactly what you think it's named (including case).
- check .bashrc for $HOME and $PATH entries and verify
- is your /home in a weird place; on a different physical drive or anything like that?
- how does, say, Libreoffice know to check your home dir? That is, what's the difference between the way these apps are trying to find your home dir and if you, for instance, wrote a python script that accessed your home dir (via $HOME or $PATH) from a remote directory. Does your script work?

My thinking is that there's either some type of logical configuration problem here, or some type of physical configuration or problem. I think the trick to solving this is going to be peeling the onion to eventually isolate what it is.

I don't mean to sound horribley obvious..... :cool:

keith
 
Well, it ended up being /etc/environment (which I did not know the existence of) using $HOME where it wasn't defined, so all uses of the variable XDG_CONFIG_PATH lead to creating a brand new '$HOME'/.config whenever an application wanted to store a config file. There were almost 90 '$HOME'/.config directories in my system. The fine folks at the Arch forums helped me figure this one out https://bbs.archlinux.org/viewtopic.php?id=266709
 
Glad it worked out for you @origamisith :), and thanks for coming back and giving us the closure and sharing that link.

And yes, the folks at Arch are fine folks. The Arch Wiki is a good source for all sorts of problems, and many of them can be translated to work in non-Arch distros as well.

I'm just going to modify that Title edit from "closed" to "solved", it fits in better here.

Friday in Oz, stay safe all and

Avagudweegend

Wizard
 

Members online


Latest posts

Top