[Newbie] Declarative Pipeline agent/docker directive causing script.sh not found error

125 views
Skip to first unread message

Calvin

unread,
Apr 24, 2018, 4:06:35 PM4/24/18
to Jenkins Developers
New Item > Pipeline > Pipeline script
pipeline {
    agent { docker 'maven:3-alpine' } 
    stages {
        stage('Example Build') {
            steps {
                sh 'mvn -B clean verify'
            }
        }
    }
}

Error:
Started by user Calvin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on slave_0 in /home/<user>/jenkins_slave_home/workspace/pipeline
[Pipeline] {
[Pipeline] sh
[pipeline] Running shell script
sh: 1: /home/<user>/jenkins_slave_home/workspace/pipeline@tmp/durable-3bd01f9f/script.sh: not found
[Pipeline] sh
[pipeline] Running shell script
sh: 1: /home/<user>/jenkins_slave_home/workspace/pipeline@tmp/durable-354b1658/script.sh: not found
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE

slave_0 is a permanent slave with Docker installed
Started by user Calvin
[EnvInject] - Loading node environment variables.
Building remotely on slave_0 (baremetal) in workspace /home/<user>/jenkins_slave_home/workspace/docker
[docker] $ bash -xe /tmp/jenkins1148677992452394167.sh
+ docker info
Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 1.13.1
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version:  (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: N/A (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-116-generic
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.41 GiB
Name: U1604
ID: UCTV:IJWJ:ZTGQ:P46U:OBFB:WP2L:2U66:AM4G:KOSP:PVDX:MRGC:HDGK
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: false
Finished: SUCCESS

It seems like I'm missing something very basic... I'd appreciate your help.

Baptiste Mathus

unread,
Apr 27, 2018, 5:40:23 AM4/27/18
to Jenkins Developers
Please use the users ML for this kind of questions.
Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8e98f725-fe98-4e5b-8167-e34fbc094fb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages