Ibus-table error "Permission denied: '/home/username/.local'"
https://askubuntu.com/questions/1565169/ibus-table-error-permission-denied-home-username-local
I have set up Ubuntu on ZFS under LUKS as described here. However, I have used Ubuntu 24.04 instead of 22.10. This seems to work just fine, except for one thing: Directly after installation, on the first login, I get a "Ubuntu 24.04 has experienced an internal error" dialog box:
Ubuntu 24.04 has experienced an internal error
Excetutable Path: /usr/share/ibus-table/engine/main.py
Title: main.py crashed with PermissionEror in _init(): [Errno 13] Permission denied: '/home/username/.local'
Traceback:
Traceback (most recent call last):
File "/usr/share/ibus-table/engine/main.py", line 37, in <module> import tabsolitedb
File "/usr/share/ibus-table/engine/tabsqlitedb.py", line 43, in <module> import ibus table_location
File "/usr/share/ibus-table/engine/ibus_table_location.py", line 108, in <module>
__module_init =_Modulelnitializer()
٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨٨
File "/usr/share/ibus-table/engine/ibus_table_location.py", line 103, in _init_ _init()
File "/usr/share/ibus-table/engine/ibus_table_location.py", line 79, in _init
os.makedirs(IBUS_TABLE_LOCATION['data_home'], exist_ok=True)
File "<frozen os>", line 215, in makedirs
File "<frozen os>", line 215, in makedirs
File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/home/username/.local'
ProcEnviron:
LANG=de_DE.UTF-8
LANGUAGE=de_DE
PATH=(custom, no user)
SHELL=/bin/bash
XDG_RUNTIME_DIR=<set>
There may be typos in the traceback because I had to copy it from a screenshot. Note that username is the literal string username and not something I substituted for my actual username. If this is python, I would expect it to contain the actual path. Of course, there is no user named "username" on my PC. (Maybe there is some substituion of the exception message going on, but I think that's unlikely. perhaps for anonymization purposes?)
Edit 4: The syslog shows the correct user name instead of "username". So this is not a path resolution issue.
This error keeps appearing and does not disappear after a reboot. The error persistently appears and after clicking the window away, it just re-appears, often several times. I have checked the permissions on my home directory and it is 755, owned by me and my group. Strangely, after some time and some reboots this error seems to disappear. I am not sure if this actually solves it.
I think on a previous installation I created a fake home directory for "username" with 777 permissions, but I do not think this solved the issue., but this does not solve the issue. Nothing happens inside /home/username.
What is the actual way to fix this?
Edit 1
Here is the output of printenv | grep XDG_:
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_SESSION_CLASS=user
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
Edit 2
It seems there is a second variation of this error, where the permission denied occurs for /home/username and not for /home/username/.local.
I also added ProcEnviron to the error message above. It seems XDG_RUNTIME_DIR is "set". I don't know to what it is set though or how to figure this out.
Edit 3
I tried adding debug syslog output into /usr/share/ibus-table/engine/ibus_table_location.py right before the exception occurs at line 79. However, it seems that these changes do not affect anything. I even removed the __pycache__ directory in /usr/share/ibus-table/engine. The line number where the exception occured should have moved, but it did not. Also, there is no syslog output.