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

The build fails when --inject parameter is used #1006

Closed
ochaloup opened this issue Nov 26, 2019 · 6 comments
Closed

The build fails when --inject parameter is used #1006

ochaloup opened this issue Nov 26, 2019 · 6 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@ochaloup
Copy link

ochaloup commented Nov 26, 2019

I used the s2i --inject parameter and the build fails with following error:
truncate: cannot open '/tmp/rm-injections' for writing: Permission denied

The "relate/end" part of the log with --log-level=5

...
I1126 16:16:24.623555   31760 install.go:261] Using "assemble" installed from "<source-dir>/.s2i/bin/assemble"
I1126 16:16:24.623584   31760 install.go:261] Using "run" installed from "image:///usr/local/s2i/run"
I1126 16:16:24.623603   31760 install.go:261] Using "save-artifacts" installed from "image:///usr/local/s2i/save-artifacts"
I1126 16:16:24.623620   31760 ignore.go:66] .s2iignore file does not exist
I1126 16:16:24.623627   31760 sti.go:213] Clean build will be performed
I1126 16:16:24.623637   31760 sti.go:216] Performing source build from .
I1126 16:16:24.623643   31760 sti.go:227] Running "assemble" in "quickstart-test"
I1126 16:16:24.623648   31760 sti.go:585] Using image name registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest
I1126 16:16:24.626086   31760 docker.go:490] Using locally available image "registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest"
I1126 16:16:24.626114   31760 sti.go:465] No user environment provided (no environment file found in application sources)
I1126 16:16:24.632253   31760 docker.go:793] Both scripts and untarred source will be placed in '/tmp'
I1126 16:16:24.632278   31760 docker.go:961] Setting "/bin/sh -c while [ ! -f \"/tmp/injection-result\" ]; do sleep 0.5; done; if [ -s \"/tmp/injection-result\" ]; then exit 1; fi; tar -C /tmp -xf - && /tmp/scripts/assemble; result=$?; . /tmp/rm-injections; exit $result" command for container ...
I1126 16:16:24.632344   31760 docker.go:970] Creating container with options {Name:"s2i_registry_proxy_engineering_redhat_com_rh_osbs_jboss_eap_7_tech_preview_eap_cd_openshift_rhel8_latest_4d85c145" Config:{Hostname: Domainname: User: AttachStdin:false AttachStdout:true AttachStderr:false ExposedPorts:map[] Tty:false OpenStdin:true StdinOnce:true Env:[] Cmd:[/bin/sh -c while [ ! -f "/tmp/injection-result" ]; do sleep 0.5; done; if [ -s "/tmp/injection-result" ]; then exit 1; fi; tar -C /tmp -xf - && /tmp/scripts/assemble; result=$?; . /tmp/rm-injections; exit $result] Healthcheck:<nil> ArgsEscaped:false Image:registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest Volumes:map[] WorkingDir: Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]} HostConfig:&{Binds:[] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode: PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] CapAdd:[] CapDrop:[] DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:67108864 Sysctls:map[] Runtime: ConsoleSize:[0 0] Isolation: Resources:{CPUShares:0 Memory:0 NanoCPUs:0 CgroupParent: BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CPURealtimePeriod:0 CPURealtimeRuntime:0 CpusetCpus: CpusetMems: Devices:[] DeviceCgroupRules:[] DiskQuota:0 KernelMemory:0 MemoryReservation:0 MemorySwap:0 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:0 Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMaximumBandwidth:0} Mounts:[] Init:<nil>}} ...
I1126 16:16:24.689739   31760 docker.go:1002] Attaching to container "a1f5ba5c50e6fb705f5f05847f921767cc9be69a532246415af4edc139a3e87f" ...
I1126 16:16:24.690926   31760 docker.go:1013] Starting container "a1f5ba5c50e6fb705f5f05847f921767cc9be69a532246415af4edc139a3e87f" ...
I1126 16:16:25.021714   31760 sti.go:735] starting the injections uploading ...
...
I1126 16:17:22.312019   31760 sti.go:715] INFO Copying deployments from target to /deployments...
I1126 16:17:22.314416   31760 sti.go:711] '/tmp/src/target/ROOT.war' -> '/deployments/ROOT.war'
I1126 16:17:22.319676   31760 sti.go:711] '/tmp/src/target/ROOT-sources.jar' -> '/deployments/ROOT-sources.jar'
I1126 16:17:22.327689   31760 sti.go:715] INFO Copying server to /s2i-output
I1126 16:17:22.533636   31760 sti.go:715] truncate: cannot open '/tmp/rm-injections' for writing: Permission denied
I1126 16:17:22.558419   31760 docker.go:1044] Waiting for container "a1f5ba5c50e6fb705f5f05847f921767cc9be69a532246415af4edc139a3e87f" to stop ...
I1126 16:17:22.888636   31760 docker.go:980] Removing container "a1f5ba5c50e6fb705f5f05847f921767cc9be69a532246415af4edc139a3e87f" ...
I1126 16:17:23.204488   31760 docker.go:990] Removed container "a1f5ba5c50e6fb705f5f05847f921767cc9be69a532246415af4edc139a3e87f"
I1126 16:17:23.205608   31760 cleanup.go:33] Removing temporary directory /tmp/s2i528084437
I1126 16:17:23.205618   31760 fs.go:314] Removing directory '/tmp/s2i528084437'
I1126 16:17:23.207740   31760 build.go:169] Build failed
E1126 16:17:23.207752   31760 errors.go:296] An error occurred: non-zero (13) exit code from registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest

I do run with JBoss EAP image where I build a mvn java application on top. The app is from here: https://github.com/jmesnil/wildfly-operator-quickstart
The command I use is

s2i  build --inject /tmp/repository:/opt/jboss/container/wildfly/s2i/galleon/galleon-m2-repository/ . registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest quickstart-test`

The /tmp/repository resides on my local machine and it contains the maven artifacts I want to inject to the s2i build.
The /opt/jboss/container/wildfly/s2i/galleon/galleon-m2-repository/ exists in the JBoss EAP image.

The /tmp directory seems to have right permissions

docker run -it --rm registry-proxy.engineering.redhat.com/rh-osbs/jboss-eap-7-tech-preview-eap-cd-openshift-rhel8:latest bash
$ ls -ld /tmp
drwxrwxrwt. 1 root root 4096 Nov 19 14:44 /tmp

My s2i version

/opt/s2i/s2i version
s2i v1.2.0

If I run the same without the --inject being used then all works fine. I simulated the "injection" of maven artifacts with the .s2i/bin/assemble script and that worked fine as well.

Could that be a misconfiguration or a bug in s2i?

@ochaloup ochaloup changed the title The build fails when using --inject parameter The build fails when --inject parameter is used Nov 26, 2019
@adambkaplan
Copy link
Contributor

@ochaloup which version of docker are you using alongside s2i?

@ochaloup
Copy link
Author

@adambkaplan hi. I'm on Fedora 30, the Docker version is 1.13.1, build 47e2230. My colleague @luck3y tried the same and had got the same troublesome experience with the command (just saying that I'm not alone with this :) but I'm not sure what Docker version he uses).

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 22, 2020
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 23, 2020
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants