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

OperationalError: attempt to write a readonly database #66

Open
bf-ckiendl opened this issue Oct 18, 2019 · 2 comments
Open

OperationalError: attempt to write a readonly database #66

bf-ckiendl opened this issue Oct 18, 2019 · 2 comments

Comments

@bf-ckiendl
Copy link

I installed Bots straight as described in the documentation under Windows: Got the Python 2.7 Installer from the official site, got bots-3.2.0.win-amd64.exe from Sourceforge, installed both, all well.

Tried to run bots-webserver from Start Menu and...

Log in  


Server Error (500)
        Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\django\core\handlers\base.py", line 201, in get_response
    response = middleware_method(request, response)
  File "C:\Python27\lib\site-packages\django\contrib\sessions\middleware.py", line 38, in process_response
    request.session.save()
  File "C:\Python27\lib\site-packages\django\contrib\sessions\backends\db.py", line 63, in save
    obj.save(force_insert=must_create, using=using)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", line 573, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", line 635, in _save_table
    forced_update)
  File "C:\Python27\lib\site-packages\django\db\models\base.py", line 679, in _do_update
    return filtered._update(values) > 0
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 507, in _update
    return query.get_compiler(self.db).execute_sql(None)
  File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 976, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py", line 782, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Python27\lib\site-packages\django\db\backends\util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py", line 450, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: attempt to write a readonly database

I'd take a wild guess and assume Django's SQLite-database was written in some system folder or is owned by the administrator I installed it with or something, but since Django was set up automagically in the background, I don't know where that DB is or in what state it is.

I was unable to find any similar issues.
Is this a known problem? What could cause this? Is the documentation missing a step?

@Drahkir
Copy link

Drahkir commented Feb 17, 2020

Which version of Python do you have installed? I had this exact error running Python 2.7.14. I reinstalled Python 2.7.10 and now I don't get this error.

@bf-ckiendl
Copy link
Author

2.7.16.

I got it to work, though: #68 (comment)

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