higlass / higlass-docker

Builds a docker container wrapping higlass-server and higlass-client in nginx
MIT License
32 stars 14 forks source link

images do not work out of the box (v0.5.0-rc7 and v0.4.17) #151

Open 1superk1 opened 5 years ago

1superk1 commented 5 years ago

I need to create a local higlass-server API so I could serve my own tracks and conf's. I am working on OSX. I started with release v0.4.17. That didn't go too well. So I installed "latest" (which I think is v0.5.0-rc7). Again there were many js errors. Working the list of errors a remedy was to source a fresh sqlite database. Namely - (all commands invoked inside the docker)

rm -f /data/tmp.db /data/db.sqlite3;
rm -r higlass-server/tilesets/migrations
python higlass-server/manage.py makemigrations tilesets
python higlass-server/manage.py migrate

The log at /data/log/hgs.log was still emitting two errors (before and after the migration):

sqlite3.OperationalError: no such table: main.tilesets_project__old sqlite3.OperationalError: no such table: main.auth_user__old

These errors occurred when I was working with the tiles (either saving a modification, or opening a track on the client). Obviously, my cooler tracks were missing the meta data that the server needed. My workaround was to create these tables and populate them with their new counterparts:

.schema auth_user    -- then copy-paste it and change the name of the table
CREATE TABLE IF NOT EXISTS "auth_user__old" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime NULL, "is_superuser" bool NOT NULL, "username" varchar(150) NOT NULL UNIQUE, "first_name" varchar(30) NOT NULL, "email" varchar(254) NOT NULL, "is_staff" bool NOT NULL, "is_active" bool NOT NULL, "date_joined" datetime NOT NULL, "last_name" varchar(150) NOT NULL);
INSERT INTO auth_user__old SELECT * FROM auth_user;

.schema django_content_type    -- again copy-paste it and change the name of the table
CREATE TABLE IF NOT EXISTS "django_content_type__old" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app_label" varchar(100) NOT NULL, "model" varchar(100) NOT NULL);
CREATE UNIQUE INDEX django_content_type_app_label_model_76bd3d32_uniq ON "django_content_type__old" ("app_label", "model");
INSERT INTO main.django_content_type__old SELECT * FROM main.django_content_type;

Problems solved. I don't think it's OSX-specific

pkerpedjiev commented 5 years ago

Hey, thanks for pointing this out. I just ran into the *__old error yesterday as well. It's an issue that appeared in one of the dependencies in early December: https://stackoverflow.com/questions/53637182/django-no-such-table-main-auth-user-old

I'm building a new release: v0.5.0-rc.8 where this should be resolved. If you hadn't already fixed it, I would recommend trying the known stable v0.4.33.