A too-long application name leaves charm stuck installing agent

Bug #1731027 reported by Adam Israel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Witold Krecicki

Bug Description

Using libjuju to drive Juju 2.2.6, I've found that it's possible to deploy a charm that will always get stuck during 'installing agent' by specifying an application that is too long.

Step to recreate:

juju deploy mysql jujud-unit-pytest-bb-ai-bh-bd-ag-dc-ping-pong-ns-default-pytest-bb-ai-bh-bd-ag-dc-ping-pong-ns-ping-vnf-b-b-0

Observed behaviour:
`juju status` simply shows that the charm is 'installing agent' and does not change regardless of how long it's let run.

`juju debug-log` shows this recurring repeatedly:
machine-0: 13:40:34 ERROR juju.service.systemd service "jujud-unit-pytest-bb-ai-bh-bd-ag-dc-ping-pong-ns-default-pytest-bb-ai-bh-bd-ag-dc-ping-pong-ns-ping-vnf-b-b-0" failed to start: application jujud-unit-pytest-bb-ai-bh-bd-ag-dc-ping-pong-ns-default-pytest-bb-ai-bh-bd-
ag-dc-ping-pong-ns-ping-vnf-b-b-0 not found

Expected behaviour:

The deploying charm should enter an error state so that the operator (either a user or automaton driving libjuju) knows that deployment has failed (and why)

Revision history for this message
Adam Israel (aisrael) wrote :

It looks like the max name length is 51 characters. I can deploy an application named that long, but as soon as it hits 52 or above it triggers the above behavior.

Revision history for this message
Tim Penhey (thumper) wrote :

Looks like there is a lenght limit on systemd service names of 64 characters.

We have "jujud-unit-" + app name + "-0" (for the first unit)

With a 51 character limit app name, we hit 64 characters for the service name (until you add the eleventh unit).

Juju should impose a resonable name limit length on applications.

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.3-rc1
Witold Krecicki (wpk)
Changed in juju:
assignee: nobody → Witold Krecicki (wpk)
Revision history for this message
Richard Harding (rharding) wrote :

As the naming issue is an implementation detail of how things are named for the systemd bits is it important to force that onto the charm developer? Since the charm names are defaulted as application names this could be seriously backward compatible and really means this needs to be enforced upstream on the charm command and the charmstore itself.

Ideally juju would handle the naming here itself and leave things as the user expressed them everywhere else.

John A Meinel (jameinel)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Witold Krecicki (wpk) wrote :
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
Revision history for this message
Junien F (axino) wrote :

Proposed a better fix in https://github.com/juju/juju/pull/8336 - the root cause is not a name length limit in systemd, but systemd ellipsizing unit names

It is also totally backwards-compatible

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.