[HAP-898] Upload files to artifactory not working on 2.9.2 Created: 27/Mar/17  Updated: 31/Mar/17

Status: Open
Project: Jenkins Artifactory Plug-in
Component/s: Common
Affects Version/s: 2.9.2
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Ricardf Assignee: Eyal Ben Moshe
Resolution: Unresolved Votes: 0
Labels: artifactory, artifacts, jenkins
Environment:

Jenkins 2.19.1
Windows server 2012 R2



 Description   

We were using version 2.9.0 and everything was working fine.

We basically upload files to artifactory using jenkins pipeline with a really simple code using patterns.

We are using an uploadspec to define the full path of the file we want to download:

		def uploadSpec  = """
		{
			"files": [
				{
					"pattern": "${pPattern}",
					"target": "${pTarget}",
                                         "props": "${propsString}"
				}
			]
		}"""
                buildInfoDeployed= pServer.upload(uploadSpec)

While having this problem with tried to change slahes and backslashes to the same format to see if it was a problem with the path, but nothing worked (we tried c:\file.txt c:/file.txt).

At the same time we are archiving the files in jenkins and this is working fine, so the files exist and path is correct.

We changed to 2.9.0 again and everything started working fine.

Update:

Hello, we don't have the environment as we had to rollback the whole machine, basically the log on the job was:

C:\Program Files (x86)\Jenkins\TasksService\jobs\Project\jobs\ContinuousIntegration\jobs\NightlyBuild\workspace>copy "N:\Deliverables\Packages\OriginalFolder\OriginalFile.zip" "C:/Program Files (x86)/Jenkins/TasksService/jobs/Project/jobs/ContinuousIntegration/jobs/NightlyBuild/workspace/1147260651/filetocopy-0.0.0.1.zip" 
1 file(s) copied.
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] echo
Artifactory Publish project-build/nightlybuild/Main/0.0.0.1/deliverables/filetocopy-0.0.0.1.zip from 1147260651/filetocopy-0.0.0.1.zip
[Pipeline] newArtifactoryServer
[Pipeline] newBuildInfo
[Pipeline] collectEnv
[Pipeline] fileExists
[Pipeline] echo
Archiving 1147260651/filetocopy-0.0.0.1.zip
[Pipeline] artifactoryUpload
For pattern: 1147260651/filetocopy-0.0.0.1.zip 0 artifacts were found.

The file exist as the local jenkins archiving works and the if file.exist works... and the same code on version 2.9.0 works too.
As you can see the path to upload is used using /.



 Comments   
Comment by Eyal Ben Moshe [ 27/Mar/17 ]

Can you please share with us the values of "${pPattern}" and "${pTarget}", so that we can reproduce this issue?

Comment by Eyal Ben Moshe [ 28/Mar/17 ]

In addition to my previous question, can you please also share your build logs?
Thanks

Comment by Dima Nevelev (Inactive) [ 29/Mar/17 ]

@Ricardf We aware of a problem with uploading files from root drive on Windows OS. Because of this your debug patterns (c:\file.txt and c:/file.txt) did not work.
Please provide us the original pPatern and the build logs, so that we can reproduce this issue.

Comment by Ricardf [ 31/Mar/17 ]

Hello, we don't have the environment as we had to rollback the whole machine, basically the log on the job was:

{{C:\Program Files (x86)\Jenkins\TasksService\jobs\Project\jobs\ContinuousIntegration\jobs\NightlyBuild\workspace>copy "N:\Deliverables\Packages\OriginalFolder\OriginalFile.zip" "C:/Program Files (x86)/Jenkins/TasksService/jobs/Project/jobs/ContinuousIntegration/jobs/NightlyBuild/workspace/1147260651/filetocopy-0.0.0.1.zip"
1 file(s) copied.
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] echo
Artifactory Publish project-build/nightlybuild/Main/0.0.0.1/deliverables/filetocopy-0.0.0.1.zip from 1147260651/filetocopy-0.0.0.1.zip
[Pipeline] newArtifactoryServer
[Pipeline] newBuildInfo
[Pipeline] collectEnv
[Pipeline] fileExists
[Pipeline] echo
Archiving 1147260651/filetocopy-0.0.0.1.zip
[Pipeline] artifactoryUpload
For pattern: 1147260651/filetocopy-0.0.0.1.zip 0 artifacts were found.}}

The file exist as the local jenkins archiving works and the if file.exist works... and the same code on version 2.9.0 works too.

As you can see the path to upload is used using /.

Generated at Sun Jan 19 11:16:39 UTC 2020 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.