httpRequest does not return result in parameters's Groovy script

2020-06-15 Thread Gajanan Mahajan
If I make following http request in pipeline code it returns result for 
`response.status`

def response = httpRequest authentication: '', url: 
''

However if same code is passed to Groovy script of pipeline parameter, it 
returns nothing and also no error is seen.

Please help on how I can make it to work in Grooy script of pipeline 
parameter

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e8db90c5-1940-4a30-9af8-730be5ffc5e4o%40googlegroups.com.


Unable to run Selenium tests on CentOS through Xvfb

2020-06-15 Thread Gajanan Mahajan
I'm running Selenium tests on `CentOS 7` machine through Jenkins pipeline 
hence using `Xvfb`. When use `screen` argument with any valid value like 
following -

wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x8']) { 
   
}

It results into following error -



[testng] org.openqa.selenium.WebDriverException: chrome not reachable

   [testng]   (Session info: chrome=80.0.3987.132)

   [testng]   (Driver info: chromedriver=80.0.3987.16 
(320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux
 
3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any 
stacktrace information)

   [testng] Command duration or timeout: 0 milliseconds

   [testng] Build info: version: '3.14.0', revision: 'aae0', time: 
'2018-08-02T20:13:22.693Z'

   [testng] System info: host: 'nxicentbi136151', ip: 
'192.168.136.151', os.name: 'Linux', os.arch: 'amd64', os.version: 
'3.10.0-862.el7.x86_64', java.version: '1.8.0_181'

If we run it without `screen` argument it runs successfully.

One more observation - with `screen` argument, it perfectly works on 
`Ubuntu 18`

Please help me how I can run Selenium tests with `screen` argument on 
`CentOS 7`.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e74f5a12-c139-4976-91a1-f5817985056do%40googlegroups.com.


Unable to run Selenium tests on CentOS through Xvfb

2020-06-15 Thread Gajanan Mahajan
I'm running Selenium tests on `CentOS 7` machine through Jenkins pipeline 
hence using `Xvfb`. When use `screen` argument with any valid value like 
following -

wrap([$class: 'Xvfb', autoDisplayName: true, screen: '1440x800x8']) { 
   
}

It results into following error -



[testng] org.openqa.selenium.WebDriverException: chrome not reachable

   [testng]   (Session info: chrome=80.0.3987.132)

   [testng]   (Driver info: chromedriver=80.0.3987.16 
(320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux
 
3.10.0-862.el7.x86_64 x86_64) (WARNING: The server did not provide any 
stacktrace information)

   [testng] Command duration or timeout: 0 milliseconds

   [testng] Build info: version: '3.14.0', revision: 'aae0', time: 
'2018-08-02T20:13:22.693Z'



If we run it without `screen` argument it runs successfully.

One more observation - with `screen` argument, it perfectly works on 
`Ubuntu 18`

Please help me how I can run Selenium tests with `screen` argument on 
`CentOS 7`.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c3ebeb4d-ddfb-4b5c-afdf-1e6bdf59194bo%40googlegroups.com.


jenkins agent definition loaded from a jenkins library

2020-06-15 Thread Marco Sacchetto
Hi,

I'm currently using a Jenkins declarative pipeline (note: if my issue would 
be solved with a scripted pipeline, I can switch).
The builds run inside an ephemeral docker agent spinned up by the pipeline 
using a syntax similar to

agent{ docker{ image "my-image"}}}

The issue with that is that I'm going to have a big number of pipelines 
defined as Jenkinsfiles which are all kind of similar
to each other, and all of them will be running using the same docker agent.
As such, I'd love to be able to parameterise the image name by defining it 
as a variable or as a function inside a jenkins
library, so that if the image needs to be change I don't have to commit 
back to all of the existing Jenkinsfile.

I saw it's possible to define the whole declarative pipeline inside a 
function, but there seems to be no option to set instead 
just some String variable to be used when setting up the agent, and no 
possibility to define anything to run outside of the
normal pipeline steps - is that correct?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/290526ae-a190-4a13-a779-6039c8d6775eo%40googlegroups.com.


Re: jenkins agent definition loaded from a jenkins library

2020-06-15 Thread Gianluca
Hi,
I'm not entirely sure what are you looking for but I want to tell you that 
you can use variables as image name, or at least you can do for agent 
labels:

agent{ label "${builder.label" }

We use the above in our pipelines to have different agents depending on the 
branch and PR number and other environment factors.

Cheers,
Gianluca.


On Monday, 15 June 2020 13:20:05 UTC+1, Marco Sacchetto wrote:
>
> Hi,
>
> I'm currently using a Jenkins declarative pipeline (note: if my issue 
> would be solved with a scripted pipeline, I can switch).
> The builds run inside an ephemeral docker agent spinned up by the pipeline 
> using a syntax similar to
>
> agent{ docker{ image "my-image"}}}
>
> The issue with that is that I'm going to have a big number of pipelines 
> defined as Jenkinsfiles which are all kind of similar
> to each other, and all of them will be running using the same docker agent.
> As such, I'd love to be able to parameterise the image name by defining it 
> as a variable or as a function inside a jenkins
> library, so that if the image needs to be change I don't have to commit 
> back to all of the existing Jenkinsfile.
>
> I saw it's possible to define the whole declarative pipeline inside a 
> function, but there seems to be no option to set instead 
> just some String variable to be used when setting up the agent, and no 
> possibility to define anything to run outside of the
> normal pipeline steps - is that correct?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/95d98d96-f65f-4519-8c16-751ab6e746e6o%40googlegroups.com.


Re: Multi-line parameter description in declarative pipeline

2020-06-15 Thread Al Silver
If I remove the spaces/tab at the beginning of the line, I'm left with 
"ugly" code that's not maintaining indentations...  Thx


On Friday, June 12, 2020 at 10:20:13 PM UTC-4, slide wrote:
>
> The triple quote strings are taken as is, so just remove the tabs/spaces 
> at the start of the lines.
>
> On Fri, Jun 12, 2020, 08:29 Al Silver > 
> wrote:
>
>> Hi,
>>   How can I have a detailed description field that is properly displayed 
>> when building with parameters.  The example below is obviously not good 
>> coding practice
>>
>> parameters {
>> // Optional //
>>
>> string(name: 'isis_thresh', defaultValue: '',
>> description: 'Threshold for ISIS Nbr last_state_change 
>> in format of 4h25s (e.g., 40s, 5m40s, 3h5m40s, 2d, 4w2d). Neighbor uptimes 
>> that are less than this value will be flagged as an error.')
>>
>>
>> }
>>
>> I'd like to do something like this but then the output when building the 
>> job contains the tabs and looks bad... I'd like each of the lines in the 
>> output to display against the left hand margin.
>>
>> parameters {
>>
>> string(name: 'isis_thresh', defaultValue: '',
>> description: '''Threshold for ISIS Nbr last_state_change 
>> in
>> format of 4h25s (e.g., 40s, 5m40s, 
>> 3h5m40s, 2d, 4w2d).
>> Neighbor uptimes that are less than this 
>> value will
>> be flagged as an error.''')
>>
>> }
>>
>> Thx
>> Al
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/cf6402d1-6a01-4ed3-a244-445366836ecfo%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81bedba2-b5e9-45a7-8ed2-fda38a1e53b6o%40googlegroups.com.


Re: jenkins agent definition loaded from a jenkins library

2020-06-15 Thread Marco Sacchetto
Thanks Gianluca, that actually works. I missed the bit of information 
regarding the annotation that needs to go on variables inside the library 
to make them global!

Il giorno lunedì 15 giugno 2020 13:28:33 UTC+1, Gianluca ha scritto:
>
> Hi,
> I'm not entirely sure what are you looking for but I want to tell you that 
> you can use variables as image name, or at least you can do for agent 
> labels:
>
> agent{ label "${builder.label" }
>
> We use the above in our pipelines to have different agents depending on 
> the branch and PR number and other environment factors.
>
> Cheers,
> Gianluca.
>
>
> On Monday, 15 June 2020 13:20:05 UTC+1, Marco Sacchetto wrote:
>>
>> Hi,
>>
>> I'm currently using a Jenkins declarative pipeline (note: if my issue 
>> would be solved with a scripted pipeline, I can switch).
>> The builds run inside an ephemeral docker agent spinned up by the 
>> pipeline using a syntax similar to
>>
>> agent{ docker{ image "my-image"}}}
>>
>> The issue with that is that I'm going to have a big number of pipelines 
>> defined as Jenkinsfiles which are all kind of similar
>> to each other, and all of them will be running using the same docker 
>> agent.
>> As such, I'd love to be able to parameterise the image name by defining 
>> it as a variable or as a function inside a jenkins
>> library, so that if the image needs to be change I don't have to commit 
>> back to all of the existing Jenkinsfile.
>>
>> I saw it's possible to define the whole declarative pipeline inside a 
>> function, but there seems to be no option to set instead 
>> just some String variable to be used when setting up the agent, and no 
>> possibility to define anything to run outside of the
>> normal pipeline steps - is that correct?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e2459c41-d905-4d1f-8f15-bcc76951a5eco%40googlegroups.com.


Re: Multi-line parameter description in declarative pipeline

2020-06-15 Thread 'Björn Pedersen' via Jenkins Users


Am Montag, 15. Juni 2020 14:45:42 UTC+2 schrieb Al Silver:
>
> If I remove the spaces/tab at the beginning of the line, I'm left with 
> "ugly" code that's not maintaining indentations...  T
>


Not remove from the source, but from the assigment value:

"""
   -...
  -
""..stripIndent()

 

>
> On Friday, June 12, 2020 at 10:20:13 PM UTC-4, slide wrote:
>>
>> The triple quote strings are taken as is, so just remove the tabs/spaces 
>> at the start of the lines.
>>
>> On Fri, Jun 12, 2020, 08:29 Al Silver  wrote:
>>
>>> Hi,
>>>   How can I have a detailed description field that is properly displayed 
>>> when building with parameters.  The example below is obviously not good 
>>> coding practice
>>>
>>> parameters {
>>> // Optional //
>>>
>>> string(name: 'isis_thresh', defaultValue: '',
>>> description: 'Threshold for ISIS Nbr last_state_change 
>>> in format of 4h25s (e.g., 40s, 5m40s, 3h5m40s, 2d, 4w2d). Neighbor uptimes 
>>> that are less than this value will be flagged as an error.')
>>>
>>>
>>> }
>>>
>>> I'd like to do something like this but then the output when building the 
>>> job contains the tabs and looks bad... I'd like each of the lines in the 
>>> output to display against the left hand margin.
>>>
>>> parameters {
>>>
>>> string(name: 'isis_thresh', defaultValue: '',
>>> description: '''Threshold for ISIS Nbr 
>>> last_state_change in
>>> format of 4h25s (e.g., 40s, 5m40s, 
>>> 3h5m40s, 2d, 4w2d).
>>> Neighbor uptimes that are less than this 
>>> value will
>>> be flagged as an error.''')
>>>
>>> }
>>>
>>> Thx
>>> Al
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jenkins...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/cf6402d1-6a01-4ed3-a244-445366836ecfo%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/073d2ecd-b05c-4952-bad9-346916dd7ffbo%40googlegroups.com.


Using nvm in build shell script causes 'No such file or directory' error

2020-06-15 Thread Martin Baillie
Hi,

I'm using Jenkins to build a Cordova project. 

Recently I've upgraded the Jenkins server (a MacMini running Mojave) from a 
standard node install to use NVM.

I'd like to call nvm from within the build script I call from Jenkins' 
Build > Execute Shell option.

However when I reference nvm from within the script (see below examples) I 
get the error 'No such file or directory'.

nvm use

or

. ~/.nvm/nvm.sh

nvm use

or

source /path/to/.nvm/nvm.sh

nvm use

I can run the script directly from the server's terminal with no error, NVM 
is sourced within ~/.profile, .profile is sourced within ~/.bashrc and 
.bashrc is sourced within ~/.bash_profile.

I am aware of the NVMWrapper plugin, but am avoiding that for the time 
being due to not being certain it will work with my current version of 
Jenkins and I'd rather not break Jenkins as our resident Jenkins expert is 
currently unavailable.







-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8327acbe-4806-46c0-836a-36b72f60e82ao%40googlegroups.com.


Re: NVM on Jenkins

2020-06-15 Thread Martin Baillie
Hi, I am having a similar issue. Did you manage to find a solution?

On Tuesday, 19 May 2020 13:13:22 UTC+1, hawk base wrote:
>
> 1) How to install NVM on the Jenkins Slave?
>
> 2) How can we make the jobs to use that NVM so that we can install 
> multiple NodeJS / NPM version?
>
> Note: I am trying to follow this URL: 
> https://github.com/nvm-sh/nvm/blob/master/README.md#install--update-script 
> but 
> not able to understand as how it can be done on Jenkins and make use of the 
> job to use NVM.
>
>
> Note: I can't use NVM Wrapper or NodeJs as I don't have Manage Jenkins 
> Permissions.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/bb4829fd-5761-42ab-a395-bee3a6cc8724o%40googlegroups.com.


Re: Files sourced on pipeline shell step

2020-06-15 Thread Martin Baillie
 I'm experiencing a similar issue, did you find a solution?

On Wednesday, 9 January 2019 09:19:25 UTC, Kamil Dzierżanowski wrote:
>
> Hello,
>
> I'm trying to determine, which (if any) files are sourced by the shell, in 
> which commands specified in "sh" pipeline step are executed. I need to make 
> sure the NVM (Node Version Manager) is sourced everytime this step is used.
> I tried numerous dot-files for the user the Jenkins agent is using, as 
> well as the /etc/profile, but none works. I'll be grateful for any hints or 
> for pointing me to an existing answer (I failed to find any).
>
> Kamil
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/047cc8df-748e-4e4d-a119-bca7bf828dcbo%40googlegroups.com.


Re: Multi-line parameter description in declarative pipeline

2020-06-15 Thread Al Silver
Below code does not work and just throws an error when I try to run it.  
I've seen examples of stripIndent but I have not been able to find a 
working example used inside the parameters block with declarative 
pipeline...

parameters {

string(name: 'limit', defaultValue: '',
description: '''Limit the nodes to test against instead of 
testing against all nodes defined in the topology file.
Comma seperated list of device names. (e.g, 
dc21,ph22,sf21)
Names must be 4 character shortcut used in 
/etc/hosts file.'''.stripIndent())

}

Here is the error when running the job.  Note, there are several other 
parameters defined the parameters block but I removed them to not clutter 
the explanation...All works well if removing the stripIndent() method.

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 43: Expected a symbol @ line 43, column 30.
   description: '''Limit the nodes to test against instead of 
testing against all nodes defined in the topology file.
^

WorkflowScript: 43: "error" should have 1 arguments but has 0 arguments 
instead. @ line 43, column 30.
   description: '''Limit the nodes to test against instead of 
testing against all nodes defined in the topology file.
^

WorkflowScript: 43: "error" should have 1 arguments but has 0 arguments 
instead. @ line 43, column 30.
   description: '''Limit the nodes to test against instead of 
testing against all nodes defined in the topology file.
^

3 errors

at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at 
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
at 
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
at 
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:337)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:428)
Finished: FAILURE






On Monday, June 15, 2020 at 10:17:21 AM UTC-4, Björn Pedersen wrote:
>
>
>
> Am Montag, 15. Juni 2020 14:45:42 UTC+2 schrieb Al Silver:
>>
>> If I remove the spaces/tab at the beginning of the line, I'm left with 
>> "ugly" code that's not maintaining indentations...  T
>>
>
>
> Not remove from the source, but from the assigment value:
>
> """
>-...
>   -
> ""..stripIndent()
>
>  
>
>>
>> On Friday, June 12, 2020 at 10:20:13 PM UTC-4, slide wrote:
>>>
>>> The triple quote strings are taken as is, so just remove the tabs/spaces 
>>> at the start of the lines.
>>>
>>> On Fri, Jun 12, 2020, 08:29 Al Silver  wrote:
>>>
 Hi,
   How can I have a detailed description field that is properly 
 displayed when building with parameters.  The example below is obviously 
 not good coding practice

 parameters {
 // Optional //

 string(name: 'isis_thresh', defaultValue: '',
 description: 'Threshold for ISIS Nbr last_state_change 
 in format of 4h25s (e.g., 40s, 5m40s, 3h5m40s, 2d, 4w2d). Neighbor uptimes 
 that are less than this value will be flagged as an error.')


 }

 I'd like to do something like this but then the output when building 
 the job contains the tabs and looks bad... I'd like each of the lines in 
 the output to display against the left hand margin.

 parameters {

 string(name: 'isis_thresh', defaultValue: '',
 description: '''Threshold for ISIS Nbr 
 last_state_change in
 format of 4h25s (e.g., 40s, 5m40s, 
 3h5m40s, 2d, 4w2d).
 Neighbor uptimes that are less than 
 this value will
 be flagged as an error.''')

 }

 Thx

Re: git checkout failed with exception reference is not a tree

2020-06-15 Thread Arunachalam Sibisakkaravarthi
Hi Mark, I share the information you requested.

  We have a BitBucket Webhook to notify Jenkins to build this 
Multibranch pipeline
   
*Answers for your questions:*

   - We use BitBucket Branch Source plugin in our Multibranch pipeline
   - This commit is present in the project repository
   - When a single commit was pushed, we didn’t face this issue but when 
   more than N commits were pushed, this problem occurred consistently
   - Enabled "Call can merge" option to solve the problem, but it didn't 
   solve.

*Observations*:

   - The pipeline failed during “checkout” itself with this error  
   - We found that the same commit was built successfully when the 
   Multibranch pipeline was indexed and scanned.
   - However when that individual feature branch was built manually, the 
   checkout failed.
   
Thanks Mark for reply. Please let me know if you need any information or 
clarification.
 



On Monday, June 15, 2020 at 11:36:59 AM UTC+8 Mark Waite wrote:

> If you had received that stack trace and no other information, what would 
> you have done?  How would you have investigated your report?  What steps 
> would you have taken to clarify the problem and find an answer?
>
> A stack trace is not enough information to provide helpful suggestions.
>
> Refer to https://www.jenkins.io/participate/report-issue/ for the types 
> of information that are needed so that others can help you.
>
> Some examples in your specific case include:
>
>- What do you mean precisely when you say, "Pull Request pipeline"?  
>What is the definition of your Multibranch Pipeline and of the Jenkinsfile 
>in this failure case?  Which branch source provider are you using (GitHub, 
>Bitbucket, Gitea, GitlLab, Git)?
>- Does the commit "8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" exist in 
>the source repository?  If not, does it exist in a pipeline shared library 
>repository that you are using?
>- What steps did you execute to generate that message?
>- What alternate steps have you tried?
>- What were the results of those alternate steps?
>
>
> On Sun, Jun 14, 2020 at 7:11 PM Arunachalam Sibisakkaravarthi <
> aruna...@mcruncher.com> wrote:
>
>> This is actual exception thrown Pull Request pipeline. Please let me know 
>> if anyone needs more information.
>>  
>>
>>> git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e # timeout=10
>>> ERROR: Checkout failed
>>> hudson.plugins.git.GitException: Command "git checkout -f 
>>> 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" returned status code 128:
>>> stdout: 
>>> stderr: fatal: reference is not a tree: 
>>> 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e
>>>
>>> at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
>>> at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:81)
>>> at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2743)
>>> Caused: hudson.plugins.git.GitException: Could not checkout 
>>> 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e
>>> at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
>>> at 
>>> jenkins.plugins.git.MergeWithGitSCMExtension.checkout(MergeWithGitSCMExtension.java:144)
>>> at 
>>> jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:110)
>>> at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1063)
>>> at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1168)
>>> at 
>>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
>>> at 
>>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:155)
>>> at 
>>> org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:142)
>>> at 
>>> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
>>> at hudson.model.ResourceController.execute(ResourceController.java:97)
>>> at hudson.model.Executor.run(Executor.java:428)
>>> Retrying after 10 seconds
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/6ec7c0f7-2d45-4352-ac9e-85b6ce3bba19o%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-

Re: git checkout failed with exception reference is not a tree

2020-06-15 Thread Mark Waite
On Mon, Jun 15, 2020 at 8:16 PM Arunachalam Sibisakkaravarthi <
arunacha...@mcruncher.com> wrote:

> Hi Mark, I share the information you requested.
>
>   We have a BitBucket Webhook to notify Jenkins to build this
> Multibranch pipeline
>
> *Answers for your questions:*
>
>- We use BitBucket Branch Source plugin in our Multibranch pipeline
>- This commit is present in the project repository
>- When a single commit was pushed, we didn’t face this issue but when
>more than N commits were pushed, this problem occurred consistently
>
> A difference between one commit and many commits might be that the commit
you mentioned by SHA1 is not the tip of the branch and you've configured
your job to use git's "shallow clone" feature.  Since you didn't provide
your job definition or the precise description of how the job is defined,
that can only be a guess, but it might be one case where a commit is in the
Bitbucket repository but is not in the workspace on the agent.

>
>- Enabled "Call can merge" option to solve the problem, but it didn't
>solve.
>
> *Observations*:
>
>- The pipeline failed during “checkout” itself with this error
>- We found that the same commit was built successfully when the
>Multibranch pipeline was indexed and scanned.
>- However when that individual feature branch was built manually, the
>checkout failed.
>
> If the commit that is not being found is on a different branch than the
working branch in the workspace and if the workspace was cloned with a
narrow refspec that uses only a single branch, then git would optimize the
fetch process and would only copy the specific branch.  If git copies only
the specific branch, then the missing commit was not fetched because the
narrow refspec specifically told git to only clone a single branch.

Cloning with a narrow refspec is more efficient than cloning with the
default refspec.  Because of that, there are times when the Jenkins
pipeline code chooses by default to clone a narrow refspec.  The narrow
refspec reduces the load on the Bitbucket server and reduces disc use in
the workspace.

The refspec used to populate the workspace should be in the log for the
`checkout scm` call that was performed in your pipeline job.

>
>-
>
> Thanks Mark for reply. Please let me know if you need any information or
> clarification.
>
>
>
>
> On Monday, June 15, 2020 at 11:36:59 AM UTC+8 Mark Waite wrote:
>
>> If you had received that stack trace and no other information, what would
>> you have done?  How would you have investigated your report?  What steps
>> would you have taken to clarify the problem and find an answer?
>>
>> A stack trace is not enough information to provide helpful suggestions.
>>
>> Refer to https://www.jenkins.io/participate/report-issue/ for the types
>> of information that are needed so that others can help you.
>>
>> Some examples in your specific case include:
>>
>>- What do you mean precisely when you say, "Pull Request pipeline"?
>>What is the definition of your Multibranch Pipeline and of the Jenkinsfile
>>in this failure case?  Which branch source provider are you using (GitHub,
>>Bitbucket, Gitea, GitlLab, Git)?
>>- Does the commit "8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" exist in
>>the source repository?  If not, does it exist in a pipeline shared library
>>repository that you are using?
>>- What steps did you execute to generate that message?
>>- What alternate steps have you tried?
>>- What were the results of those alternate steps?
>>
>>
>> On Sun, Jun 14, 2020 at 7:11 PM Arunachalam Sibisakkaravarthi <
>> aruna...@mcruncher.com> wrote:
>>
>>> This is actual exception thrown Pull Request pipeline. Please let me
>>> know if anyone needs more information.
>>>
>>>
 git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e # timeout=10
 ERROR: Checkout failed
 hudson.plugins.git.GitException: Command "git checkout -f 
 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" returned status code 128:
 stdout:
 stderr: fatal: reference is not a tree: 
 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e

at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:81)
at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2743)
 Caused: hudson.plugins.git.GitException: Could not checkout 
 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e
at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
at 
 jenkins.plugins.git.MergeWithGitSCMExtension.checkout(MergeWithGitSCMExtension.java:144)
at 
 jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:110)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1063)
at hudson.

Re: Many Freestyle jobs or many Jenkinsfiles?

2020-06-15 Thread 'monger_39' via Jenkins Users
 check Jenkins Configuration as Code

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
Jenkins Configuration as Code

Jenkins – an open source automation server which enables developers around the 
world to reliably build, test, an...
 |

 |

 |

After installing the plugin, use the export to generate a 'representative' 
piece of code for the type of jobs you want to use. Then you could run some 
script to generate a new JCASC file with similar jobs, and import that. I 
personally find the exact syntax of the JCASC yaml files still hard to 
hand-write, but forsimple jobs like running a pipeline from SCM it's quite easy.



On Friday, June 12, 2020, 05:29:43 PM GMT+2, Al Silver 
 wrote:  
 
 Thanks for all of the ideas.  For now, I created a jenkins directory in my 
pytest root directory (basically the root directory of the project).  I then 
created name specific directories under there for organization.  Under those 
directories, there are multiple jenkinsfiles (not named jenkinsFile).  The 
pipeline files call a python script which processes all of the parameters and 
then generates a command line.  The entire command line is stored as a variable 
and then run through the shell.  Glad I got it working and seems ok for now.  
One thing I don't really like about the workflow is for each pipeline job that 
is created, I still have to first create the job using the GUI and then I need 
to manually enter the "Script Path" to point to the appropriate pipeline file.  
Is there anyway to create the entire Jenkins Job in code so that when the 
Jenkins GUI is opened up, the new jobs "magically" appear?

On Monday, June 1, 2020 at 11:37:46 AM UTC-4, Al Silver wrote:
I've used Jenkins a little but not in the traditional method of CI/CD. I'm 
using Jenkins as a Web UI to run individual python scripts for networking 
devices... Users would log into Jenkins and then select any one of numerous 
Freestyle projects (with parameters) to run (there could be 100 or more...).    
The job executes a shell which runs a pytest script that logs into (via ssh) 
multiple networking devices and performs some actions... pretty straightforward 
and it works ok but has some limitations.  With that said, I think I'll have 
more flexibility and power building and maintaining these jobs as pipelines and 
treating them as code.  My question is I guess I would need to convert my 
pipelines into Jenkinsfiles?  However, most of the docs I read show a single 
Jenkinsfile (named "Jenkinsfile") I would need one for each job (a 100 or so).  
I must be missing something here or not understanding.  Can someone point in 
the right direction for what I'm trying to accomplish?
ThxAl


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ca571ee2-c842-4603-9c34-9a5b1dbd70d8o%40googlegroups.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/725072633.1201947.1592290321532%40mail.yahoo.com.