[JIRA] (JENKINS-49691) FilePath.installIfNecessaryFrom always download even if target already exists

3 views
Skip to first unread message

cyril.marin@schneider-electric.com (JIRA)

unread,
Feb 22, 2018, 5:49:02 AM2/22/18
to jenkinsc...@googlegroups.com
Cyril MARIN created an issue
 
Jenkins / Bug JENKINS-49691
FilePath.installIfNecessaryFrom always download even if target already exists
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2018-02-22 10:48
Environment: 2.89.4 (lts)
Labels: jenkins tools
Priority: Minor Minor
Reporter: Cyril MARIN

FilePath.installIfNecessaryFrom, used from ZipExtractionInstaller, is designed to check if target already exists before downloading from remote URL. 

But I observe that every time I run the build job, the tool is downloaded from remote URL even if the files exists in local $JENKINS_HOME/tools directory.

No exception raised while processing.

 
Simple test pipeline to reproduce issue:

pipeline {
    agent any
    
    tools {
		maven "M3"
		jdk "JDK8_161"
	}

    stages {
        stage('Test') {
            steps {
                echo 'Testing..'
            }
        }
    }
}

*Job output logs for this example *:

[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/test
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Tool Install)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] tool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] envVarsForTool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] tool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] envVarsForTool
Unpacking https://<repo>.box.com/shared/static/rczslq4dc79l3ylhuoxhlje4kiu2iu7o.gz
to /var/jenkins_home/tools/hudson.model.JDK/JDK8_161 on Jenkins
[Pipeline] withEnv
[Pipeline] {
[Pipeline] echo
Testing..
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

Tools auto-installer configuration :

We can see that M3 is not downloaded because it's already existing in $JENKINS_HOME/tools
But JDK8_161 is downloaded every time I run the job.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

cyril.marin@schneider-electric.com (JIRA)

unread,
Feb 22, 2018, 6:00:03 AM2/22/18
to jenkinsc...@googlegroups.com
Cyril MARIN commented on Bug JENKINS-49691
 
Re: FilePath.installIfNecessaryFrom always download even if target already exists

A little précision :

My tools are hosted on a Box.com repository with a public static URL.

Maybe there is a trouble with Box hosting. Http headers may not contain "last-modified" for some reason.

 

o.v.nenashev@gmail.com (JIRA)

unread,
Mar 3, 2018, 9:38:02 PM3/3/18
to jenkinsc...@googlegroups.com

charanbir7@gmail.com (JIRA)

unread,
Nov 10, 2018, 6:37:02 PM11/10/18
to jenkinsc...@googlegroups.com
C R commented on Bug JENKINS-49691
 
Re: FilePath.installIfNecessaryFrom always download even if target already exists

Hi Cyril MARIN

I looked at the code and you're right. The "last-modified" http header is missing.

Now, we could add a condition to check if the "file exists locally and http header missing" then skip download, but this is wrong because if the remote file is updated, Jenkins will not download the fresh copy and assume we already have the updated copy.

So I think this issue should be closed since the problem lies outside Jenkins.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

samhrncir@gmail.com (JIRA)

unread,
Dec 15, 2019, 11:04:02 AM12/15/19
to jenkinsc...@googlegroups.com
Sam Hrncir assigned an issue to Sam Hrncir
 
Change By: Sam Hrncir
Assignee: Sam Hrncir
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

samhrncir@gmail.com (JIRA)

unread,
Apr 30, 2020, 10:41:02 AM4/30/20
to jenkinsc...@googlegroups.com
Sam Hrncir assigned an issue to Unassigned
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages