learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 306 forks source link

KA Lite server does not start #5526

Closed maher640 closed 6 years ago

maher640 commented 6 years ago

Summary

KA Lite server does not start. After clicking on "Start Server" nothing just happens! I tried to disable the firewall but it didn't work.

System information

KA Lite ver: KALiteSetup-0.17.3 OS: Windows 8.1 64-bit Browser: Google Chrome Version 61.0.3163.100

Traceback or relevant snippet from server.log

Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.auth
 > django.contrib.sessions
 > django.contrib.messages
 > django.contrib.admin
 > django.contrib.staticfiles
 > django.contrib.contenttypes
 > django_js_reverse
 > south
 > kalite.coachreports
 > kalite.distributed
 > kalite.topic_tools
 > kalite.contentload
 > kalite.dynamic_assets
 > kalite.inline
 > kalite.control_panel

Not synced (use migrations):
 - tastypie
 - securesync
 - fle_utils.config
 - fle_utils.chronograph
 - kalite.main
 - kalite.updates
 - kalite.facility
 - kalite.student_testing
 - kalite.i18n
(use ./manage.py migrate to migrate these)
Running migrations for tastypie:
- Nothing to migrate.
 - Loading initial data for tastypie.
Installed 0 object(s) from 0 fixture(s)
Running migrations for securesync:
 - Migrating forwards to 0024_auto__del_unique_facilityuser_username_facility.
 > securesync:0016_auto__add_field_importpurgatory_model_count
FATAL ERROR - The following SQL query failed: CREATE TABLE "_south_new_securesync_importpurgatory" ("timestamp" datetime NOT NULL, "serialized_models" text NOT NULL, "counter" integer NOT NULL, "model_count" integer NOT NULL, "exceptions" text NOT NULL, "retry_attempts" integer NOT NULL, "id" integer PRIMARY KEY)
The error was: table "_south_new_securesync_importpurgatory" already exists
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:
 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.
Error in migration: securesync:0016_auto__add_field_importpurgatory_model_count
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\base.py", line 224, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\base.py", line 263, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\kalite\distributed\management\commands\initialize_kalite.py", line 42, in handle
    self.setup_server_if_needed()
  File "C:\Python27\lib\site-packages\kalite\distributed\management\commands\initialize_kalite.py", line 36, in setup_server_if_needed
    call_command("setup", interactive=False)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\__init__.py", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\base.py", line 263, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\kalite\distributed\management\commands\setup.py", line 430, in handle
    "migrate", merge=True, verbosity=options.get("verbosity"))
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\__init__.py", line 161, in call_command
    return klass.execute(*args, **defaults)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\management\base.py", line 263, in execute
    output = self.handle(*args, **options)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\management\commands\migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 256, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 331, in migrate_many
    result = self.migrate(migration, database)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 114, in run
    return self.run_migration(migration, database)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 84, in run_migration
    migration_function()
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\migration\migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\migrations\0016_auto__add_field_importpurgatory_model_count.py", line 14, in forwards
    keep_default=False)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\db\sqlite3.py", line 38, in add_column
    field.column: (self._column_sql_for_create(table_name, name, field, False), field_default)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\db\generic.py", line 47, in _cache_clear
    return func(self, table, *args, **opts)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\db\sqlite3.py", line 110, in _remake_table
    ", ".join(["%s %s" % (self.quote_name(cname), ctype) for cname, ctype in definitions.items()]),
  File "C:\Python27\lib\site-packages\kalite\packages\dist\south\db\generic.py", line 282, in execute
    cursor.execute(sql, params)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\db\backends\sqlite3\base.py", line 366, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\db\backends\sqlite3\base.py", line 362, in execute
    return Database.Cursor.execute(self, query, params)
DatabaseError: table "_south_new_securesync_importpurgatory" already exists

How to reproduce

  1. Clicked on KA Lite icon
  2. Clicked on "Start Server" or
  3. Run KA Lite as administrator
  4. Clicked on "Start Server"
mrpau-richard commented 6 years ago

@maher640 I will try to reproduce this.

mrpau-richard commented 6 years ago

Hi @maher640 I can't reproduce this issue in Windows 8.1. screen shot 2017-10-13 at 4 24 51 pm

Do you have an existing KA lite installation before you install the KA Lite 0.17.3 version?

maher640 commented 6 years ago

@mrpau-dev No I haven't. I tried more than once to uninstall it completely and re-install it but that didn't work. Also, installation takes time like forever!

The error logs suggests that a DB table already exists, is there a way to remove it completely from the roots?

mrpau-richard commented 6 years ago

@maher640 you can manually delete the existing KA Lite database at C:\Users\"Your current user"\.kalite

benjaoming commented 6 years ago

@maher640 you are right about the error, deleting the database or the entire user data directory would enable you to have this process start over.

The error seems to come from some broken initialization process where the database interrupted while being created. Do you have any recollection of how that might have happened?

maher640 commented 6 years ago

@benjaoming I really don't know. now it worked for me but here what I did:

however, installation took time like forever then I had to stop the installation with Task Manager. I started the server and it took long time before it started. I really don't know what was wrong.

benjaoming commented 6 years ago

Thanks for the feedback @maher640 - I think we should deal with this by investigating why the installation is slow and if better user feedback can be provided.

Just curious, the following issue about prematurely closing a command line window, could this have happened? https://github.com/learningequality/ka-lite-installers/issues/385