weixin_39628160 2020-11-22 01:11
浏览 0

OperationalError: database schema has changed

I lost the stack trace but once on Travis-CI, I saw an OperationalError: database schema has changed bug. It was triggered during stress at "CREATE TABLE IF NOT EXISTS Settings ..."

Some research indicated that perhaps a separate cache process had changed the underlying schema and interacted badly with a statement cache. I'm not sure how that works.

This Issue is open as a reminder. If anyone sees something similar, would you add notes here?

该提问来源于开源项目:grantjenks/python-diskcache

  • 写回答

6条回答 默认 最新

  • weixin_39628160 2020-11-22 01:11
    关注

    Caught a traceback from Travis. On PyPy2 runtime:

    
    Stress test multiple threads and processes. ... Exception in thread Thread-15:
    Traceback (most recent call last):
      File "/opt/python/pypy-2.5.0/lib-python/2.7/threading.py", line 806, in __bootstrap_inner
        self.run()
      File "/opt/python/pypy-2.5.0/lib-python/2.7/threading.py", line 759, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/home/travis/build/grantjenks/python-diskcache/tests/stress_test_fanout.py", line 130, in worker
        cache = FanoutCache('tmp', eviction_policy=eviction_policy)
      File "/home/travis/build/grantjenks/python-diskcache/diskcache/fanout.py", line 29, in __init__
        for num in range(shards)
      File "/home/travis/build/grantjenks/python-diskcache/diskcache/fanout.py", line 29, in <genexpr>
        for num in range(shards)
      File "/home/travis/build/grantjenks/python-diskcache/diskcache/core.py", line 375, in __init__
        'SELECT key, value FROM Settings'
      File "/opt/python/pypy-2.5.0/lib_pypy/_sqlite3.py", line 598, in execute
        return cur.execute(*args)
      File "/opt/python/pypy-2.5.0/lib_pypy/_sqlite3.py", line 915, in wrapper
        return func(self, *args, **kwargs)
      File "/opt/python/pypy-2.5.0/lib_pypy/_sqlite3.py", line 1072, in execute
        return self.__execute(False, sql, [params])
      File "/opt/python/pypy-2.5.0/lib_pypy/_sqlite3.py", line 1045, in __execute
        raise self.__connection._get_exception(ret)
    OperationalError: database schema has changed
    </genexpr>
    评论

报告相同问题?