if machine has 'Inst id' with capitals, deploy fails

Bug #1858846 reported by Hans van den Bogert
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Calico Charm
Triaged
Medium
Unassigned

Bug Description

I looked into this after seeing that the calico charm does not successfully deploy and gets stuck in state "retry calico configuration"

Further investigation showed:

```
unit-calico-23: 16:47:40 INFO unit.calico/23.juju-log etcd:36: Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-calico-23/charm/reactive/calico.py", line 465, in configure_node
    node = calicoctl_get('node', node_name)
  File "/var/lib/juju/agents/unit-calico-23/charm/reactive/calico.py", line 633, in calicoctl_get
    output = calicoctl(*args)
  File "/var/lib/juju/agents/unit-calico-23/charm/reactive/calico.py", line 582, in calicoctl
subprocess.CalledProcessError: Command '['/opt/calicoctl/calicoctl', 'get', '-o', 'yaml', '--export', 'node', 'NLDW1-6-26-1']' returned non-zero exit status 1

```

Manually adding the node shows the supposed faulty scenario; Adding a node on calico level fails if it has capitals.

```
./calicoctl create -f me.yaml
Failed to create 'Node' resource: [error with field Metadata.Name = 'NLDW1-6-26-1' (name must consist of lower case alphanumeric characters, '-' or '.' (regex: [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*))]
```

Changing the node's name in MAAS to lower case solved this for me.

Tags: cdo-qa
description: updated
Revision history for this message
George Kraft (cynerva) wrote :

Thanks for the report. Looks like the calico charm uses gethostname() in a few places to determine the node name, where it should be using gethostname().lower().

Changed in charm-calico:
status: New → Confirmed
George Kraft (cynerva)
Changed in charm-calico:
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Peter Jose De Sousa (pjds) wrote :

hit this one today, calico adds the node as lower, but upper will be used to fetch the node with calicoctl, failing

tags: added: cdo-qa
Revision history for this message
Ebrar Leblebici (birru2) wrote :

I also hit this one with calico charm from 1.28/stable channel and rev 101.

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.