[JIRA] (JENKINS-56867) Jenkins does not allocate workspace for neither declarative pipeline nor scripted pipeline jobs

2 views
Skip to first unread message

szhemzhitski@gmail.com (JIRA)

unread,
Apr 3, 2019, 12:15:02 PM4/3/19
to jenkinsc...@googlegroups.com
Sergey Zhemzhitsky created an issue
 
Jenkins / Bug JENKINS-56867
Jenkins does not allocate workspace for neither declarative pipeline nor scripted pipeline jobs
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2019-04-03 16:14
Environment: *OS*
{code}
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
{code}
*JVM*
{code}
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
{code}
*Jenkins*
{code}
ver. 2.168
{code}
*Plugins*
{code}
Pipeline 2.6
Pipeline Graph Analysis Plugin 1.9
Pipeline Utility Steps 2.3.0
Pipeline: API 2.33
Pipeline: Basic Steps 2.15
Pipeline: Build Step 2.8
Pipeline: Declarative 1.3.7
Pipeline: Declarative Agent API 1.1.1
Pipeline: Declarative Extension Points API 1.3.7
Pipeline: Groovy 2.64
Pipeline: Input Step 2.10
Pipeline: Job 2.32
Pipeline: Milestone Step 1.3.1
Pipeline: Model API 1.3.7
Pipeline: Multibranch 2.21
Pipeline: Multibranch with defaults 2.0
Pipeline: Nodes and Processes 2.29
Pipeline: REST API Plugin 2.10
Pipeline: SCM Step 2.7
Pipeline: Shared Groovy Libraries 2.13
Pipeline: Stage Step 2.3
Pipeline: Stage Tags Metadata 1.3.7
Pipeline: Stage View Plugin 2.10
Pipeline: Step API 2.19
Pipeline: Supporting APIs 3.2
{code}
Priority: Critical Critical
Reporter: Sergey Zhemzhitsky

Pipeline jobs do not allocate workspace automatically

Steps to reproduce for scripted pipeline

  1. Create pipeline job
  2. Put the following script into "Pipeline Script" field
node {
   stage('Prepare') {
        echo "WS: ${pwd()}, EXISTS: ${new File(pwd()).exists()}"
        echo "WS_TMP: ${pwd(tmp: true)}: ${new File(pwd(tmp: true)).exists()}"
        echo "CWD: ${new File('.').absolutePath}"
        echo "USER_DIR: ${System.getProperty('user.dir')}"
   }
} 
  1. Uncheck "Use Groovy Sandbox" 
  2. Run the job

Expected result: workspace directory exists

Actual result: workspace directory does not exist

Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/jobs/automation/jobs/test2/workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Prepare)
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS: /var/lib/jenkins/jobs/automation/jobs/test2/workspace, EXISTS: false
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS_TMP: /var/lib/jenkins/jobs/automation/jobs/test2/workspace@tmp: false
[Pipeline] echo
CWD: /.
[Pipeline] echo
USER_DIR: /
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS 

 

Steps to reproduce for declarative pipeline

  1. Create pipeline job
  2. Put the following script into "Pipeline Script" field
 pipeline {
    agent any
    stages {
        stage ('Prepare') {
            steps {
                echo "WS: ${pwd()}, EXISTS: ${new File(pwd()).exists()}"
                echo "WS_TMP: ${pwd(tmp: true)}: ${new File(pwd(tmp: true)).exists()}"
                echo "CWD: ${new File('.').absolutePath}"
                echo "USER_DIR: ${System.getProperty('user.dir')}"
            }
        }
    }
}
  1. Uncheck "Use Groovy Sandbox" 
  2. Run the job

Expected result: workspace directory exists

Actual result: workspace directory does not exist

 Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/jobs/automation/jobs/test/workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Prepare)
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS: /var/lib/jenkins/jobs/automation/jobs/test/workspace, EXISTS: false
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS_TMP: /var/lib/jenkins/jobs/automation/jobs/test/workspace@tmp: false
[Pipeline] echo
CWD: /.
[Pipeline] echo
USER_DIR: /
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

szhemzhitski@gmail.com (JIRA)

unread,
Apr 3, 2019, 12:16:02 PM4/3/19
to jenkinsc...@googlegroups.com
Sergey Zhemzhitsky updated an issue
Change By: Sergey Zhemzhitsky
Pipeline jobs do not allocate workspace automatically

Steps to reproduce for *scripted pipeline*
# Create pipeline job
# Put the following script into "Pipeline Script" field

{code:java}

node {
   stage('Prepare') {
        echo "WS: ${pwd()}, EXISTS: ${new File(pwd()).exists()}"
        echo "WS_TMP: ${pwd(tmp: true)} , EXISTS : ${new File(pwd(tmp: true)).exists()}"

        echo "CWD: ${new File('.').absolutePath}"
        echo "USER_DIR: ${System.getProperty('user.dir')}"
   }
} {code}

# Uncheck "Use Groovy Sandbox" 
# Run the job


Expected result: workspace directory exists

Actual result: workspace directory does not exist
{code:java}

Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/jobs/automation/jobs/test2/workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Prepare)
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS: /var/lib/jenkins/jobs/automation/jobs/test2/workspace, EXISTS: false
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS_TMP: /var/lib/jenkins/jobs/automation/jobs/test2/workspace@tmp , EXISTS : false

[Pipeline] echo
CWD: /.
[Pipeline] echo
USER_DIR: /
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS {code}
 

Steps to reproduce for *declarative* *pipeline*
# Create pipeline job
# Put the following script into "Pipeline Script" field

{code:java}

pipeline {
    agent any
    stages {
        stage ('Prepare') {
            steps {
                echo "WS: ${pwd()}, EXISTS: ${new File(pwd()).exists()}"
                echo "WS_TMP: ${pwd(tmp: true)} , EXISTS : ${new File(pwd(tmp: true)).exists()}"

                echo "CWD: ${new File('.').absolutePath}"
                echo "USER_DIR: ${System.getProperty('user.dir')}"
            }
        }
    }
}{code}

# Uncheck "Use Groovy Sandbox" 
# Run the job


Expected result: workspace directory exists

Actual result: workspace directory does not exist
{code:java}

Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/jobs/automation/jobs/test/workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Prepare)
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS: /var/lib/jenkins/jobs/automation/jobs/test/workspace, EXISTS: false
[Pipeline] pwd
[Pipeline] pwd
[Pipeline] echo
WS_TMP: /var/lib/jenkins/jobs/automation/jobs/test/workspace@tmp , EXISTS : false

[Pipeline] echo
CWD: /.
[Pipeline] echo
USER_DIR: /
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS{code}

gopal.ahir@motorolasolutions.com (JIRA)

unread,
Mar 16, 2020, 4:46:02 AM3/16/20
to jenkinsc...@googlegroups.com
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages