Loomio
Tue 30 Jun 2020 10:35PM

problems with upgrading old installation

HW Holger Wessels Public Seen by 47

Hi,

as it was mentioned in a similar topic, upgrading an older loomio installation which wasn't touch since installation can be tricky. I've tried for hours all the variations I could find, but wasn't successful yet. I'm running a Ubuntu 18.4 virtual server. I've tried several from the command mentioned in the other threads, upgrading the os, git pull etc. but nothing got me through.

What could be the most useful next step?

Thanks,

Holger (Berlin Burner e.V.)

HW

Holger Wessels Tue 30 Jun 2020 10:40PM

So to start with the very basic beginning:

cd loomio-deploy/
docker-compose pull
 docker-compose down
 docker-compose run app rake db:migrate
[...]
Migrating to UpdateStanceDataForMeetingPolls (20190827234738)
== 20190827234738 UpdateStanceDataForMeetingPolls: migrating ==================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
The single-table inheritance mechanism failed to locate the subclass: 'FormalGroup'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Group.inheritance_column to use another column for that information.


(I wasn't able to paste the whole stack, led to internal 400 and 422 HTTP errors on the Javascript console, but no message visible to the user)

RG

Robert Guthrie Fri 3 Jul 2020 4:58AM

Hi @Holger Wessels. Sorry I've not had any time to look into this until now.

The key part of the log is: The single-table inheritance mechanism failed to locate the subclass: 'FormalGroup'.

The easiest way to fix this might be to bring the classes back, empty.

I've just commited this solution to the master branch, and a new latest image will be built in the next hour, and you should be able to switch from stable to the latest docker image in docker-compose.yml and hopefully that will help you through.

I would be bracing myself for maybe one or two more problems like this given the age of your database.. but who knows, maybe this will be the only issue 馃

HW

Holger Wessels Fri 3 Jul 2020 11:31AM

Well, I'm getting further, but not until the end yet. :-) With the latest docker image I'm the migration stops with a different type of error, this time a missing function of which I don't know how important it is:

Migrating to UpdateStanceDataForMeetingPolls (20190827234738)
== 20190827234738 UpdateStanceDataForMeetingPolls: migrating ==================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
undefined local variable or method `hideresultsuntil_closed' for #<Poll:0x000056238e27a1e8>

HW

Holger Wessels Fri 3 Jul 2020 1:40PM

Could it be a better strategy to try to update in smaller steps to versions in between (like in 3 month steps), if that is possible?

HW

Holger Wessels Fri 3 Jul 2020 2:51PM

Well, to answer that to myself: it appears that the versions between March 2019 and v2.1.10 are not on docker hub, so not so much luck to pretend I did frequent updates 馃檪

HW

Holger Wessels Tue 14 Jul 2020 10:11AM

Hi @Rob Guthrie , any leads on hide_results_until_closed?

RG

Robert Guthrie Tue 14 Jul 2020 9:56PM

yea, it's taken us too long to move to proper versioning, which would have really helped in cases like this. Oh well, it's here now.

RG

Robert Guthrie Tue 14 Jul 2020 10:01PM

I'm pushing a fix to master (docker:latest) now. Should be up soon. Thanks for finding these migration issues for us.

HW

Holger Wessels Wed 15 Jul 2020 9:53AM

Well, slowly moving forward. But here's another one:

Migrating to UpdateStanceDataForMeetingPolls (20190827234738)
== 20190827234738 UpdateStanceDataForMeetingPolls: migrating ==================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedColumn: ERROR: column stances.revoked_at does not exist
LINE 1: ...s"."poll_id" = $1 AND "stances"."latest" = $2 AND "stances"....
^
: SELECT "stances".* FROM "stances" WHERE "stances"."pollid" = $1 AND "stances"."latest" = $2 AND "stances"."revokedat" IS NULL ORDER BY "stances"."created_at" ASC LIMIT $3

RG

Robert Guthrie Wed 15 Jul 2020 9:59AM

Whoops, posted early.

You can just comment out line 3 in db/migrate/20190827234738_update_stance_data_for_meeting_polls.rb and run the migrations.

I'm not sure how to fix this/make it go away for for others yet. Scheduling it as a background job when the app boots would do.
But.. maybe I'll see if someone else wants to do that for me.

Load More