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

"Invalid hostname" error when packing charm that runs on multiple bases #2158

Open
jneo8 opened this issue Feb 11, 2025 · 3 comments
Open

"Invalid hostname" error when packing charm that runs on multiple bases #2158

jneo8 opened this issue Feb 11, 2025 · 3 comments
Labels
Bug Something isn't working triaged

Comments

@jneo8
Copy link

jneo8 commented Feb 11, 2025

Bug Description

Failed to pack charm with latest release (version 3.4.2)

To Reproduce

Case 1 charm-microceph:

$ git clone https://github.com/canonical/charm-microceph
$ cd charm-microceph
$ charmcraft pack -v
Starting charmcraft, version 3.4.2
Logging execution to '/home/jneo8/.local/state/charmcraft/log/charmcraft-20250211-161237.225112.log'
Launching managed ubuntu 24.04 instance...
Creating new instance from remote
Creating new base instance from remote 
A network related operation failed in a context of no network access.
Recommended resolution: Verify that the environment has internet connectivity; see https://canonical-craft-providers.readthedocs-hosted.com/en/latest/explanation/ for further reference.

Case 2 charm-openstack-service-checks:

$ git clone git@github.com:canonical/charm-openstack-service-checks.git
$ cd charm-openstack-service-checks

# This also run charmcraft pack
$ make build
Cleaning /home/jneo8/CanonicalProjects/charm-openstack-service-checks//openstack-service-checks*.charm files
Cleaning charmcraft                                                                                      
Building charm to base directory /home/jneo8/CanonicalProjects/charm-openstack-service-checks//openstack-service-checks.charm                                                                                     
Starting charmcraft, version 3.4.2                                                                       
Logging execution to '/home/jneo8/.local/state/charmcraft/log/charmcraft-20250211-160837.711984.log'
Launching managed ubuntu 22.04 instance...                                                               
Creating new instance from remote                                                                        
Creating new base instance from remote                                                                   
Failed to set hostname.                                                                                  
* Command that failed: 'lxc --project charmcraft exec local:base-instance-charmcraft-buildd-base-v7--910533fdd664bd2cdbe9 -- env CRAFT_MANAGED_MODE=1 CHARMCRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBC
ONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical hostname -F /etc/hostname'
* Command exit code: 1                                                                                   
* Command standard error output: b'hostname: the specified hostname is invalid\n'
Full execution log: '/home/jneo8/.local/state/charmcraft/log/charmcraft-20250211-160837.711984.log'
make: *** [Makefile:48: build] Error 1

Environment

Ubuntu 24.04

charmcraft.yaml

case1: https://github.com/canonical/charm-microceph/blob/main/charmcraft.yaml
case2: https://github.com/canonical/charm-openstack-service-checks/blob/main/charmcraft.yaml

Relevant log output

See above reproduce steps.
@jneo8 jneo8 added the Bug Something isn't working label Feb 11, 2025
@lengau lengau changed the title Failed to pack charm on 3.4.2 "Invalid hostname" error when packing charm Feb 11, 2025
@lengau lengau changed the title "Invalid hostname" error when packing charm "Invalid hostname" error when packing charm that runs on multiple bases Feb 11, 2025
@lengau lengau added the triaged label Feb 11, 2025
Copy link

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-4146.

This message was autogenerated

@lengau
Copy link
Collaborator

lengau commented Feb 11, 2025

Hi, thanks for the report!

I can't reproduce the issue with microceph (I would guess a re-run would have it working, or at the worst case a charmcraft clean followed by re-running), but the second item is fixed by canonical/craft-providers#722. I've made a local snap build that bumps craft-providers and makes it work, so I'll put that out on the candidate channel ASAP.

If you still face issues with the microceph charm after cleaning,, please chat with us on Matrix or open a new issue.

@jneo8
Copy link
Author

jneo8 commented Feb 12, 2025

Ah, I find out the microceph issue is relate to my environment have docker installed. Uninstall docker and restart fix the issue.

Sorry for cause distress and thanks for quick response on this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants