Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with autojump database, trying to recover from backup. #23

Closed
jostber opened this issue Oct 22, 2010 · 17 comments
Closed

Problem with autojump database, trying to recover from backup. #23

jostber opened this issue Oct 22, 2010 · 17 comments

Comments

@jostber
Copy link
Contributor

jostber commented Oct 22, 2010

It seems like this occurs everytime I want to use autojump after reboot:

j te
Problem with autojump database, trying to recover from backup...
Traceback (most recent call last):
File "/usr/bin/autojump", line 132, in
path_dict=open_dic(dic_file)
File "/usr/bin/autojump", line 117, in open_dic
shutil.copy(dic_file+".bak",dic_file)
File "/usr/lib/python2.6/shutil.py", line 88, in copy
copyfile(src, dst)
File "/usr/lib/python2.6/shutil.py", line 53, in copyfile
fdst = open(dst, 'wb')
IOError: [Errno 13] Permission denied: '/home/jostein/.local/share/autojump/autojump_py'

The output of "ls -l":
~/.local/share/autojump> ls -l
total 8
-rw------- 1 root root 1164 2010-10-22 18:13 autojump_py
-rw------- 1 jostein users 46 2010-10-21 19:28 autojump_py.bak

@joelthelion
Copy link
Collaborator

Hi jostein,

Do you have the latest version? I used to have a similar problem, but I thought I have fixed it in a recent commit.

@jostber
Copy link
Contributor Author

jostber commented Oct 27, 2010

I tried the latest git version today, but the same error occurs. If I try to reset the the permissions manually to "jostein, users" it is immediately reset to "root, root".

@jostber
Copy link
Contributor Author

jostber commented Oct 27, 2010

Seems like I closed this, but this issue is still open.

@joelthelion
Copy link
Collaborator

Hi!

I'm sorry this is still an issue for you. I'll try to investigate, but it will be a bit difficult since I haven't had the problem myself for a while.

In the meantime, could you send me all the information that seems relevant to you? Examples: content of the $PROMPT_COMMAND variable, permissions and ownership on the folder and all the files in ~/.local/share/autojump, content of autojump_errors, shell you're using, ...

@jostber
Copy link
Contributor Author

jostber commented Oct 27, 2010

Here it is:

A. Output of $PROMPT_COMMAND

: ; { (autojump -a "$(pwd -P)"&)>/dev/null 2>>${AUTOJUMP_DATA_DIR}/.autojump_errors;} 2>/dev/null

B. Permisssions and ownership folder

drwxr-xr-x 2 jostein users 4096 2010-10-27 06:06 autojump

C. Files in autojump folder

~/.local/share/autojump> ls -l
total 8
-rw------- 1 root root 1445 2010-10-27 06:06 autojump_py

-rw------- 1 jostein users 1190 2010-10-27 05:05 autojump_py.bak

D. Content of autojump errors

This is always the same as I posted in my first post. Autojump worked fine for a while, and then I started getting this error.

E. echo $SHELL
/bin/bash

@joelthelion
Copy link
Collaborator

Some more questions: do you often work as root? What do you use? su? sudo? Do you remember what you were doing (especially as root) when the problem appeared?

@jostber
Copy link
Contributor Author

jostber commented Oct 28, 2010

I work as root only when needed to do system configs. I have now downloaded the latest git version, removed the ~/.local/share/autojump directory and reinstalled autojump. The permissions for the directory seems right now. I will check what happens again after reboot.

@joelthelion
Copy link
Collaborator

Thanks a lot for your help!

@jostber
Copy link
Contributor Author

jostber commented Oct 28, 2010

It seems like the file ~/.local/share/autojump_py gets its permissions changed to "root, root" as soon as I log in as root with su. After that the error start occuring. I have also tried "su -m" and "su -", but that seemed not to make any difference.

For some reason root seems to affect the autojump_py file and changes its permissions just by logging in to the root user.

@jostber
Copy link
Contributor Author

jostber commented Oct 28, 2010

Actually "su -" seems to work differently, and does not affect the permissions on the discussed file.

@joelthelion
Copy link
Collaborator

Great news: thanks to your explanations, I've finally been able to reproduce the problem. I'll try to work on a fix this week end.

@jostber
Copy link
Contributor Author

jostber commented Oct 29, 2010

Thanks! I use an alias from su to "su -" for my bash shell now so it works fine.

@joelthelion
Copy link
Collaborator

I've just pushed a fix for this problem, can you tell me if you still have the problem with "su"?

@jostber
Copy link
Contributor Author

jostber commented Nov 3, 2010

Autojump works correctly with "su" now if I don't cd outside the home directory when root. If I f.ex. cd to the root directory the same error occurs after "su username".

@joelthelion
Copy link
Collaborator

Huh, weird, I don't have the same problem.

Did you unset the PROMPT_COMMAND (or reboot) since upgrading?

@jostber
Copy link
Contributor Author

jostber commented Nov 4, 2010

"unset PROMPT_COMMAND" in .bashrc seemed to solve the problem. Everything works fine now. Thanks!

@joelthelion
Copy link
Collaborator

Great to know it works for you!

Just note that you shouldn't need to unset the prompt command in your bashrc, it should only be needed once when upgrading.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants