question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errors during startup (database locked, DatabaseIDModel does not exist)

See original GitHub issue

Observed behavior

Attempting to run kolibri start on the most recent develop branch I get the errors below. This does not happen with the devserver.

At this point, I cannot load Kolibri.

Expected behavior

No errors, Kolibri loads

User-facing consequences

sadness, regret

Errors and logs

INFO     Running 'kolibri start' in foreground...
INFO:kolibri.utils.cli:Running 'kolibri start' in foreground...
INFO     Kolibri running on:

INFO:kolibri.utils.cli:Kolibri running on:

	http://127.0.0.1:8080/
	http://192.168.1.2:8080/

INFO     Attempting a ping.
INFO:kolibri.core.analytics.management.commands.ping:Attempting a ping.
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/morango/models.py", line 71, in get_or_create_current_database_id
    return cls.objects.get(current=True)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
    self.model._meta.object_name
morango.models.DoesNotExist: DatabaseIDModel matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/d/Projects/learning_equality/repos/k011x/kolibri/utils/server.py", line 106, in run
    call_command("ping")
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/Users/d/Projects/learning_equality/repos/k011x/kolibri/core/analytics/management/commands/ping.py", line 46, in handle
    data = self.perform_ping(server)
  File "/Users/d/Projects/learning_equality/repos/k011x/kolibri/core/analytics/management/commands/ping.py", line 60, in perform_ping
    instance, _ = InstanceIDModel.get_or_create_current_instance()
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/morango/models.py", line 110, in get_or_create_current_instance
    "database": DatabaseIDModel.get_or_create_current_database_id(),
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/morango/models.py", line 73, in get_or_create_current_database_id
    return cls.objects.create()
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/morango/models.py", line 38, in create
    DatabaseIDModel.objects.update(current=False)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 647, in update
    rows = query.get_compiler(self.db).execute_sql(CURSOR)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1204, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
    cursor.execute(sql, params)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/d/Projects/learning_equality/repos/k011x/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: database is locked

INFO     Started new MESSAGEPROCESSOR thread ID#ack-one-echo-lake
INFO:iceqube.common.utils.MESSAGEPROCESSOR[ack-one-echo-lake]:Started new MESSAGEPROCESSOR thread ID#ack-one-echo-lake
INFO     Started new SCHEDULER thread ID#mobile-skylark-bluebird-uniform
INFO:iceqube.common.utils.SCHEDULER[mobile-skylark-bluebird-uniform]:Started new SCHEDULER thread ID#mobile-skylark-bluebird-uniform
INFO     Started new WORKERMESSAGEHANDLER thread ID#beer-red-five-eleven
INFO:iceqube.common.utils.WORKERMESSAGEHANDLER[beer-red-five-eleven]:Started new WORKERMESSAGEHANDLER thread ID#beer-red-five-eleven
INFO     Sqlite database Vacuum finished.
INFO:kolibri.core.deviceadmin.management.commands.vacuumsqlite:Sqlite database Vacuum finished.
INFO     Next Vacuum in 10 minutes.
INFO:kolibri.core.deviceadmin.management.commands.vacuumsqlite:Next Vacuum in 10 minutes.
INFO:cherrypy.error:[26/Sep/2018:15:15:49] ENGINE Bus STARTING
INFO:cherrypy.error:[26/Sep/2018:15:15:49] ENGINE Serving on http://0.0.0.0:8080
INFO:cherrypy.error:[26/Sep/2018:15:15:49] ENGINE Bus STARTED

Steps to reproduce

make assets
kolibri start

Context

0.11

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
indirectlylitcommented, Oct 15, 2018

I believe this is addressed

1reaction
jredrejocommented, Sep 27, 2018

I think we should review the frequency of the vacuum interval. We set it very aggresive for testing purposes and never reduced it to a reasonable interval. Relates #4067

Read more comments on GitHub >

github_iconTop Results From Across the Web

OperationalError: database is locked - python - Stack Overflow
This error means that one thread or process has an exclusive lock on the database connection and another thread timed out waiting for...
Read more >
Could not obtain exclusive lock on database 'model' - who is ...
Your model database is locked now so what you should do is to find out the session that has a lock on it,...
Read more >
Error: Database principal or schema <name> does not exist in ...
Database principal or schema 'ACT' does not exist in this database. But it clearly does exist and if I start a procedure creation...
Read more >
Unable to open the database: ORA-01157: cannot identify/lock...
ERROR at line 1: ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ... The datafile does not exist or is...
Read more >
How to troubleshoot start up issues with Rational DOORS - IBM
If the DDBS mentioned is not running, open the data directory and look for a file called servdata.dtc. If it is present, remove...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found