Azure Integrator Charm not working with CDK 1.14 release Azure Integrator Charm not working with CDK 1.14 release: charms.layer.azure.AzureError: WARNING: Role "id" is missing.

Bug #1823111 reported by Calvin Hartwell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Azure Integrator Charm
Fix Released
High
Cory Johns

Bug Description

Hi all,

As per the documentation, I've created and deployed a simple CDK bundle which was previously working with other releases. As per the documentation, I've setup the credentials for Azure within Juju and deployed CDK and then used the juju trust command as expected.

However, checking the log, there is an error: https://pastebin.ubuntu.com/p/x7N4Dh5V6c/

019-04-04 03:07:55 ERROR juju-log Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 73, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-azure-integrator-0/charm/reactive/azure.py", line 33, in update_roles_on_install
    layer.azure.update_roles()
  File "lib/charms/layer/azure.py", line 245, in update_roles
    '--role-definition', json.dumps(role_data))
  File "lib/charms/layer/azure.py", line 340, in _azure
    raise AzureError.get(stderr)
charms.layer.azure.AzureError: WARNING: Role "id" is missing. Look for the role in the current subscription...
ERROR: No definition was found with the name of "juju-charm-vm-reader-789cdfae-2145-480c-8d66-23837c96bff5"

The bundle is very simple: https://pastebin.ubuntu.com/p/WPTWWT5gZ9/

I did not get a chance to test with k8s 1.13, but I assume that is also broken.

Tags: azure cdk juju k8s
summary: - Azure integrator charm is not working with k8s 12019-04-04 03:07:38
- DEBUG install Warning: apt-key output should not be parsed (stdout is
- not a terminal) 2019-04-04 03:07:38 DEBUG install OK 2019-04-04 03:07:38
- INFO juju-log Invoking reactive handler:
- reactive/azure.py:17:update_creds 2019-04-04 03:07:38 INFO juju-log
- Invoking reactive handler: reactive/apt.py:38:update 2019-04-04 03:07:38
- INFO juju-log status-set: maintenance: Updating apt cache 2019-04-04
- 03:07:39 DEBUG install Hit:1 http://azure.archive.ubuntu.com/ubuntu
- bionic InRelease 2019-04-04 03:07:39 DEBUG install Hit:2
- http://azure.archive.ubuntu.com/ubuntu bionic-updates InRelease
- 2019-04-04 03:07:39 DEBUG install Hit:3
- http://azure.archive.ubuntu.com/ubuntu bionic-backports InRelease
- 2019-04-04 03:07:39 DEBUG install Get:4
- https://packages.microsoft.com/repos/azure-cli xenial InRelease [3188 B]
- 2019-04-04 03:07:39 DEBUG install Hit:5
- http://security.ubuntu.com/ubuntu bionic-security InRelease 2019-04-04
- 03:07:40 DEBUG install Fetched 3188 B in 1s (3308 B/s) 2019-04-04
- 03:07:42 DEBUG install Reading package lists... 2019-04-04 03:07:42 INFO
- juju-log Invoking reactive handler: reactive/apt.py:43:install_queued
- 2019-04-04 03:07:42 INFO juju-log status-set: maintenance: Installing
- azure-cli 2019-04-04 03:07:43 INFO juju-log Installing ['azure-cli']
- with options: ['--option=Dpkg::Options::=--force-confold'] 2019-04-04
- 03:07:43 DEBUG install Reading package lists... 2019-04-04 03:07:44
- DEBUG install Building dependency tree... 2019-04-04 03:07:44 DEBUG
- install Reading state information... 2019-04-04 03:07:44 DEBUG install
- azure-cli is already the newest version (2.0.61-1~xenial). 2019-04-04
- 03:07:44 DEBUG install 0 upgraded, 0 newly installed, 0 to remove and 0
- not upgraded. 2019-04-04 03:07:45 INFO juju-log Invoking reactive
- handler: reactive/azure.py:22:get_creds 2019-04-04 03:07:45 INFO juju-
- log Forcing logout of Azure CLI 2019-04-04 03:07:49 INFO juju-log
- Logging in to Azure CLI 2019-04-04 03:07:52 INFO juju-log Invoking
- reactive handler: reactive/apt.py:49:ensure_package_status 2019-04-04
- 03:07:52 INFO juju-log Unholding packages azure-cli 2019-04-04 03:07:52
- INFO juju-log Marking {'azure-cli'} as unhold 2019-04-04 03:07:52 DEBUG
- install azure-cli was already not hold. 2019-04-04 03:07:52 INFO juju-
- log Invoking reactive handler:
- reactive/azure.py:28:update_roles_on_install 2019-04-04 03:07:53 INFO
- juju-log status-set: maintenance: loading roles 2019-04-04 03:07:55
- ERROR juju-log Hook error: Traceback (most recent call last): File
- "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/__init__.py", line 73, in main
- bus.dispatch(restricted=restricted_mode) File
- "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/bus.py", line 390, in dispatch
- _invoke(other_handlers) File "/var/lib/juju/agents/unit-azure-
- integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py",
- line 359, in _invoke handler.invoke() File
- "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/bus.py", line 181, in invoke
- self._action(*args) File "/var/lib/juju/agents/unit-azure-
- integrator-0/charm/reactive/azure.py", line 33, in
- update_roles_on_install layer.azure.update_roles() File
- "lib/charms/layer/azure.py", line 245, in update_roles '--role-
- definition', json.dumps(role_data)) File "lib/charms/layer/azure.py",
- line 340, in _azure raise AzureError.get(stderr)
- charms.layer.azure.AzureError: WARNING: Role "id" is missing. Look for
- the role in the current subscription... ERROR: No definition was found
- with the name of "juju-charm-vm-
- reader-789cdfae-2145-480c-8d66-23837c96bff5" 2019-04-04 03:07:55 DEBUG
- install Traceback (most recent call last): 2019-04-04 03:07:55 DEBUG
- install File "/var/lib/juju/agents/unit-azure-
- integrator-0/charm/hooks/install", line 22, in <module> 2019-04-04
- 03:07:55 DEBUG install main() 2019-04-04 03:07:55 DEBUG install
- File "/var/lib/juju/agents/unit-azure-
- integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/__init__.py", line 73, in main 2019-04-04
- 03:07:55 DEBUG install bus.dispatch(restricted=restricted_mode)
- 2019-04-04 03:07:55 DEBUG install File "/var/lib/juju/agents/unit-
- azure-integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/bus.py", line 390, in dispatch 2019-04-04
- 03:07:55 DEBUG install _invoke(other_handlers) 2019-04-04 03:07:55
- DEBUG install File "/var/lib/juju/agents/unit-azure-
- integrator-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py",
- line 359, in _invoke 2019-04-04 03:07:55 DEBUG install
- handler.invoke() 2019-04-04 03:07:55 DEBUG install File
- "/var/lib/juju/agents/unit-azure-integrator-0/.venv/lib/python3.6/site-
- packages/charms/reactive/bus.py", line 181, in invoke 2019-04-04
- 03:07:55 DEBUG install self._action(*args) 2019-04-04 03:07:55 DEBUG
- install File "/var/lib/juju/agents/unit-azure-
- integrator-0/charm/reactive/azure.py", line 33, in
- update_roles_on_install 2019-04-04 03:07:55 DEBUG install
- layer.azure.update_roles() 2019-04-04 03:07:55 DEBUG install File
- "lib/charms/layer/azure.py", line 245, in update_roles 2019-04-04
- 03:07:55 DEBUG install '--role-definition', json.dumps(role_data))
- 2019-04-04 03:07:55 DEBUG install File "lib/charms/layer/azure.py",
- line 340, in _azure 2019-04-04 03:07:55 DEBUG install raise
- AzureError.get(stderr) 2019-04-04 03:07:55 DEBUG install
- charms.layer.azure.AzureError: WARNING: Role "id" is missing. Look for
- the role in the current subscription... 2019-04-04 03:07:55 DEBUG
- install ERROR: No definition was found with the name of "juju-charm-vm-
- reader-789cdfae-2145-480c-8d66-23837c96bff5" 2019-04-04 03:07:55 ERROR
- juju.worker.uniter.operation runhook.go:132 hook "install" failed: exit
- status 1 2019-04-04 03:07:55 INFO juju.worker.uniter resolver.go:124
- awaiting error resolution for "install" hook 2019-04-04 03:07:55 INFO
- juju.worker.uniter resolver.go:124 awaiting error resolution for
- "install" hook.14 release
+ Azure Integrator Charm not working with CDK 1.14 release
summary: - Azure Integrator Charm not working with CDK 1.14 release
+ Azure Integrator Charm not working with CDK 1.14 release Azure
+ Integrator Charm not working with CDK 1.14 release:
+ charms.layer.azure.AzureError: WARNING: Role "id" is missing.
description: updated
description: updated
Changed in charm-azure-integrator:
status: New → Triaged
assignee: nobody → Cory Johns (johnsca)
importance: Undecided → High
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Calvin, please attach CDK Field Agent output (https://github.com/juju-solutions/cdk-field-agent).

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

FWIW, this bundle deploys successfully for me on Azure.

Revision history for this message
Calvin Hartwell (calvinh) wrote :

FWIW, this bundle deploys successfully for me on Azure.

^interesting, this could be caused by some user or subscription permissions, I didn't look at this one in as much detail as the AWS bug (https://bugs.launchpad.net/charm-aws-integrator/+bug/1823106).

Let me re-test in next few days, thanks for quick responses!

Revision history for this message
Cory Johns (johnsca) wrote :

It looks like the Azure API is returning a different error message than expected for "role not found". I'm not sure why it's different for this one deployment, but it's easy enough to add the new message pattern to the charm.

It's unfortunate that Azure (and the other clouds) don't provide a consistent way to distinguish between failure cases in a machine-consumable way, leading to us having to parse the human-readable message which is clearly fallible.

Cory Johns (johnsca)
Changed in charm-azure-integrator:
status: Triaged → Fix Committed
status: Fix Committed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Cory Johns (johnsca) wrote :

This is released to stable as cs:~containers/azure-integrator-4

Changed in charm-azure-integrator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.