Skip to content

[BUG] Cannot change ownership to uid xx, gid xx: Operation not permitted from "tar" libraries #338

Description

@sayan-biswas

Is there an existing issue for this?

  • I have searched the existing issues

Kubernetes Version

No response

Shipwright Version

v0.16

Current Behavior

While doing a local source build, the CLI throws the following error and the build fails.

2025/08/26 03:33:28 Creating a BuildRun for 'test/sample-buildah' Build...
2025/08/26 03:33:28 BuildRun 'sample-buildah-xfqpd' created!
Pod "sample-buildah-xfqpd-4jfmb-pod" is in state "Pending"...
Pod "sample-buildah-xfqpd-4jfmb-pod" is in state "Pending"...
Pod "sample-buildah-xfqpd-4jfmb-pod" is in state "Pending"...
Pod "sample-buildah-xfqpd-4jfmb-pod" is in state "Pending"...
Pod "sample-buildah-xfqpd-4jfmb-pod" in "Running" state, starting up log tail
Streaming "/Users/sayan/code/github.com/redhat-openshift-builds/samples/buildah" to the Build POD "sample-buildah-xfqpd-4jfmb-pod" ...
[prepare] 2025/08/25 22:03:29 Entrypoint initialization

Uploading local source... 100% [===============] (4.6 MB/s) tar: Dockerfile: Cannot change ownership to uid 501, gid 20: Operation not permitted
tar: entitled/Dockerfile: Cannot change ownership to uid 501, gid 20: Operation not permitted
tar: go.mod: Cannot change ownership to uid 501, gid 20: Operation not permitted
tar: main.go: Cannot change ownership to uid 501, gid 20: Operation not permitted
tar: Exiting with failure status due to previous errors
ERROR: command terminated with exit code 2

Expected Behavior

The build should successfully complete.

Steps To Reproduce

  1. Install Shipwright in Kind or Minikube cluster
  2. Install delivered cluster build strategies
  3. Install Shipwright CLI
  4. Create a Build with local source
shp build create sample-buildah \
--namespace="$BUILD_NAMESPACE" \
--request-timeout="10m" \
--strategy-kind="ClusterBuildStrategy" \
--strategy-name="buildah" \
--dockerfile="Dockerfile" \
--output-image="$OUTPUT_IMAGE" \
--retention-failed-limit=5 \
--retention-succeeded-limit=10
Created build "sample-buildah"
  1. Run build using shipwright CLI
shp build upload \                                                     
"$BUILD_NAME" \
"$SOURCE_DIR" --follow \
--namespace="$BUILD_NAMESPACE" \
--output-image="$OUTPUT_IMAGE"

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions