canonical / postgresql-k8s-operator

A Charmed Operator for running PostgreSQL on Kubernetes
https://charmhub.io/postgresql-k8s
Apache License 2.0
10 stars 19 forks source link

Charm not starting due to error parsing `node.status.allocatable["cpu"]` #409

Closed Osama-Kassem closed 7 months ago

Osama-Kassem commented 7 months ago

Steps to reproduce

We deployed the 14/stable postgresql-k8s charm to our k8s cluster running on OpenStack (ProdStack 5)

Expected behavior

Actual behavior

Versions

Operating system: Ubuntu 20.04.6 LTS

Juju CLI: 2.9.46-ubuntu-amd64

Juju agent: 2.9.44

Charm revision: 177

microk8s: N/A - Running on K8s

kubectl version: Client Version: v1.28.7 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.21.14

Log output

2024-03-01T15:18:56.402Z [pebble] HTTP API server listening on ":38812".
2024-03-01T15:18:56.405Z [pebble] Started daemon.
2024-03-01T15:18:56.494Z [pebble] POST /v1/services 87.193105ms 202
2024-03-01T15:18:56.498Z [pebble] Started default services with change 1.
2024-03-01T15:18:56.694Z [pebble] Service "container-agent" starting: /charm/bin/containeragent unit --data-dir /var/lib/juju --append-env "PATH=$PATH:/charm/bin" --show-log --charm-modified-version 0
2024-03-01T15:18:56.815Z [container-agent] 2024-03-01 15:18:56 INFO juju.cmd supercommand.go:56 running containerAgent [2.9.44 02d498631e196f2a37f9b7c3b5c31bdcb1dad333 gc go1.20.5]
2024-03-01T15:18:56.815Z [container-agent] starting containeragent unit command
2024-03-01T15:18:56.815Z [container-agent] containeragent unit "unit-postgresql-k8s-0" start (2.9.44 [gc])
2024-03-01T15:18:56.817Z [container-agent] 2024-03-01 15:18:56 INFO juju.cmd.containeragent.unit runner.go:556 start "unit"
2024-03-01T15:18:56.823Z [container-agent] 2024-03-01 15:18:56 INFO juju.worker.upgradesteps worker.go:60 upgrade steps for 2.9.44 have already been run.
2024-03-01T15:18:56.823Z [container-agent] 2024-03-01 15:18:56 INFO juju.worker.probehttpserver server.go:157 starting http server on [::]:65301
2024-03-01T15:18:56.898Z [container-agent] 2024-03-01 15:18:56 INFO juju.api apiclient.go:687 connection established to "wss://10.131.3.163:17070/model/b0f7ec34-b48d-4466-82b8-224e605d2d40/api"
2024-03-01T15:18:56.910Z [container-agent] 2024-03-01 15:18:56 INFO juju.worker.apicaller connect.go:163 [b0f7ec] "unit-postgresql-k8s-0" successfully connected to "10.131.3.163:17070"
2024-03-01T15:18:57.007Z [container-agent] 2024-03-01 15:18:57 INFO juju.api apiclient.go:687 connection established to "wss://10.131.3.163:17070/model/b0f7ec34-b48d-4466-82b8-224e605d2d40/api"
2024-03-01T15:18:57.015Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.apicaller connect.go:163 [b0f7ec] "unit-postgresql-k8s-0" successfully connected to "10.131.3.163:17070"
2024-03-01T15:18:57.097Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.migrationminion worker.go:142 migration phase is now: NONE
2024-03-01T15:18:57.097Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.logger logger.go:120 logger worker started
2024-03-01T15:18:57.105Z [container-agent] 2024-03-01 15:18:57 WARNING juju.worker.proxyupdater proxyupdater.go:282 unable to set snap core settings [proxy.http= proxy.https= proxy.store=]: exec: "snap": executable file not found in $PATH, output: ""
2024-03-01T15:18:57.121Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.caasupgrader upgrader.go:113 abort check blocked until version event received
2024-03-01T15:18:57.121Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.leadership tracker.go:194 postgresql-k8s/0 promoted to leadership of postgresql-k8s
2024-03-01T15:18:57.121Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.caasupgrader upgrader.go:119 unblocking abort check
2024-03-01T15:18:57.273Z [container-agent] 2024-03-01 15:18:57 INFO juju.agent.tools symlinks.go:20 ensure jujuc symlinks in /var/lib/juju/tools/unit-postgresql-k8s-0
2024-03-01T15:18:57.353Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.uniter uniter.go:326 unit "postgresql-k8s/0" started
2024-03-01T15:18:57.389Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.uniter uniter.go:642 resuming charm install
2024-03-01T15:18:57.389Z [container-agent] 2024-03-01 15:18:57 INFO juju.worker.uniter.charm bundles.go:81 downloading ch:amd64/jammy/postgresql-k8s-177 from API server
2024-03-01T15:18:57.389Z [container-agent] 2024-03-01 15:18:57 INFO juju.downloader download.go:110 downloading from ch:amd64/jammy/postgresql-k8s-177
2024-03-01T15:18:57.988Z [container-agent] 2024-03-01 15:18:57 INFO juju.downloader download.go:93 download complete ("ch:amd64/jammy/postgresql-k8s-177")
2024-03-01T15:18:58.305Z [container-agent] 2024-03-01 15:18:58 INFO juju.downloader download.go:173 download verified ("ch:amd64/jammy/postgresql-k8s-177")
2024-03-01T15:19:06.503Z [pebble] Check "readiness" failure 1 (threshold 3): received non-20x status code 418
2024-03-01T15:19:16.410Z [pebble] Check "readiness" failure 2 (threshold 3): received non-20x status code 418
2024-03-01T15:19:26.416Z [pebble] Check "readiness" failure 3 (threshold 3): received non-20x status code 418
2024-03-01T15:19:26.416Z [pebble] Check "readiness" failure threshold 3 hit, triggering action
2024-03-01T15:19:36.423Z [pebble] Check "readiness" failure 4 (threshold 3): received non-20x status code 418
2024-03-01T15:19:46.412Z [pebble] Check "readiness" failure 5 (threshold 3): received non-20x status code 418
2024-03-01T15:19:56.410Z [pebble] Check "readiness" failure 6 (threshold 3): received non-20x status code 418
2024-03-01T15:20:06.765Z [pebble] Check "readiness" failure 7 (threshold 3): received non-20x status code 418
2024-03-01T15:20:16.425Z [pebble] Check "readiness" failure 8 (threshold 3): received non-20x status code 418
2024-03-01T15:20:26.419Z [pebble] Check "readiness" failure 9 (threshold 3): received non-20x status code 418
2024-03-01T15:20:36.417Z [pebble] Check "readiness" failure 10 (threshold 3): received non-20x status code 418
2024-03-01T15:20:46.421Z [pebble] Check "readiness" failure 11 (threshold 3): received non-20x status code 418
2024-03-01T15:20:56.415Z [pebble] Check "readiness" failure 12 (threshold 3): received non-20x status code 418
2024-03-01T15:21:06.507Z [pebble] Check "readiness" failure 13 (threshold 3): received non-20x status code 418
2024-03-01T15:21:16.419Z [pebble] Check "readiness" failure 14 (threshold 3): received non-20x status code 418
2024-03-01T15:21:26.592Z [pebble] Check "readiness" failure 15 (threshold 3): received non-20x status code 418
2024-03-01T15:21:36.414Z [pebble] Check "readiness" failure 16 (threshold 3): received non-20x status code 418
2024-03-01T15:21:46.412Z [pebble] Check "readiness" failure 17 (threshold 3): received non-20x status code 418
2024-03-01T15:21:56.413Z [pebble] Check "readiness" failure 18 (threshold 3): received non-20x status code 418
2024-03-01T15:22:06.411Z [pebble] Check "readiness" failure 19 (threshold 3): received non-20x status code 418
2024-03-01T15:22:16.414Z [pebble] Check "readiness" failure 20 (threshold 3): received non-20x status code 418
2024-03-01T15:22:26.430Z [pebble] Check "readiness" failure 21 (threshold 3): received non-20x status code 418
2024-03-01T15:22:36.422Z [pebble] Check "readiness" failure 22 (threshold 3): received non-20x status code 418
2024-03-01T15:22:46.410Z [pebble] Check "readiness" failure 23 (threshold 3): received non-20x status code 418
2024-03-01T15:22:56.410Z [pebble] Check "readiness" failure 24 (threshold 3): received non-20x status code 418
2024-03-01T15:22:57.386Z [container-agent] 2024-03-01 15:22:57 INFO juju.worker.uniter uniter.go:352 hooks are retried true
2024-03-01T15:22:57.622Z [container-agent] 2024-03-01 15:22:57 INFO juju.worker.uniter resolver.go:159 found queued "install" hook
2024-03-01T15:23:06.411Z [pebble] Check "readiness" failure 25 (threshold 3): received non-20x status code 418
2024-03-01T15:23:06.413Z [container-agent] 2024-03-01 15:23:06 INFO juju-log Running legacy hooks/install.
2024-03-01T15:23:08.801Z [container-agent] 2024-03-01 15:23:08 INFO juju-log Kubernetes service 'postgresql-k8s' patched successfully
2024-03-01T15:23:09.849Z [container-agent] 2024-03-01 15:23:09 INFO juju.worker.uniter.operation runhook.go:159 ran "install" hook (via hook dispatching script: dispatch)
2024-03-01T15:23:16.411Z [pebble] Check "readiness" failure 26 (threshold 3): received non-20x status code 418
2024-03-01T15:23:18.691Z [container-agent] 2024-03-01 15:23:18 INFO juju.worker.uniter.operation runhook.go:159 ran "upgrade-relation-created" hook (via hook dispatching script: dispatch)
2024-03-01T15:23:26.417Z [pebble] Check "readiness" failure 27 (threshold 3): received non-20x status code 418
2024-03-01T15:23:26.889Z [container-agent] 2024-03-01 15:23:26 INFO juju.worker.uniter.operation runhook.go:159 ran "restart-relation-created" hook (via hook dispatching script: dispatch)
2024-03-01T15:23:29.887Z [container-agent] 2024-03-01 15:23:29 INFO juju.worker.uniter.operation runhook.go:159 ran "database-peers-relation-created" hook (via hook dispatching script: dispatch)
2024-03-01T15:23:30.005Z [container-agent] 2024-03-01 15:23:30 INFO juju.worker.uniter resolver.go:159 found queued "leader-elected" hook
2024-03-01T15:23:36.414Z [pebble] Check "readiness" failure 28 (threshold 3): received non-20x status code 418
2024-03-01T15:23:38.631Z [container-agent] 2024-03-01 15:23:38 INFO juju.worker.uniter.operation runhook.go:159 ran "leader-elected" hook (via hook dispatching script: dispatch)
2024-03-01T15:23:46.319Z [container-agent] 2024-03-01 15:23:46 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:23:46.319Z [container-agent] Traceback (most recent call last):
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:23:46.319Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:23:46.319Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:23:46.319Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:23:46.319Z [container-agent]     framework._emit(event)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:23:46.319Z [container-agent]     self._reemit(event_path)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:23:46.319Z [container-agent]     custom_handler(event)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:23:46.319Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:23:46.319Z [container-agent]     return self.update_config()
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:23:46.319Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:23:46.319Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:23:46.319Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:23:46.319Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:23:46.319Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
2024-03-01T15:23:46.408Z [pebble] Check "readiness" failure 29 (threshold 3): received non-20x status code 418
2024-03-01T15:23:46.913Z [container-agent] 2024-03-01 15:23:46 ERROR juju.worker.uniter.operation runhook.go:153 hook "postgresql-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
2024-03-01T15:23:46.920Z [container-agent] 2024-03-01 15:23:46 ERROR juju.worker.uniter pebblepoller.go:101 pebble poll failed for container "postgresql": failed to send pebble-ready event: hook failed
2024-03-01T15:23:49.889Z [container-agent] 2024-03-01 15:23:49 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:23:49.889Z [container-agent] Traceback (most recent call last):
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:23:49.889Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:23:49.889Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:23:49.889Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:23:49.889Z [container-agent]     framework._emit(event)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:23:49.889Z [container-agent]     self._reemit(event_path)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:23:49.889Z [container-agent]     custom_handler(event)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:23:49.889Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:23:49.889Z [container-agent]     return self.update_config()
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:23:49.889Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:23:49.889Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:23:49.889Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:23:49.889Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:23:49.889Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
2024-03-01T15:23:50.711Z [container-agent] 2024-03-01 15:23:50 ERROR juju.worker.uniter.operation runhook.go:153 hook "postgresql-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
2024-03-01T15:23:50.715Z [container-agent] 2024-03-01 15:23:50 ERROR juju.worker.uniter pebblepoller.go:101 pebble poll failed for container "postgresql": failed to send pebble-ready event: hook failed
2024-03-01T15:23:56.414Z [pebble] Check "readiness" failure 30 (threshold 3): received non-20x status code 418
2024-03-01T15:23:58.308Z [container-agent] 2024-03-01 15:23:58 INFO juju.worker.uniter.operation runhook.go:159 ran "pgdata-storage-attached" hook (via hook dispatching script: dispatch)
2024-03-01T15:24:06.410Z [pebble] Check "readiness" failure 31 (threshold 3): received non-20x status code 418
2024-03-01T15:24:07.611Z [container-agent] 2024-03-01 15:24:07 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:24:07.611Z [container-agent] Traceback (most recent call last):
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:24:07.611Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:24:07.611Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:24:07.611Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:24:07.611Z [container-agent]     framework._emit(event)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:24:07.611Z [container-agent]     self._reemit(event_path)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:24:07.611Z [container-agent]     custom_handler(event)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:24:07.611Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:24:07.611Z [container-agent]     return self.update_config()
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:24:07.611Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:24:07.611Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:24:07.611Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:24:07.611Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:24:07.611Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
2024-03-01T15:24:08.230Z [container-agent] 2024-03-01 15:24:08 ERROR juju.worker.uniter.operation runhook.go:153 hook "postgresql-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
2024-03-01T15:24:08.232Z [container-agent] 2024-03-01 15:24:08 ERROR juju.worker.uniter pebblepoller.go:101 pebble poll failed for container "postgresql": failed to send pebble-ready event: hook failed
2024-03-01T15:24:16.418Z [pebble] Check "readiness" failure 32 (threshold 3): received non-20x status code 418
2024-03-01T15:24:17.326Z [container-agent] 2024-03-01 15:24:17 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:24:17.326Z [container-agent] Traceback (most recent call last):
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:24:17.326Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:24:17.326Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:24:17.326Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:24:17.326Z [container-agent]     framework._emit(event)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:24:17.326Z [container-agent]     self._reemit(event_path)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:24:17.326Z [container-agent]     custom_handler(event)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:24:17.326Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:24:17.326Z [container-agent]     return self.update_config()
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:24:17.326Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:24:17.326Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:24:17.326Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:24:17.326Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:24:17.326Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
2024-03-01T15:24:18.113Z [container-agent] 2024-03-01 15:24:18 ERROR juju.worker.uniter.operation runhook.go:153 hook "postgresql-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
2024-03-01T15:24:18.114Z [container-agent] 2024-03-01 15:24:18 ERROR juju.worker.uniter pebblepoller.go:101 pebble poll failed for container "postgresql": failed to send pebble-ready event: hook failed
2024-03-01T15:24:26.410Z [container-agent] 2024-03-01 15:24:26 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:24:26.410Z [container-agent] Traceback (most recent call last):
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:24:26.410Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:24:26.410Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:24:26.410Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:24:26.410Z [container-agent]     framework._emit(event)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:24:26.410Z [container-agent]     self._reemit(event_path)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:24:26.410Z [container-agent]     custom_handler(event)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:24:26.410Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:24:26.410Z [container-agent]     return self.update_config()
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:24:26.410Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:24:26.410Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:24:26.410Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:24:26.410Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:24:26.410Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
2024-03-01T15:24:26.417Z [pebble] Check "readiness" failure 33 (threshold 3): received non-20x status code 418
2024-03-01T15:24:27.885Z [container-agent] 2024-03-01 15:24:27 ERROR juju.worker.uniter.operation runhook.go:153 hook "postgresql-pebble-ready" (via hook dispatching script: dispatch) failed: exit status 1
2024-03-01T15:24:27.886Z [container-agent] 2024-03-01 15:24:27 ERROR juju.worker.uniter pebblepoller.go:101 pebble poll failed for container "postgresql": failed to send pebble-ready event: hook failed
2024-03-01T15:24:35.527Z [pebble] Exiting on terminated signal.
2024-03-01T15:24:35.617Z [pebble] Stopping all running services.
2024-03-01T15:24:35.897Z [container-agent] 2024-03-01 15:24:35 INFO juju.worker.caasunitterminationworker worker.go:82 terminating due to SIGTERM
2024-03-01T15:24:36.101Z [container-agent] 2024-03-01 15:24:36 WARNING juju.worker.uniter.operation runhook.go:143 hook "config-changed" was terminated
2024-03-01T15:24:36.174Z [container-agent] 2024-03-01 15:24:36 INFO juju.worker.uniter resolver.go:159 found queued "config-changed" hook
2024-03-01T15:24:36.409Z [pebble] Check "readiness" failure 34 (threshold 3): received non-20x status code 418
2024-03-01T15:24:39.070Z [container-agent] 2024-03-01 15:24:39 INFO juju.worker.uniter.operation runhook.go:159 ran "config-changed" hook (via hook dispatching script: dispatch)
2024-03-01T15:24:39.191Z [container-agent] 2024-03-01 15:24:39 INFO juju.worker.uniter uniter.go:310 unit "postgresql-k8s/0" shutting down: agent should be terminated
2024-03-01T15:24:39.218Z [container-agent] 2024-03-01 15:24:39 INFO juju.worker.logger logger.go:136 logger worker stopped
2024-03-01T15:24:39.218Z [container-agent] 2024-03-01 15:24:39 INFO juju.cmd.containeragent.unit runner.go:587 stopped "unit", err: agent should be terminated
2024-03-01T15:24:39.218Z [container-agent] 2024-03-01 15:24:39 ERROR juju.cmd.containeragent.unit runner.go:459 fatal "unit": agent should be terminated
2024-03-01T15:24:39.218Z [container-agent] 2024-03-01 15:24:39 INFO juju.cmd.containeragent.unit agent.go:419 agent terminating
2024-03-01T15:24:39.218Z [container-agent] 2024-03-01 15:24:39 INFO cmd supercommand.go:544 command finished
2024-03-01T15:24:39.226Z [pebble] Service "container-agent" stopped

This part seems to be the issue:

2024-03-01T15:26:06.823Z [container-agent] 2024-03-01 15:26:06 ERROR juju-log Uncaught exception while in charm code:
2024-03-01T15:26:06.823Z [container-agent] Traceback (most recent call last):
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1558, in <module>
2024-03-01T15:26:06.823Z [container-agent]     main(PostgresqlOperatorCharm, use_juju_for_storage=True)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 436, in main
2024-03-01T15:26:06.823Z [container-agent]     _emit_charm_event(charm, dispatcher.event_name)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
2024-03-01T15:26:06.823Z [container-agent]     event_to_emit.emit(*args, **kwargs)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 340, in emit
2024-03-01T15:26:06.823Z [container-agent]     framework._emit(event)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 842, in _emit
2024-03-01T15:26:06.823Z [container-agent]     self._reemit(event_path)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/ops/framework.py", line 931, in _reemit
2024-03-01T15:26:06.823Z [container-agent]     custom_handler(event)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 679, in _on_postgresql_pebble_ready
2024-03-01T15:26:06.823Z [container-agent]     self.push_tls_files_to_workload(container)
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1301, in push_tls_files_to_workload
2024-03-01T15:26:06.823Z [container-agent]     return self.update_config()
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1352, in update_config
2024-03-01T15:26:06.823Z [container-agent]     available_cpu_cores, available_memory = self.get_available_resources()
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1529, in get_available_resources
2024-03-01T15:26:06.823Z [container-agent]     cpu_cores = self.get_node_cpu_cores()
2024-03-01T15:26:06.823Z [container-agent]   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 1525, in get_node_cpu_cores
2024-03-01T15:26:06.823Z [container-agent]     return int(node.status.allocatable["cpu"])
2024-03-01T15:26:06.823Z [container-agent] ValueError: invalid literal for int() with base 10: '7500m'
github-actions[bot] commented 7 months ago

https://warthogs.atlassian.net/browse/DPE-3695

dragomirp commented 7 months ago

Hi, latest 14/edge (rev. 211) should have the fix for this.