➜ prometheus-operator git:(main) tox -e integration
integration installed: attrs==21.2.0,backcall==0.2.0,bcrypt==3.2.0,cachetools==4.2.4,certifi==2021.10.8,cffi==1.15.0,charset-normalizer==2.0.7,cryptography==35.0.0,decorator==5.1.0,google-auth==2.3.0,idna==3.3,iniconfig==1.1.1,ipdb==0.13.9,ipython==7.28.0,jedi==0.18.0,Jinja2==3.0.2,juju==2.9.4,jujubundlelib==0.5.6,kubernetes==18.20.0,macaroonbakery==1.3.1,MarkupSafe==2.0.1,matplotlib-inline==0.1.3,mypy-extensions==0.4.3,oauthlib==3.1.1,packaging==21.0,paramiko==2.8.0,parso==0.8.2,pexpect==4.8.0,pickleshare==0.7.5,pluggy==1.0.0,prompt-toolkit==3.0.21,protobuf==3.19.0,ptyprocess==0.7.0,py==1.10.0,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycparser==2.20,Pygments==2.10.0,pymacaroons==0.13.0,PyNaCl==1.4.0,pyparsing==2.4.7,pyRFC3339==1.1,pytest==6.2.5,pytest-asyncio==0.16.0,pytest-operator==0.8.4,python-dateutil==2.8.2,pytz==2021.3,PyYAML==6.0,requests==2.26.0,requests-oauthlib==1.3.0,rsa==4.7.2,six==1.16.0,theblues==0.5.2,toml==0.10.2,toposort==1.7,traitlets==5.1.0,typing-extensions==3.10.0.2,typing-inspect==0.7.1,urllib3==1.26.7,wcwidth==0.2.5,websocket-client==1.2.1,websockets==7.0
integration run-test-pre: PYTHONHASHSEED='1200984586'
integration run-test: commands[0] | pytest -v --tb native --log-cli-level=INFO -s /home/jose/trabajos/canonical/repos/prometheus-operator/tests/integration
====================================================================================== test session starts ======================================================================================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/bin/python
cachedir: .tox/integration/.pytest_cache
rootdir: /home/jose/trabajos/canonical/repos/prometheus-operator
plugins: asyncio-0.16.0, operator-0.8.4
collected 1 item
tests/integration/test_charm.py::test_build_and_deploy_with_ubuntu_image /snap/bin/juju
/snap/bin/charmcraft
---------------------------------------------------------------------------------------- live log setup -----------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:160 Using tmp_path: /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/tmp/pytest/test-charm-qbtp0
INFO pytest_operator.plugin:plugin.py:222 Adding model mk8s:test-charm-qbtp
WARNING juju.client.connection:connection.py:729 unknown facade CAASModelConfigManager
WARNING juju.client.connection:connection.py:753 unexpected facade CAASModelConfigManager found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade RaftLease
WARNING juju.client.connection:connection.py:753 unexpected facade RaftLease found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade Secrets
WARNING juju.client.connection:connection.py:753 unexpected facade Secrets found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade SecretsManager
WARNING juju.client.connection:connection.py:753 unexpected facade SecretsManager found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade SecretsRotationWatcher
WARNING juju.client.connection:connection.py:753 unexpected facade SecretsRotationWatcher found, unable to decipher version to use
----------------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:338 Building charm prometheus-k8s
INFO juju.model:model.py:1873 Deploying local:focal/prometheus-k8s-0
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [allocating] waiting: installing agent
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
FAILED
--------------------------------------------------------------------------------------- live log teardown ---------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:260 Model status:
Unit Machine Status Message
prometheus/0* no-machine blocked Failed to load Prometheus config
Machine Series Status
INFO pytest_operator.plugin:plugin.py:280 Juju error logs:
controller-0: 19:02:03 ERROR juju.worker.caasapplicationprovisioner.runner exited "prometheus": Operation cannot be fulfilled on pods "prometheus-0": the object has been modified; please apply your changes to the latest version and try again
unit-prometheus-0: 19:02:10 ERROR unit.prometheus/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1103, in _request_raw
response = self.opener.open(request, timeout=self.timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1133, in restart
self._pebble.restart_services(service_names)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1250, in restart_services
return self._services_action('restart', services, timeout, delay)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1263, in _services_action
resp = self._request('POST', '/v1/services', body=body)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1074, in _request
response = self._request_raw(method, path, query, headers, data)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1114, in _request_raw
raise APIError(body, code, status, message)
ops.pebble.APIError: action "restart" is unsupported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./src/charm.py", line 311, in <module>
main(PrometheusCharm)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/main.py", line 408, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/main.py", line 142, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 275, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 735, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 782, in _reemit
custom_handler(event)
File "./src/charm.py", line 120, in _configure
container.restart(self._name)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1138, in restart
for svc in self.get_services(service_names):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1179, in get_services
services = self._pebble.get_services(service_names)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1398, in get_services
query = {'names': ','.join(names)}
TypeError: sequence item 0: expected str instance, tuple found
unit-prometheus-0: 19:02:10 ERROR juju.worker.uniter.operation hook "prometheus-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
unit-prometheus-0: 19:02:10 ERROR juju.worker.uniter pebble poll failed for container "prometheus": hook failed
INFO pytest_operator.plugin:plugin.py:294 Destroying model test-charm-qbtp
ERROR asyncio:base_events.py:1707 Task exception was never retrieved
future: <Task finished name='Task-739' coro=<WebSocketCommonProtocol.recv() done, defined at /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py:369> exception=ConnectionClosed('WebSocket connection is closed: code = 1000 (OK), no reason')>
Traceback (most recent call last):
File "/home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py", line 434, in recv
yield from self.ensure_open()
File "/home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py", line 644, in ensure_open
raise ConnectionClosed(
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1000 (OK), no reason
=========================================================================================== FAILURES ============================================================================================
____________________________________________________________________________ test_build_and_deploy_with_ubuntu_image ____________________________________________________________________________
Traceback (most recent call last):
File "/home/jose/trabajos/canonical/repos/prometheus-operator/tests/integration/test_charm.py", line 21, in test_build_and_deploy_with_ubuntu_image
await ops_test.model.wait_for_idle(apps=["prometheus"], status="active")
File "/home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/juju/model.py", line 2625, in wait_for_idle
raise jasyncio.TimeoutError("Timed out waiting for model:\n" + busy)
asyncio.exceptions.TimeoutError: Timed out waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
-------------------------------------------------------------------------------------- Captured log setup ---------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:160 Using tmp_path: /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/tmp/pytest/test-charm-qbtp0
INFO pytest_operator.plugin:plugin.py:222 Adding model mk8s:test-charm-qbtp
WARNING juju.client.connection:connection.py:729 unknown facade CAASModelConfigManager
WARNING juju.client.connection:connection.py:753 unexpected facade CAASModelConfigManager found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade RaftLease
WARNING juju.client.connection:connection.py:753 unexpected facade RaftLease found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade Secrets
WARNING juju.client.connection:connection.py:753 unexpected facade Secrets found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade SecretsManager
WARNING juju.client.connection:connection.py:753 unexpected facade SecretsManager found, unable to decipher version to use
WARNING juju.client.connection:connection.py:729 unknown facade SecretsRotationWatcher
WARNING juju.client.connection:connection.py:753 unexpected facade SecretsRotationWatcher found, unable to decipher version to use
--------------------------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:338 Building charm prometheus-k8s
INFO juju.model:model.py:1873 Deploying local:focal/prometheus-k8s-0
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [allocating] waiting: installing agent
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
INFO juju.model:model.py:2627 Waiting for model:
prometheus/0 [idle] blocked: Failed to load Prometheus config
------------------------------------------------------------------------------------- Captured log teardown -------------------------------------------------------------------------------------
INFO pytest_operator.plugin:plugin.py:260 Model status:
Unit Machine Status Message
prometheus/0* no-machine blocked Failed to load Prometheus config
Machine Series Status
INFO pytest_operator.plugin:plugin.py:280 Juju error logs:
controller-0: 19:02:03 ERROR juju.worker.caasapplicationprovisioner.runner exited "prometheus": Operation cannot be fulfilled on pods "prometheus-0": the object has been modified; please apply your changes to the latest version and try again
unit-prometheus-0: 19:02:10 ERROR unit.prometheus/0.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1103, in _request_raw
response = self.opener.open(request, timeout=self.timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1133, in restart
self._pebble.restart_services(service_names)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1250, in restart_services
return self._services_action('restart', services, timeout, delay)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1263, in _services_action
resp = self._request('POST', '/v1/services', body=body)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1074, in _request
response = self._request_raw(method, path, query, headers, data)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1114, in _request_raw
raise APIError(body, code, status, message)
ops.pebble.APIError: action "restart" is unsupported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./src/charm.py", line 311, in <module>
main(PrometheusCharm)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/main.py", line 408, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/main.py", line 142, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 275, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 735, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/framework.py", line 782, in _reemit
custom_handler(event)
File "./src/charm.py", line 120, in _configure
container.restart(self._name)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1138, in restart
for svc in self.get_services(service_names):
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/model.py", line 1179, in get_services
services = self._pebble.get_services(service_names)
File "/var/lib/juju/agents/unit-prometheus-0/charm/venv/ops/pebble.py", line 1398, in get_services
query = {'names': ','.join(names)}
TypeError: sequence item 0: expected str instance, tuple found
unit-prometheus-0: 19:02:10 ERROR juju.worker.uniter.operation hook "prometheus-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
unit-prometheus-0: 19:02:10 ERROR juju.worker.uniter pebble poll failed for container "prometheus": hook failed
INFO pytest_operator.plugin:plugin.py:294 Destroying model test-charm-qbtp
ERROR asyncio:base_events.py:1707 Task exception was never retrieved
future: <Task finished name='Task-739' coro=<WebSocketCommonProtocol.recv() done, defined at /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py:369> exception=ConnectionClosed('WebSocket connection is closed: code = 1000 (OK), no reason')>
Traceback (most recent call last):
File "/home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py", line 434, in recv
yield from self.ensure_open()
File "/home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/lib/python3.8/site-packages/websockets/protocol.py", line 644, in ensure_open
raise ConnectionClosed(
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1000 (OK), no reason
==================================================================================== short test summary info ====================================================================================
FAILED tests/integration/test_charm.py::test_build_and_deploy_with_ubuntu_image - asyncio.exceptions.TimeoutError: Timed out waiting for model:
================================================================================= 1 failed in 654.98s (0:10:54) =================================================================================
ERROR: InvocationError for command /home/jose/trabajos/canonical/repos/prometheus-operator/.tox/integration/bin/pytest -v --tb native --log-cli-level=INFO -s tests/integration (exited with code 1)
____________________________________________________________________________________________ summary ____________________________________________________________________________________________
ERROR: integration: commands failed