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.

Migrations / Initialization happens without checking if another instance is running

See original GitHub issue

Observed behavior

Kolibri 0.13.0.dev runs migrations even though another instance is running, which can potentially lead to database corruption.

CC: @rtibbles

Expected behavior

Kolibri should immediately quit.

User-facing consequences

Almost certainly bad.

Errors and logs

➜  kolibri git:(develop) kolibri start --foreground          
WARNING:root:No C Extensions available for this platform.

INFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE
INFO     Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO     Version was 0.13.0.dev0+git.20190716150511, new version: 0.13.0.dev0+git.20190822215051
INFO     Running update routines for new version...
Operations to perform:
  Apply all migrations: admin, analytics, auth, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  Applying content.0019_contentnode_slideshow_options... OK
  Applying morango.0013_auto_20190627_1513... OK
Operations to perform:
  Apply all migrations: admin, analytics, auth, content, contenttypes, device, discovery, exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
  Applying content.0019_contentnode_slideshow_options... OK
  Applying morango.0013_auto_20190627_1513... OK
Installed 2 object(s) from 1 fixture(s)
INFO     Sqlite database Vacuum finished.
INFO     Running Kolibri
ERROR    Port 8080 is occupied.
Please check that you do not have other processes running on this port and try again.

Steps to reproduce

Run Kolibri 0.12, so it shares directory with current develop. Then run kolibri start --foreground.

Context

Development env. for current develop branch on a system with 0.12.8 installed from .deb.

Related

The otherwise great #5494

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rtibblescommented, Sep 4, 2019

I think it’s fine to run them before - they used to be run at module import, so it’s just a matter of reinstating that order (but not having to run them at module import).

0reactions
benjaomingcommented, Sep 3, 2019

Oh interesting: Not having run updates isn’t sane, but system should be sane before running them… this is a Catch 22 😃

Should we split something up here or will it be safe to run sanity checks before migrations/upgrading?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to create migrations after upgrading to ASP.NET ...
Initialize (context); Then run the Migration instructions to test. If the problem arises, then follow up on the DbInitializer. cs class.
Read more >
Silent failure when running airflow db init #18408
I advise you to do bisecting. Remove half of your DAGs and run migration, Then either take those you have (if failed) or...
Read more >
Data Points - A Code First Migrations Mystery: Solved
The migration will be found because it's in the project. The initializer will check the database's migration history table and update the database...
Read more >
Running database migrations when deploying to Kubernetes
As part of a rolling update, the migration job is deployed, and immediately starts executing. Instances of the new application are created, but ......
Read more >
85. Database Initialization
With that setup, migrations in dev/db/migration run only when the dev profile is active. 85.5.2 Execute Liquibase Database Migrations on Startup.
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