ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
22.84k stars 556 forks source link

zoxide can't access it's datase (when exportet to server) #864

Open MartyMcFlyInTheSky opened 3 months ago

MartyMcFlyInTheSky commented 3 months ago

I'm using zoxide on my local laptop running ubuntu where it works like a charm. However, since I'm hopping to our production machines frequently I want to make use of zoxide there, so I'm cloning my dotfiles containing the zoxide binary to the servers in /tmp/dotfiles. Basically this becomes my new XDG_HOME. The zoxide binary lives in /tmp/dotfiles/.local/bin/ and since zoxide respects the XDG norm it correctly creates a database file in $XDG_DATA_HOME/zoxide which expands to /tmp/dotfiles/.local/share/zoxide . Everything looks fine so far.

However, I noticed that zoxide fails to read anything from the database. Using zi to access the list will always yield zoxide: no match found even though I should be inserting entries with z...

I checked permissions on the db file and they seem fine: -rw-r--r-- 1 process process 12 Aug 2 09:56 db.zo

So there's read and write permission for the process user which is the one I'm using. Still, one oddity is that on my local machine (Ubuntu), the permissions are:

-rw-rw-r-- 1 myuser myuser 2310 Aug 2 11:43 db.zo

So group has write permissions as well. Idk how important this is, I think write from user should do it?

In summary, zoxide has the right perception of where the file is (it creates it at the right spot at least). But then it doesn't retrieve the data correctly or save it. Again, locally everything works as expected.

We're running RHEL 9.2 on these servers.

MartyMcFlyInTheSky commented 1 month ago

Update: It now seems to work in some conditions. I haven't changed a thing. Still kinda confused why this appeared. I will test for another 1-2 weeks and then update the status of this ticket.