Upgrade from 1.95 to 2.35 failure because column maasserver_domain.ttl does not exist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Triaged
|
Medium
|
Unassigned | ||
maas (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Undecided
|
Unassigned |
Bug Description
Upgrading an older Trusty based Maas (1.9.5) to Xenial (2.3.5) resulted in a traceback during the do-release-upgrade procedure:
Applying maasserver.
File "/usr/lib/
return self.cursor.
psycopg2.
LINE 1: ...ain"."name", "maasserver_
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/
"__main__", mod_spec)
File "/usr/lib/
exec(code, run_globals)
File "/usr/lib/
raise SystemExit(
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
output = self.handle(*args, **options)
File "/usr/lib/
fake_
File "/usr/lib/
return command.
File "/usr/lib/
output = self.handle(*args, **options)
File "/usr/lib/
executor.
File "/usr/lib/
self.
File "/usr/lib/
state = migration.
File "/usr/lib/
operation.
File "/usr/lib/
self.
File "/usr/lib/
domain_id = maasserver.
File "/usr/lib/
return Domain.
File "/usr/lib/
'updated': now,
File "/usr/lib/
return getattr(
File "/usr/lib/
return self.get(**lookup), False
File "/usr/lib/
num = len(clone)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
results = compiler.
File "/usr/lib/
cursor.
File "/usr/lib/
return self.cursor.
File "/usr/lib/
six.
File "/usr/lib/
raise value.with_
File "/usr/lib/
return self.cursor.
django.
LINE 1: ...ain"."name", "maasserver_
dpkg: error processing package maas-region-
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
maas depends on maas-region-
Package maas-region-
To reproduce, install Maas on Trusty, with a working database, and run do-release-upgrade.
I suspect there's some edge case in this particular database, working now on trying to identify it. The particular database has been around for at least 3 years now.
Related branches
- Adam Collard (community): Needs Fixing
- MAAS Lander: Approve
-
Diff: 25 lines (+13/-1)1 file modifiedsrc/maasserver/migrations/builtin/maasserver/0011_domain_data.py (+13/-1)
Changed in maas: | |
assignee: | nobody → Felipe Reyes (freyes) |
Changed in maas: | |
status: | Confirmed → Triaged |
Changed in maas: | |
assignee: | Felipe Reyes (freyes) → nobody |
Changed in maas: | |
milestone: | 3.4.0 → 3.4.x |
Given this is a test, I tried adding the missing column:
postgres=# \connect maasdb
Table "public. maasserver_ domain" ------- -+----- ------- ------- ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- -- 'maasserver_ domain_ id_seq' ::regclass) _domain_ pkey" PRIMARY KEY, btree (id) _domain_ name_key" UNIQUE CONSTRAINT, btree (name) _domain_ 946f3fba" btree (authoritative) _domain_ name_4403c8e5d4 05ce97_ like" btree (name varchar_ pattern_ ops) dnsresource" CONSTRAINT "maasserver_ d_domain_ id_48f70cfc2a27 04fa_fk_ maasserver_ domain_ id" FOREIGN KEY (domain_id) REFERENCES maasserver_ domain( id) DEFERRABLE INITIALLY DEFERRED n_domain_ id_67d5fcf688c8 fcd5_fk_ maasserver_ domain_ id" FOREIGN KEY (domain_id) REFERENCES maasserver_ domain( id) DEFERRABLE INITIALLY DEFERRED
You are now connected to database "maasdb" as user "postgres".
maasdb=# \d maasserver_domain
Column | Type | Modifiers
-------
id | integer | not null default nextval(
created | timestamp with time zone | not null
updated | timestamp with time zone | not null
name | character varying(256) | not null
authoritative | boolean |
Indexes:
"maasserver
"maasserver
"maasserver
"maasserver
Referenced by:
TABLE "maasserver_
TABLE "maasserver_node" CONSTRAINT "maasserver_
maasdb=# alter table maasserver_domain add column ttl integer;
Table "public. maasserver_ domain" ------- -+----- ------- ------- ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- -- 'maasserver_ domain_ id_seq' ::regclass) _domain_ pkey" PRIMARY KEY, btree (id) _domain_ name_key" UNIQUE CONSTRAINT...
ALTER TABLE
maasdb=# \d maasserver_domain
Column | Type | Modifiers
-------
id | integer | not null default nextval(
created | timestamp with time zone | not null
updated | timestamp with time zone | not null
name | character varying(256) | not null
authoritative | boolean |
ttl | integer |
Indexes:
"maasserver
"maasserver