Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook error when MetalLB is not enabled #45

Closed
gruyaume opened this issue Oct 30, 2023 · 0 comments · Fixed by #48
Closed

Hook error when MetalLB is not enabled #45

gruyaume opened this issue Oct 30, 2023 · 0 comments · Fixed by #48
Labels
bug Something isn't working

Comments

@gruyaume
Copy link
Contributor

gruyaume commented Oct 30, 2023

Describe the bug

We are getting a hook failed error whenever relating AMF to gNBSIM whenever the external LB is not set in the AMF.

Expected behavior

Charm should go to blocked status.

Logs

guillaume@thinkpad:~$ juju status
Model  Controller  Cloud/Region        Version  SLA          Timestamp
dev    localhost   microk8s/localhost  3.1.6    unsupported  16:08:24+02:00

App                       Version  Status   Scale  Charm                     Channel  Rev  Address         Exposed  Message
gnbsim                             waiting      1  sdcore-gnbsim             edge      35  10.152.183.153  no       waiting for units to settle down
mongodb-k8s                        active       1  mongodb-k8s               6/edge    37  10.152.183.84   no       Primary
sdcore-amf                         waiting      1  sdcore-amf                edge      43  10.152.183.132  no       installing agent
sdcore-ausf                        active       1  sdcore-ausf               edge      32  10.152.183.254  no       
sdcore-nrf                         active       1  sdcore-nrf                edge      51  10.152.183.253  no       
sdcore-nssf                        active       1  sdcore-nssf               edge      30  10.152.183.37   no       
sdcore-pcf                         active       1  sdcore-pcf                edge      24  10.152.183.158  no       
sdcore-router                      active       1  sdcore-router             edge      26  10.152.183.59   no       
sdcore-udm                         active       1  sdcore-udm                edge      28  10.152.183.46   no       
sdcore-udr                         active       1  sdcore-udr                edge      24  10.152.183.21   no       
self-signed-certificates           active       1  self-signed-certificates  edge      43  10.152.183.44   no       
webui                              active       1  sdcore-webui              edge      18  10.152.183.237  no       

Unit                         Workload  Agent  Address      Ports  Message
gnbsim/0*                    waiting   idle   10.1.19.166         Waiting for N2 information
mongodb-k8s/0*               active    idle   10.1.19.137         Primary
sdcore-amf/0*                error     idle   10.1.19.140         hook failed: "fiveg-n2-relation-joined"
sdcore-ausf/0*               active    idle   10.1.19.149         
sdcore-nrf/0*                active    idle   10.1.19.146         
sdcore-nssf/0*               active    idle   10.1.19.159         
sdcore-pcf/0*                active    idle   10.1.19.162         
sdcore-router/0*             active    idle   10.1.19.163         
sdcore-udm/0*                active    idle   10.1.19.152         
sdcore-udr/0*                active    idle   10.1.19.155         
self-signed-certificates/0*  active    idle   10.1.19.143         
webui/0*                     active    idle   10.1.19.142         
unit-sdcore-amf-0: 16:05:29 ERROR unit.sdcore-amf/0.juju-log fiveg-n2:19: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/./src/charm.py", line 686, in <module>
    main(AMFOperatorCharm)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/venv/ops/main.py", line 436, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/venv/ops/framework.py", line 340, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/venv/ops/framework.py", line 842, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/./src/charm.py", line 386, in _on_n2_relation_joined
    self._set_n2_information()
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/./src/charm.py", line 425, in _set_n2_information
    amf_ip_address=self._get_n2_amf_ip(),
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/./src/charm.py", line 399, in _get_n2_amf_ip
    return self._amf_external_service_ip()
  File "/var/lib/juju/agents/unit-sdcore-amf-0/charm/./src/charm.py", line 645, in _amf_external_service_ip
    return service.status.loadBalancer.ingress[0].ip  # type: ignore[attr-defined]
TypeError: 'NoneType' object is not subscriptable

Environment

  • Juju version: 3.1.6
  • Cloud Environment: MicroK8s
  • Kubernetes version: v1.27.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant