Comment 3 for bug 2019086

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

I redeployed and watched the progression of the states. For a long time landscape stays in a blocked state with a status message similar to "failed to upgrade database schema", and at the very end status changes to "waiting on relations: db", while state switches from blocked back to waiting.

Then I see:

landscape-server/0 waiting idle 3 10.3.4.128 Waiting on relations: db
landscape-server/1 waiting idle 9 10.3.4.118 Waiting on relations: db
landscape-server/2* waiting idle 16 10.3.4.139 Waiting on relations: db

But in the debug-log you can see the error:

unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed gpg: keybox '/root/.gnupg/pubring.kbx' created
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed Traceback (most recent call last):
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed File "/opt/canonical/landscape/canonical/landscape/scripts/schema.py", line 226, in handle_existing_licenses
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed output = check_output(["gpg", "--skip-verify", "--output", "-", license_file])
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed File "/usr/lib/python3.8/subprocess.py", line 516, in run
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed raise CalledProcessError(retcode, process.args,
unit-landscape-server-1: 20:50:34 WARNING unit.landscape-server/1.db-relation-changed subprocess.CalledProcessError: Command '['gpg', '--skip-verify', '--output', '-', '/etc/landscape/license.txt']' returned non
unit-landscape-server-1: 20:50:35 INFO juju.worker.uniter.operation ran "db-relation-changed" hook (via hook dispatching script: dispatch)
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed gpg: WARNING: no command supplied. Trying to guess what you mean ...
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed gpg: invalid armor header: iQEzBAEBCgAdFiEENTODksx68VxYHaPbcqZmZcXIjuYFAmTlPXQACgkQcqZmZcXI\n
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed Traceback (most recent call last):
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed File "/usr/bin/landscape-schema", line 12, in <module>
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed canonical.landscape.scripts.schema.run()
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed File "/opt/canonical/landscape/canonical/landscape/scripts/schema.py", line 297, in run
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed handle_existing_licenses(check_output=check_output, license_file=license_file)
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed File "/opt/canonical/landscape/canonical/landscape/scripts/schema.py", line 226, in handle_existing_licenses
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed output = check_output(["gpg", "--skip-verify", "--output", "-", license_file])
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed File "/usr/lib/python3.8/subprocess.py", line 516, in run
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed raise CalledProcessError(retcode, process.args,
unit-landscape-server-1: 20:50:49 WARNING unit.landscape-server/1.db-relation-changed subprocess.CalledProcessError: Command '['gpg', '--skip-verify', '--output', '-', '/etc/landscape/license.txt']' returned non-zero exit status 1.
unit-landscape-server-1: 20:50:49 ERROR unit.landscape-server/1.juju-log db:51: Landscape Server schema update failed with return code 1

So, at least in my case, it seems to be related to the license. Investigating.