Erro de Python durante o upgrade do MAAS

0

Eu tentei atualizar minha instalação do MAAS como ela foi descrita aqui: Atualizando o MAAS de 1.5.4 para 1.7.0 ou mais recente no Ubuntu 14.04 mas há um erro em um dos scripts python usados durante o atualizar. Eu recebo a seguinte saída:

Setting up maas-region-controller (1.8.0+bzr4001-0ubuntu2~trusty1) ...
 * Stopping web server apache2                                                                                                                                                                                     *
 * Restarting PostgreSQL 9.3 database server                                                                                                                                                               [ OK ]
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.staticfiles
 > piston
 > south

Not synced (use migrations):
 - maasserver
 - metadataserver
(use ./manage.py migrate to migrate these)
Running migrations for maasserver:
 - Migrating forwards to 0138_perf_index_on_node_events.
 > maasserver:0121_recompute_storage_size
Error in migration: maasserver:0121_recompute_storage_size
Traceback (most recent call last):
  File "/usr/sbin/maas-region-admin", line 22, in <module>
    management.execute_from_command_line()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/south/management/commands/migrate.py", line 107, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/lib/python2.7/dist-packages/south/migration/__init__.py", line 219, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 235, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 310, in migrate_many
    result = self.migrate(migration, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 107, in run
    return self.run_migration(migration)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 81, in run_migration
    migration_function()
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "/usr/lib/python2.7/dist-packages/maasserver/migrations/0121_recompute_storage_size.py", line 100, in forwards
    node_details = get_probed_details(orm, [node.system_id])
  File "/usr/lib/python2.7/dist-packages/maasserver/migrations/0121_recompute_storage_size.py", line 60, in get_probed_details
    for system_id, script_output_name, b64data in results:
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 96, in __iter__
    self._fetch_all()
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 854, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 1068, in iterator
    for row in self.query.get_compiler(self.db).results_iter():
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 710, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 781, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "metadataserver_noderesult" does not exist
LINE 1: ..."."name", "metadataserver_noderesult"."data" FROM "metadatas...
                                                             ^

Depois disso, a instalação apenas espera lá e eu tenho que parar com força o apt-get. Chamar apt-get upgrade repete isso. Eu também não consigo remover o pacote maas-region-controller porque isso resulta em

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

que novamente aciona a instalação com o erro.

Existe uma maneira de reparar esta instalação?

    
por Lucaro 24.08.2015 / 13:03

1 resposta

0

Após algumas tentativas e erros, descobri que a única solução seria desinstalar todos os pacotes relacionados a maas dpkg -r e reinstalar o maas a partir do zero.

    
por Lucaro 25.08.2015 / 14:16