Cannot Create Files or Directories in the Home Directory on Debian

Permission denied in the home directory, caused by tracker-miner

* This page contains promotional content

After logging in to a certain Linux (Debian) machine, I ran into a symptom where I could not create files or directories.

$ mkdir test
mkdir: ディレクトリ `test' を作成できません: 許可がありません
$ touch test
touch: 'test' に touch できません: 許可がありません

I tried various things

  • Logging in works normally
  • Checked the UID and GID with the id command
  • Checked the attributes of the home directory and its contents
  • Tried changing the shell

None of them showed a problem, and when I looked at the error log, there was an error like the one below

Mar 28 10:12:14 ibm tracker-miner-f[3060490]: Unable to get XDG user directory path for special directory &VIDEOS. Ignoring this location.
Mar 28 10:12:14 ibm tracker-miner-f[3060490]: Couldn't create new Files miner: 'Failed to load SPARQL backend: tracker data directory does not exist and could not be created: 許可がありません'

What is tracker-miner?
It appears to be some kind of GNOME tool, but this is a CLI environment so I am not using it, am I??

Anyway, I looked for a way to deal with it

$ tracker reset --hard
CAUTION: This process may irreversibly delete data.
Although most content indexed by Tracker can be safely reindexed, it can’t be assured that this is the case for all data. Be aware that you may be incurring in a data loss situation, proceed at your own risk.

Are you sure you want to proceed? [y|N]: y
Found 0 PIDs…
_g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
Setting database locations
Checking database directories exist
Checking database version
Checking whether database files exist
Removing all database/storage files
  Removing database:'/home/washo/.cache/tracker/meta.db'
  Removing db-locale file:'/home/washo/.cache/tracker/db-locale.txt'
Segmentation fault

That alone did not fix it, so I also tried the following

sudo apt remove --purge tracker tracker-extract tracker-miner-fs
rm -r ~/.cache/tracker
sudo apt install tracker tracker-extract tracker-miner-fs

After rebooting with this, it went back to normal.

Ah, maybe I should have tried rebooting first, before working on a fix :P

Update:
It happened again even after the work above, so since this is a CUI environment I removed tracker and the GNOME-related packages (if you use X-Windows such as GNOME, please be careful)

See also