[JIRA] (JENKINS-58609) Copy existing job does not clone the repository

22 views
Skip to first unread message

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 1:56:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
 
Jenkins / Bug JENKINS-58609
Copy existing job does not clone the repository
Change By: Long Nguyen
Summary: CLONE - Copy existing job does not clone the repository
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 1:56:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
Change By: Long Nguyen
Environment: Windows server 2008, direct with no other software (for example tomcat) Jenkins Docker

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:15:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
* Steps to reproduce: *
*- Use API:*

1 ) press create . Create new job item named CLONE_ITEM based on BASE_ITEM
2) http://localhost:8080/createItem/?name=CLONE_ITEM&mode= copy existing &from=BASE_ITEM
2. Execute 
http://localhost:8080/
job and type the /CLONE_ITEM/build/api/json
 
-> "java.io.IOException: CLONE_ITEM is not buildable" exception appears


*- Use console:*

1. Create new
job name CLONE_ITEM
2. Copy existing job BASE_ITEM
3 ) copied . Copied job config window appears
4
) . DO NOT PRESS APPLY OR SAVE, press workspace
5
) press . "Run a build" link doesn't display on sidebar.
6. Run below 
now  [http://localhost:8080/job/CLONE_ITEM/build?delay=0sec ++ |http://localhost:8080/job/BASE/build?delay=0sec]

->
java.io.IOException: job_name CLONE_ITEM is not buildable exeption appears

if If you press save "Save or apply " it will build the project. This affects the graddle plugin also since if it is configured to copy the job jenkins Jenkins does not build it until settings are saved for the first time.

This happens atleast when using the git I haven't tried with other version control softwares.

http
[https ://pastebin.com/ WvsCYwXr Cq31eSeq] here is the complete exception

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:16:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
*Steps to reproduce:*
*
- Use API:*

1. Create new job item named CLONE_ITEM based on BASE_ITEM
[ http://localhost:8080/createItem/?name=CLONE_ITEM&mode=copy&from=BASE_ITEM ]
2. Execute 
[ http://localhost:8080/job/CLONE_ITEM/build/api/json ]
 
-> "java.io.IOException: CLONE_ITEM is not buildable" exception appears


* - Use console:*


1. Create new job name CLONE_ITEM
2. Copy existing job BASE_ITEM
3. Copied job config window appears
4. DO NOT PRESS APPLY OR SAVE, press workspace
5. "Run a build" doesn't display on sidebar.
6. Run below 
-> java.io.IOException: CLONE_ITEM is not buildable exeption appears

If you press "Save or apply" it will build the project. This affects the graddle plugin also since if it is configured to copy the job Jenkins does not build it until settings are saved for the first time.


[https://pastebin.com/Cq31eSeq] here is the complete exception

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:17:01 AM7/23/19
to jenkinsc...@googlegroups.com

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:19:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
* Jenkins Information:*
- Pure Jenkins
- Version: [Jenkins ver. 2.176.1|https://jenkins.io/]
- Jenkins Docker

*
Steps to reproduce:*
*
- Use API:*


1. Create new job item named CLONE_ITEM based on BASE_ITEM
[http://localhost:8080/createItem/?name=CLONE_ITEM&mode=copy&from=BASE_ITEM]
2. Execute 
[http://localhost:8080/job/CLONE_ITEM/build/api/json]
 
-> "java.io.IOException: CLONE_ITEM is not buildable" exception appears


* - Use console:*

1. Create new job name CLONE_ITEM
2. Copy existing job BASE_ITEM
3. Copied job config window appears
4. DO NOT PRESS APPLY OR SAVE, press workspace
5. "Run a build" doesn't display on sidebar.
6. Run below 
 [http://localhost:8080/job/CLONE_ITEM/build?delay=0sec ++ |http://localhost:8080/job/BASE/build?delay=0sec]

-> java.io.IOException: CLONE_ITEM is not buildable exeption appears

If you press "Save or apply" it will build the project. This affects the graddle plugin also since if it is configured to copy the job Jenkins does not build it until settings are saved for the first time.

[https://pastebin.com/Cq31eSeq] here is the complete exception

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:20:02 AM7/23/19
to jenkinsc...@googlegroups.com

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:21:02 AM7/23/19
to jenkinsc...@googlegroups.com
Long Nguyen updated an issue
*Jenkins Information:*

- Pure Jenkins
- Version: [Jenkins ver. 2.176.1|https://jenkins.io/]
- Jenkins Docker



*Steps to reproduce:*
*・ Use API:*


1. Create new job item named CLONE_ITEM based on BASE_ITEM
[http://localhost:8080/createItem/?name=CLONE_ITEM&mode=copy&from=BASE_ITEM]
2. Execute 
[http://localhost:8080/job/CLONE_ITEM/build/api/json]
 
-> "java.io.IOException: CLONE_ITEM is not buildable" exception appears


*・ Use console:*


1. Create new job name CLONE_ITEM
2. Copy existing job BASE_ITEM
3. Copied job config window appears
4. DO NOT PRESS APPLY OR SAVE, press workspace
5. "Run a build" doesn't display on sidebar.
6. Run below 
 [http://localhost:8080/job/CLONE_ITEM/build?delay=0sec ++ |http://localhost:8080/job/BASE/build?delay=0sec]

-> java.io.IOException: CLONE_ITEM is not buildable exeption appears

If you press "Save or apply" it will build the project. This affects the graddle plugin also since if it is configured to copy the job Jenkins does not build it until settings are saved for the first time.

[https://pastebin.com/Cq31eSeq] here is the complete exception


This bug has been reported once in https://issues.jenkins-ci.org/browse/JENKINS-19635

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:24:03 AM7/23/19
to jenkinsc...@googlegroups.com


*Expect:*

Could execute cloned job without Save or apply config through console.

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 3:18:02 AM7/23/19
to jenkinsc...@googlegroups.com
Could execute cloned job via REST API without Save or apply config through console.

dbeck@cloudbees.com (JIRA)

unread,
Jul 23, 2019, 3:50:04 AM7/23/19
to jenkinsc...@googlegroups.com
Daniel Beck assigned an issue to Unassigned
Change By: Daniel Beck
Assignee: Daniel Beck

dbeck@cloudbees.com (JIRA)

unread,
Jul 23, 2019, 3:53:02 AM7/23/19
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-58609
 
Re: Copy existing job does not clone the repository

The steps described in "Use console" are why this behavior exists, it is deliberate. This prevents clones of jobs that are building automatically from building before a user had a chance to change configuration options, since we expect there should be changes.

I am not sure that the same should apply to the API, hence the "Use API" section is legitimate.

dbeck@cloudbees.com (JIRA)

unread,
Jul 23, 2019, 3:53:02 AM7/23/19
to jenkinsc...@googlegroups.com
Daniel Beck edited a comment on Bug JENKINS-58609
The steps described in "Use console" are why this behavior exists, it is deliberate. This prevents clones of jobs that are building automatically from building before a user had a chance to change configuration options, since we expect there should be changes.

I am not sure that the same should apply to the API, hence the "Use API" section is likely legitimate.

zcmgyu@gmail.com (JIRA)

unread,
Jul 23, 2019, 8:54:02 PM7/23/19
to jenkinsc...@googlegroups.com

Thank Daniel Beck. I think "Use API" should be fixed, it doesn't mean if you couldn't do anything on job which has just created.

dbeck@cloudbees.com (JIRA)

unread,
Jul 24, 2019, 2:54:02 AM7/24/19
to jenkinsc...@googlegroups.com

As a workaround, round-trip the config.xml once (first GET then POST) and it should be cleared up. This might end up simply needing to be documented.

zcmgyu@gmail.com (JIRA)

unread,
Jul 24, 2019, 6:20:01 AM7/24/19
to jenkinsc...@googlegroups.com

Thanks, Daniel. I've been using this workaround in my project as well.

Reply all
Reply to author
Forward
0 new messages