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

BUG: can't insert rows in the history log file #12513

Open
andreamoro opened this issue Aug 27, 2020 · 4 comments
Open

BUG: can't insert rows in the history log file #12513

andreamoro opened this issue Aug 27, 2020 · 4 comments

Comments

@andreamoro
Copy link

andreamoro commented Aug 27, 2020

Since I had to mode the homebrew location to a custom folder to circumnavigate IT security restrictions, I started to have problems also jupyter and jupyterlab.
I assume this is due to the fact I have python installed via pyenv which is managed via homebrew, but cannot be 100% sure.

The error message that I get from time to time is as follow:

/[IPKernelApp] ERROR | Failed to create history session in /Users/andreamoro/.ipython/profile_default/history.sqlite. History will not be saved.
Traceback (most recent call last):
  File "$HOME/.pyenv/versions/3.8.5/lib/python3.8/site-packages/IPython/core/history.py", line 543, in __init__
    self.new_session()
  File "<decorator-gen-22>", line 2, in new_session
  File "$HOME/.pyenv/versions/3.8.5/lib/python3.8/site-packages/IPython/core/history.py", line 58, in needs_sqlite
    return f(self, *a, **kw)
  File "$HOME/.pyenv/versions/3.8.5/lib/python3.8/site-packages/IPython/core/history.py", line 568, in new_session
    cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?, NULL,
sqlite3.OperationalError: database is locked

I gave the database full permission in reading, writing and executing as I thought the problem could have been due to the process running under a separate process with no privileges on my folder, but that's not the case.

Any hint on how to solve?

@Carreau
Copy link
Member

Carreau commented Aug 27, 2020

Is there any chances that this new folder is on NFS or anywhere else, like a non-typical filesystem ?

You can try to set the option --HistoryAccessor.hist_file=':memory:', which should avoid the issue, though the history will not persist across session, but at least that should help until we figure things out.

@andreamoro
Copy link
Author

No, the local folder it's just my home directory in the local disk.
So not sure why this is happening.

In theory it should be like the other use/local though there I may appreciate there were some more sudo binds that IT has decided to let me not use anymore.

@Carreau
Copy link
Member

Carreau commented Aug 27, 2020

Yeah, I here you; Do you have any issue opening the history file with the sqlite3 cli ?
Could it be a custom built Python with a weird sqlite ?

I think we can ask IPython to not use sqlite, and connect it to another type of history DB but I'll have to dig into how to do this.

@andreamoro
Copy link
Author

andreamoro commented Aug 28, 2020

Nope, I can open the database without issues.

Not using a database sounds like a kind of a big ask? What the other option? A flat text file?
I think the best it would be understanding what's the issue with the script, because to me seems like some kind of strange thing happening in the history.py file.

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