vendredi 11 septembre 2015

disk I/O error when using Sqlite3 and SqlAlchemy in docker

I have a flask app that creates a sqlite db to load fixtures for tests. When I run pytest within osx, there are no issues. However, when I set 'PRAGMA journal_mode=WAL' within a ubuntu 14.04 docker container, I get this:

disk I/O error
Traceback (most recent call last):
  File "/tmp/my_app/util/sqlalchemy_helpers.py", line 23, in pragma_journalmode_wal
    cursor.execute('PRAGMA journal_mode=WAL')
OperationalError: disk I/O error 

The sqlite db file is written to a folder within tmp that is dynamically created using python's "tempfile.mkdtemp" function. Even though the tests run as root (because docker), I still made sure the folder has full read/write/execute permissions. I verified that there is plenty of space left on /tmp. I have test code that creates, modifies, and deletes a file in the database folder, and it passes successfully.

I cannot seem to find a way to get an error code or better explanation as to what failed. Any ideas how I can better debug the issue? Could there be an issue with the docker container?

1 commentaire:

  1. Apparently SQLite doesnt like hardlinks.


    https://github.com/linuxserver/docker-plexpy/issues/13

    RépondreSupprimer