You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the logs we can see that charmcraft is generating a hostname that contains understores:
2025-01-31 15:16:50.027 Setting charmcraft to be injected from the host into the build environment because it is running as a snap.
2025-01-31 15:16:50.027 Preparing managed instance 'charmcraft-digest-squid-auth-helper-ubuntu-22.04-amd64_ubuntu-20.04-amd64-5603827'
2025-01-31 15:16:50.031 Using hostname 'charmcraft-digest-squid-auth-helper-ubuntu-2204-amd64_ubuntu-2'
This generates an error as '_' are not valid characters for the hostname command:
2025-01-31 15:17:01.013 Executing in container: lxc --project charmcraft exec local:charmcraft-digest-squid-auth-helper-ubun-5e15c5547ad997b04c08 -- env CRAFT_MANAGED_MODE=1 CHARMCRAFT_MANAG
ED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical hostname -F /etc/hostname
2025-01-31 15:17:01.383 Failed to set hostname.
2025-01-31 15:16:50.027 Setting charmcraft to be injected from the host into the build environment because it is running as a snap.
2025-01-31 15:16:50.027 Preparing managed instance 'charmcraft-digest-squid-auth-helper-ubuntu-22.04-amd64_ubuntu-20.04-amd64-5603827'
2025-01-31 15:16:50.031 Using hostname 'charmcraft-digest-squid-auth-helper-ubuntu-2204-amd64_ubuntu-2'
...
2025-01-31 15:17:01.013 Executing in container: lxc --project charmcraft exec local:charmcraft-digest-squid-auth-helper-ubun-5e15c5547ad997b04c08 -- env CRAFT_MANAGED_MODE=1 CHARMCRAFT_MANAG
ED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical hostname -F /etc/hostname
2025-01-31 15:17:01.383 Failed to set hostname.
The text was updated successfully, but these errors were encountered:
Bug Description
The
charmcraft build
command fails when charmcraft.yaml contains the following configuration:In the logs we can see that charmcraft is generating a hostname that contains understores:
This generates an error as '_' are not valid characters for the
hostname
command:A proposal to solve the issue here: canonical/craft-providers#722
To Reproduce
Create a charm with multiple "run-on" destinations (see charmcraft.yaml) and try to build it.
Environment
Building on Ubuntu 24.04
charmcraft.yaml
Relevant log output
The text was updated successfully, but these errors were encountered: