[pypy-issue] Issue #2268: _sqlite3.OperationalError: disk I/O error (pypy/pypy)

Valentin Lorentz issues-reply at bitbucket.org
Thu Mar 31 08:46:30 EDT 2016


New issue 2268: _sqlite3.OperationalError: disk I/O error
https://bitbucket.org/pypy/pypy/issues/2268/_sqlite3operationalerror-disk-i-o-error

Valentin Lorentz:

When running my code on Travis CI, I get the following traceback:


```
#!python

Traceback (most recent call last):

  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 915, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 1084, in execute
    return self.__execute(False, sql, [params])
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 1057, in __execute
    raise self.__connection._get_exception(ret)
_sqlite3.OperationalError: disk I/O error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/opt/python/pypy3-2.4.0/lib-python/3/threading.py", line 740, in _bootstrap_inner
    self.run()
  File "/opt/python/pypy3-2.4.0/lib-python/3/threading.py", line 693, in run
    self._target(*self._args, **self._kwargs)
  File "/home/travis/build/ProjetPP/PPP-Core/ppp_core/verbose_log.py", line 28, in log_answers
    conn = get_engine(url).connect()
  File "/home/travis/build/ProjetPP/PPP-Core/ppp_core/verbose_log.py", line 21, in get_engine
    metadata.create_all(engine)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/schema.py", line 3695, in create_all
    tables=tables)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1856, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1481, in _run_visitor
    **kwargs).traverse_single(element)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/ddl.py", line 730, in visit_metadata
    _is_metadata_operation=True)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/ddl.py", line 764, in visit_table
    include_foreign_key_constraints=include_foreign_key_constraints
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
    compiled
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/util/compat.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 915, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 1084, in execute
    return self.__execute(False, sql, [params])
  File "/opt/python/pypy3-2.4.0/lib_pypy/_sqlite3.py", line 1057, in __execute
    raise self.__connection._get_exception(ret)
sqlalchemy.exc.OperationalError: (_sqlite3.OperationalError) disk I/O error [SQL: '\nCREATE TABLE requests (\n\trequest_handling_start_time FLOAT, \n\trequest_handling_end_time FLOAT, \n\trequest_answers_json TEXT\n)\n\n']
```

I believe this code should be enough to reproduce the issue:

```
#!python

import sqlalchemy, tempfile
metadata = sqlalchemy.MetaData()
requests = sqlalchemy.Table('requests', metadata, sqlalchemy.Column('request_handling_start_time', sqlalchemy.Float), sqlalchemy.Column('request_handling_end_time', sqlalchemy.Float), sqlalchemy.Column('request_answers_json', sqlalchemy.Text))
with tempfile.NamedTemporaryFile('w+') as fd:
 uri = 'sqlite:///%s' % fd.name
 engine = sqlalchemy.create_engine(uri)
 metadata.create_all(engine)
```

However, I am not able to reproduce it outside Travis.





More information about the pypy-issue mailing list