Odd error when packing
Metadata
Current evaluation
A typo in charmcraft caused a chown command to fail with a permission string. The author identified it should be chmod. The issue was closed, confirming the bug was fixed in charmcraft to resolve the packing error.
Suggested action: —
No scores available.
Issue body
### Bug Description
```
Launching managed ubuntu 24.04 instance... :: Starting instance - (5.2s)chown: invalid user: ‘a+rwx’
```
### To Reproduce
- checked out haproxy-operator
- ran `charmcraft pack`
### Environment
Ubuntu 24.04
### charmcraft.yaml
```yaml
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
type: charm
base: ubuntu@24.04
build-base: ubuntu@24.04
platforms:
amd64:
parts:
charm:
build-packages:
- build-essential
- python3-dev
- pkg-config
- libffi-dev
- libssl-dev
- git
build-snaps:
- rustup
override-build: |
rustup default stable
craftctl default
name: haproxy
title: HAProxy charm.
description: |
A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators)
deploying and managing [HAProxy](https://www.haproxy.org/) on machines.
HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high
availability environments. It features connection persistence through HTTP
cookies, load balancing, header addition, modification, deletion both ways. It
has request blocking capabilities and provides interface to display server
status.
This charm simplifies initial deployment and "day N" operations of HAProxy on
VMs and bare metal.
summary: Fast and reliable load balancing reverse proxy.
links:
documentation: https://discourse.charmhub.io/t/haproxy-documentation-overview/17216
issues: https://github.com/canonical/haproxy-operator/issues
source: https://github.com/canonical/haproxy-operator
contact:
- https://launchpad.net/~canonical-is-devops
assumes:
- juju >= 3.3
requires:
certificates:
interface: tls-certificates
limit: 1
reverseproxy:
interface: http
ha:
interface: hacluster
provides:
ingress:
interface: ingress
ingress-per-unit:
interface: ingress_per_unit
cos-agent:
interface: cos_agent
website:
interface: http
haproxy-route:
interface: haproxy-route
peers:
haproxy-peers:
interface: haproxy-peers
config:
options:
external-hostname:
default: ""
type: string
description: Hostname of HAProxy.
global-maxconn:
default: 4096
type: int
description: |
Sets the maximum per-process number of concurrent connections to
<number>. Must be greater than 0.
vip:
type: string
description: Virtual IP address, used in active-passive ha mode.
actions:
get-certificate:
description: Returns the TLS Certificate. Intended for testing and debugging purposes.
params:
hostname:
type: string
description: Hostname to extract certs from.
required:
- hostname
charm-libs:
- lib: traefik_k8s.ingress_per_unit
version: "1"
```
### Relevant log output
```shell
2025-08-01 14:10:06.364 Executing in container: lxc --project charmcraft exec local:charmcraft-haproxy-amd64-18484947 -- env CRAFT_MANAGED_MODE=1 CHARMCRAFT_DEBUG=False CHARMCRAFT_LXD_REMOTE=local CHARMCRAFT_LAUNCHPAD_INSTANCE=production CHARMCRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical chown a+rwx /tmp/craft-state
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | A typo in charmcraft caused a chown command to fail with a permission string. The author identified it should be chmod. The issue was closed, confirming the bug was fixed in charmcraft to resolve the packing error. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed after author identified chown was incorrectly used instead of chmod in the build script, causing the invalid user error during charmcraft pack. Resolved by correcting the command. | |
| qwen/qwen3.6-35b-a3b | — | — | The chown invalid user error during charmcraft pack resulted from a command typo. The issue was closed after the erroneous chown call was corrected to chmod in the build process. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The author reported a charmcraft pack failure caused by chown a+rwx and suspected a typo where chmod was intended. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed a typo in charmcraft's container execution script where chown was incorrectly used instead of chmod, resolving the invalid user error during charmcraft pack. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1931 Successfully pack charm with incorrect charm.py file permission | charmcraft | open | charmcraft pack succeeds even when src/charm.py lacks the execute bit, producing a charm that fails at deploy with 'Permission denied'. Requested a warning/error or auto-fix at pack time. No maintainer activity; an entrypoint linter now exists but only runs via charmcraft analyze, not pack. | |
| #497 charmcraft Pack is not Working | charmcraft | closed | Resolved via user environment fix. The permission error stemmed from running charmcraft as root with root-owned files. Switching to a regular user, adding them to the lxd group, and correcting ownership allowed pack to succeed. No code changes required. | |
| #1747 Failed to run the build script for part 'charm' | charmcraft | closed | Build script failure during charmcraft pack was resolved. The issue was closed after the maintainer acknowledged the report and merged the fix in PR #1751. | |
| #1070 Incorrect charm name listed in `Charms packed:` output after pack | charmcraft | closed | Author reported incorrect charm name in charmcraft pack output. After verifying the files were correct, the author closed the issue, stating it was a mistake and everything worked as expected. | |
| #907 `charmcraft pack` does not handle updating a file's execution permissions without a `charmcraft clean` | charmcraft | open | charmcraft pack ignores local file permission changes (e.g., chmod +x on src/charm.py) until a full charmcraft clean, causing confusing lint errors. Maintainer reproduced and filed upstream craft-parts#311; still unfixed. | |
| #501 charmcraft pack fails trying to include a non-existing charm/src/.tox/ | charmcraft | closed | charmcraft pack failed when copying non-existent build directories or files. Users worked around it with charmcraft clean. The issue was closed as fixed upstream in the underlying parts lifecycle code. |