Best way to say "never mind" in a pipeline script?

2018-12-21 Thread David Karr
First some background, although my actual question is likely pretty simple.

I have a situation where there are two different jobs that could run for 
particular projects. I have a multibranch pipeline that runs for master and 
release branches, what I might call "target" branches,being the target of a 
merge.  I also have a plain pipeline that gets spawned from BitBUcket for 
pull requests (using the "Pull Request Notification" BitBucket mechanism). 
This gets spawned for ordinary pull requests, but we also have "automerge" 
set for release branches, so when you merge a PR to a release branch, it 
automerges to master.  That also results in a pull request, but the branch 
is a release branch.  At the point the PR is merged to the release branch, 
it causes two builds to be spawned, one on the multibranch pipeline, and 
one on the plain pipeline.  I'd really like to just skip the build on the 
plain pipeline in this case.  There is no "branch filter" in the Pull 
Request Notification system, so the only time I can do something about this 
is in the pipeline script.  It's simple to detect this situation in the 
pipeline script, but what I want to determine is how to abort the script 
automatically at this point without making it look like an "error".  I 
don't know how to abort the entire pipeline script in the script itself, 
without throwing an exception.  Throwing an exception doesn't seem quite 
right.

-- 
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/95999a6a-51ed-431c-8db8-52e2bad83b19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to Launch an Agent, getting "received junk text is as follows: stdin: is not a tty"

2018-12-21 Thread Mark Waite
I inserted diagnostic print messages into my bashrc at almost every line so
that I could tell exactly which line was causing the problem.  It was a
coarse technique that helped me quickly detect the problem commands

On Fri, Dec 21, 2018 at 12:37 PM Philippe M. 
wrote:

> Thanks,
> That's what I started to do , but how to find all of them ?
> Do you have a tip ?
>
> Thanks
>
> On Friday, December 21, 2018 at 6:12:50 PM UTC+1, Mark Waite wrote:
>>
>> You'll need to remove the entries in the '.profile' and/or '.bashrc' that
>> are doing things which are not allowed in a non-interactive shell.  Either
>> that, or wrap them in conditionals which prevent them from being executed
>> in a non-interactive shell.
>>
>> Mark Waite
>>
>> On Friday, December 21, 2018 at 9:20:26 AM UTC-7, Philippe M. wrote:
>>>
>>> Hello,
>>>
>>> We are facing an issue using Jenkins 2.138.3 and connecting to certain
>>> machines (issue occurs with machines in  redhat 7.2, not in 6.4 but not
>>> sure it's related).
>>>
>>> When we start the agent, we get this error, issue being that ssh gives 
>>> "stdin:
>>> is not a tty"
>>>
>>> Full Jenkins log:
>>>
>>> SSHLauncher{host='XXX.XXX.X.XXX', port=22,
>>> credentialsId='XXX', jvmOptions='', javaPath='',
>>> prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210,
>>> maxNumRetries=10, retryWaitTime=15,
>>> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy,
>>> tcpNoDelay=true, trackCredentials=true}
>>>
>>> [12/21/18 16:41:19] [SSH] Opening SSH connection to XXX.XXX.X.XXX:22.
>>>
>>> [12/21/18 16:41:19] [SSH] SSH host key matches key in Known Hosts file.
>>> Connection will be allowed.
>>>
>>> [12/21/18 16:41:19] [SSH] Authentication successful.
>>>
>>> SSH connection reports a garbage before a command execution.
>>>
>>> Check your .bashrc, .profile, and so on to make sure it is quiet.
>>>
>>> The received junk text is as follows:
>>>
>>> stdin: is not a tty
>>>
>>>
>>>
>>> null
>>>
>>> [12/21/18 16:41:20] Launch failed - cleaning up connection
>>> [12/21/18 16:41:20] [SSH] Connection closed.
>>>
>>>
>>> How can this be fixed, searching for similar issues, I see fixes related
>>> to sudoers but we are not sudoing here.
>>> I also found issue could be triggered by Banner , but there is no banner
>>> either.
>>>
>>> Note that if we try non interactive mode, we have this which explains
>>> the issue faced by Jenkins I guess:
>>>
>>> ssh -T login@host:
>>> stty: standard input: Inappropriate ioctl for device
>>> stdin: is not a tty
>>> stdin: is not a tty
>>> stdin: is not a tty
>>>
>>>
>>> I tried to disable in /etc/profile stty if in non interactive mode, it
>>> fixed :
>>>
>>> stty: standard input: Inappropriate ioctl for device
>>>
>>> So I now have:
>>>
>>> ssh -T login@host:
>>> stdin: is not a tty
>>> stdin: is not a tty
>>> stdin: is not a tty
>>>
>>> But I am stuck here.
>>>
>>> Thanks in advance for your help.
>>> Regards
>>>
>>> --
> 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/1e6f8395-c7c3-4151-ade6-1efeef217aff%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

-- 
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/CAO49JtHARZzzD3A%3DD24mdQ_vGgUvTMNwU6fNN%2B5a11YkY6fdqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to Launch an Agent, getting "received junk text is as follows: stdin: is not a tty"

2018-12-21 Thread Philippe M.
Thanks, 
That's what I started to do , but how to find all of them ?
Do you have a tip ?

Thanks

On Friday, December 21, 2018 at 6:12:50 PM UTC+1, Mark Waite wrote:
>
> You'll need to remove the entries in the '.profile' and/or '.bashrc' that 
> are doing things which are not allowed in a non-interactive shell.  Either 
> that, or wrap them in conditionals which prevent them from being executed 
> in a non-interactive shell.
>
> Mark Waite
>
> On Friday, December 21, 2018 at 9:20:26 AM UTC-7, Philippe M. wrote:
>>
>> Hello,
>>
>> We are facing an issue using Jenkins 2.138.3 and connecting to certain 
>> machines (issue occurs with machines in  redhat 7.2, not in 6.4 but not 
>> sure it's related).
>>
>> When we start the agent, we get this error, issue being that ssh gives 
>> "stdin: 
>> is not a tty" 
>>
>> Full Jenkins log:
>>
>> SSHLauncher{host='XXX.XXX.X.XXX', port=22, 
>> credentialsId='XXX', jvmOptions='', javaPath='', 
>> prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, 
>> maxNumRetries=10, retryWaitTime=15, 
>> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy,
>>  
>> tcpNoDelay=true, trackCredentials=true}
>>
>> [12/21/18 16:41:19] [SSH] Opening SSH connection to XXX.XXX.X.XXX:22.
>>
>> [12/21/18 16:41:19] [SSH] SSH host key matches key in Known Hosts file. 
>> Connection will be allowed.
>>
>> [12/21/18 16:41:19] [SSH] Authentication successful.
>>
>> SSH connection reports a garbage before a command execution.
>>
>> Check your .bashrc, .profile, and so on to make sure it is quiet.
>>
>> The received junk text is as follows:
>>
>> stdin: is not a tty
>>
>>  
>>
>> null
>>
>> [12/21/18 16:41:20] Launch failed - cleaning up connection
>> [12/21/18 16:41:20] [SSH] Connection closed.
>>
>>
>> How can this be fixed, searching for similar issues, I see fixes related 
>> to sudoers but we are not sudoing here.
>> I also found issue could be triggered by Banner , but there is no banner 
>> either.
>>
>> Note that if we try non interactive mode, we have this which explains the 
>> issue faced by Jenkins I guess:
>>
>> ssh -T login@host:
>> stty: standard input: Inappropriate ioctl for device
>> stdin: is not a tty
>> stdin: is not a tty
>> stdin: is not a tty
>>
>>
>> I tried to disable in /etc/profile stty if in non interactive mode, it 
>> fixed :
>>
>> stty: standard input: Inappropriate ioctl for device
>>
>> So I now have:
>>
>> ssh -T login@host:
>> stdin: is not a tty
>> stdin: is not a tty
>> stdin: is not a tty
>>
>> But I am stuck here.
>>
>> Thanks in advance for your help.
>> Regards
>>
>>

-- 
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/1e6f8395-c7c3-4151-ade6-1efeef217aff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to Launch an Agent, getting "received junk text is as follows: stdin: is not a tty"

2018-12-21 Thread Mark Waite
You'll need to remove the entries in the '.profile' and/or '.bashrc' that 
are doing things which are not allowed in a non-interactive shell.  Either 
that, or wrap them in conditionals which prevent them from being executed 
in a non-interactive shell.

Mark Waite

On Friday, December 21, 2018 at 9:20:26 AM UTC-7, Philippe M. wrote:
>
> Hello,
>
> We are facing an issue using Jenkins 2.138.3 and connecting to certain 
> machines (issue occurs with machines in  redhat 7.2, not in 6.4 but not 
> sure it's related).
>
> When we start the agent, we get this error, issue being that ssh gives 
> "stdin: 
> is not a tty" 
>
> Full Jenkins log:
>
> SSHLauncher{host='XXX.XXX.X.XXX', port=22, 
> credentialsId='XXX', jvmOptions='', javaPath='', 
> prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, 
> maxNumRetries=10, retryWaitTime=15, 
> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy,
>  
> tcpNoDelay=true, trackCredentials=true}
>
> [12/21/18 16:41:19] [SSH] Opening SSH connection to XXX.XXX.X.XXX:22.
>
> [12/21/18 16:41:19] [SSH] SSH host key matches key in Known Hosts file. 
> Connection will be allowed.
>
> [12/21/18 16:41:19] [SSH] Authentication successful.
>
> SSH connection reports a garbage before a command execution.
>
> Check your .bashrc, .profile, and so on to make sure it is quiet.
>
> The received junk text is as follows:
>
> stdin: is not a tty
>
>  
>
> null
>
> [12/21/18 16:41:20] Launch failed - cleaning up connection
> [12/21/18 16:41:20] [SSH] Connection closed.
>
>
> How can this be fixed, searching for similar issues, I see fixes related 
> to sudoers but we are not sudoing here.
> I also found issue could be triggered by Banner , but there is no banner 
> either.
>
> Note that if we try non interactive mode, we have this which explains the 
> issue faced by Jenkins I guess:
>
> ssh -T login@host:
> stty: standard input: Inappropriate ioctl for device
> stdin: is not a tty
> stdin: is not a tty
> stdin: is not a tty
>
>
> I tried to disable in /etc/profile stty if in non interactive mode, it 
> fixed :
>
> stty: standard input: Inappropriate ioctl for device
>
> So I now have:
>
> ssh -T login@host:
> stdin: is not a tty
> stdin: is not a tty
> stdin: is not a tty
>
> But I am stuck here.
>
> Thanks in advance for your help.
> Regards
>
>

-- 
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/d04c9c12-3d62-4acd-904d-5e9f6087ab83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [kubernetes plugin] yamlFile libraryResource

2018-12-21 Thread Arnaud bourree
I created issue https://issues.jenkins-ci.org/browse/JENKINS-55299

Le ven. 21 déc. 2018 à 14:18, Arnaud bourree  a
écrit :

> Hello,
>
> I'd like to move pod definition from pipeline to a file resource in a
> shared library.
>
> My pipeline is like:
> pipeline {
> agent none
> stages {
> stage('step-in-kubernetes') {
> agent {
> kubernetes {
> label 'kube'
> yamlFile libraryResource('myPod.yaml')
> }
> }
> stages {
> stage('Checkout') {
> steps {
> checkout([$class: 'MercurialSCM', clean: true,
> source: 'https://acme.com/hg/myproject'])
> }
> }
> }
> }
> }
> }
>
> I put 'myPod.yaml' in resources folder of my library.
> I get an error saying that HG is not installed.
>
> But:
> - it's work if I used yaml property instead of yamlFile
> - libraryResource fails when using wrong filename
>
> Did anyone try same use-case?
>
> Regards,
>
> Arnaud.
>

-- 
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/CAESUf_DNj9k7QjoTmKGRcg6ya2JGG1CbLaFzEvZ3Rq13wdoVhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Unable to Launch an Agent, getting "received junk text is as follows: stdin: is not a tty"

2018-12-21 Thread Philippe M.
Hello,

We are facing an issue using Jenkins 2.138.3 and connecting to certain 
machines (issue occurs with machines in  redhat 7.2, not in 6.4 but not 
sure it's related).

When we start the agent, we get this error, issue being that ssh gives "stdin: 
is not a tty" 

Full Jenkins log:

SSHLauncher{host='XXX.XXX.X.XXX', port=22, 
credentialsId='XXX', jvmOptions='', javaPath='', 
prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, 
maxNumRetries=10, retryWaitTime=15, 
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy,
 
tcpNoDelay=true, trackCredentials=true}

[12/21/18 16:41:19] [SSH] Opening SSH connection to XXX.XXX.X.XXX:22.

[12/21/18 16:41:19] [SSH] SSH host key matches key in Known Hosts file. 
Connection will be allowed.

[12/21/18 16:41:19] [SSH] Authentication successful.

SSH connection reports a garbage before a command execution.

Check your .bashrc, .profile, and so on to make sure it is quiet.

The received junk text is as follows:

stdin: is not a tty

 

null

[12/21/18 16:41:20] Launch failed - cleaning up connection
[12/21/18 16:41:20] [SSH] Connection closed.


How can this be fixed, searching for similar issues, I see fixes related to 
sudoers but we are not sudoing here.
I also found issue could be triggered by Banner , but there is no banner 
either.

Note that if we try non interactive mode, we have this which explains the 
issue faced by Jenkins I guess:

ssh -T login@host:
stty: standard input: Inappropriate ioctl for device
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty


I tried to disable in /etc/profile stty if in non interactive mode, it 
fixed :

stty: standard input: Inappropriate ioctl for device

So I now have:

ssh -T login@host:
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty

But I am stuck here.

Thanks in advance for your help.
Regards

-- 
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/dc163ea3-3074-4d0a-bda3-d88bdfbb9992%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to checkout Jenkinsfile from git for a Pipeline Job: getting unable to fork

2018-12-21 Thread Philippe M.
Hello Mark Waite,

THANKS A LOT !

The issue was indeed noexec on the tmp and workspace folders mounting.

Once fixed, everything worked fine.

Regards


On Friday, December 21, 2018 at 3:07:46 PM UTC+1, Mark Waite wrote:
>
>
>
> On Friday, December 21, 2018 at 7:06:06 AM UTC-7, Mark Waite wrote:
>>
>>
>>
>> On Friday, December 21, 2018 at 6:20:56 AM UTC-7, Philippe M. wrote:
>>>
>>> Hello,
>>>
>>> Using Jenkins 2.138.3 and Git client plugin 2.7.4 I get an error when 
>>> doing the following:
>>>
>>> 1) Create job of type Pipeline
>>> 2) Select pipeline from SCM and enter 
>>> - ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>> - Credentials come from a private key
>>>
>>> 3) Build job , it fails with:
>>>
>>> Started by user unknown or anonymous
>>> Checking out git ssh://
>>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>>  
>>> into /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script to read 
>>> Jenkinsfile
>>> Cloning the remote Git repository
>>> Cloning repository ssh://
>>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>> > git init /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script 
>>> # timeout=10
>>> Fetching upstream changes from ssh://
>>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>> > git --version # timeout=10
>>> using GIT_SSH to set credentials
>>>  > git fetch --tags --progress ssh://
>>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>>  
>>> +refs/heads/*:refs/remotes/origin/*
>>> ERROR: Error cloning remote repo 'origin'
>>> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
>>> ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>>> 
>>>  
>>> +refs/heads/*:refs/remotes/origin/*" returned status code 128:
>>> stdout:
>>> stderr: fatal: cannot exec 
>>> '/var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script@tmp/ssh7220368723599186680.sh':
>>>  
>>> Permission denied
>>> fatal: unable to fork
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629)
>>>at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
>>>at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
>>>at 
>>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
>>>at 
>>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
>>>at 
>>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
>>>at 
>>> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:292)
>>>at 
>>> hudson.model.ResourceController.execute(ResourceController.java:97)
>>>at hudson.model.Executor.run(Executor.java:429)
>>> ERROR: Error cloning remote repo 'origin'
>>> ERROR: Maximum checkout retry attempts reached, aborting
>>> Finished: FAILURE
>>>
>>> Master is running on redhat 7.2, openjdk 1.8.0_65 64 bit server VM 
>>>
>>>
>> Check that the temporary directory on the master is not mounted with the 
>> 'noexec' option.  Check that the workspace directory on the master is not 
>> mounted with the 'noexec' option.
>>
>> The Jenkins git client plugin needs to communicate credentials to command 
>> line git.  Red Hat Linux defaults to an old enough version of command line 
>> git that the only way to communicate those credentials is through an 
>> executable shell script.  The executable shell script is placed in a 
>> temporary directory on the master and run from the master.  The preferred 
>> location for that temporary directory is adjacent to the workspace 
>> directory.  However, there are cases where the system temporary directory 
>> is used instead.
>>
>> Refer to https://issues.jenkins-ci.org/browse/JENKINS-26993 and 
>> 

Re: Unable to checkout Jenkinsfile from git for a Pipeline Job: getting unable to fork

2018-12-21 Thread Mark Waite


On Friday, December 21, 2018 at 7:06:06 AM UTC-7, Mark Waite wrote:
>
>
>
> On Friday, December 21, 2018 at 6:20:56 AM UTC-7, Philippe M. wrote:
>>
>> Hello,
>>
>> Using Jenkins 2.138.3 and Git client plugin 2.7.4 I get an error when 
>> doing the following:
>>
>> 1) Create job of type Pipeline
>> 2) Select pipeline from SCM and enter 
>> - ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>> - Credentials come from a private key
>>
>> 3) Build job , it fails with:
>>
>> Started by user unknown or anonymous
>> Checking out git ssh://
>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>>  
>> into /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script to read 
>> Jenkinsfile
>> Cloning the remote Git repository
>> Cloning repository ssh://
>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>> > git init /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script # 
>> timeout=10
>> Fetching upstream changes from ssh://
>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>> > git --version # timeout=10
>> using GIT_SSH to set credentials
>>  > git fetch --tags --progress ssh://
>> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>>  
>> +refs/heads/*:refs/remotes/origin/*
>> ERROR: Error cloning remote repo 'origin'
>> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
>> ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
>> 
>>  
>> +refs/heads/*:refs/remotes/origin/*" returned status code 128:
>> stdout:
>> stderr: fatal: cannot exec 
>> '/var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script@tmp/ssh7220368723599186680.sh':
>>  
>> Permission denied
>> fatal: unable to fork
>>at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
>>at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
>>at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
>>at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
>>at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629)
>>at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
>>at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
>>at 
>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
>>at 
>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
>>at 
>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
>>at 
>> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:292)
>>at 
>> hudson.model.ResourceController.execute(ResourceController.java:97)
>>at hudson.model.Executor.run(Executor.java:429)
>> ERROR: Error cloning remote repo 'origin'
>> ERROR: Maximum checkout retry attempts reached, aborting
>> Finished: FAILURE
>>
>> Master is running on redhat 7.2, openjdk 1.8.0_65 64 bit server VM 
>>
>>
> Check that the temporary directory on the master is not mounted with the 
> 'noexec' option.  Check that the workspace directory on the master is not 
> mounted with the 'noexec' option.
>
> The Jenkins git client plugin needs to communicate credentials to command 
> line git.  Red Hat Linux defaults to an old enough version of command line 
> git that the only way to communicate those credentials is through an 
> executable shell script.  The executable shell script is placed in a 
> temporary directory on the master and run from the master.  The preferred 
> location for that temporary directory is adjacent to the workspace 
> directory.  However, there are cases where the system temporary directory 
> is used instead.
>
> Refer to https://issues.jenkins-ci.org/browse/JENKINS-26993 and 
> https://issues.jenkins-ci.org/browse/JENKINS-44951 for much more detail 
> on the topic.
>
>
See also this excellent article from CloudBees Support

https://support.cloudbees.com/hc/en-us/articles/115003082887-Jenkins-with-Git-Client-needs-permission-on-Temporary-directory

 

> Mark Waite
>  
>
>> If I create a project from content of Jenkinsfile 

Re: Unable to checkout Jenkinsfile from git for a Pipeline Job: getting unable to fork

2018-12-21 Thread Mark Waite


On Friday, December 21, 2018 at 6:20:56 AM UTC-7, Philippe M. wrote:
>
> Hello,
>
> Using Jenkins 2.138.3 and Git client plugin 2.7.4 I get an error when 
> doing the following:
>
> 1) Create job of type Pipeline
> 2) Select pipeline from SCM and enter 
> - ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
> - Credentials come from a private key
>
> 3) Build job , it fails with:
>
> Started by user unknown or anonymous
> Checking out git ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
>  
> into /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script to read 
> Jenkinsfile
> Cloning the remote Git repository
> Cloning repository ssh://
> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
> > git init /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script # 
> timeout=10
> Fetching upstream changes from ssh://
> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
> > git --version # timeout=10
> using GIT_SSH to set credentials
>  > git fetch --tags --progress ssh://
> g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
>  
> +refs/heads/*:refs/remotes/origin/*
> ERROR: Error cloning remote repo 'origin'
> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
> ssh://g...@bitbucket.example.com:7999/~userXXX/jmt_poc.git 
> 
>  
> +refs/heads/*:refs/remotes/origin/*" returned status code 128:
> stdout:
> stderr: fatal: cannot exec 
> '/var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script@tmp/ssh7220368723599186680.sh':
>  
> Permission denied
> fatal: unable to fork
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629)
>at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
>at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
>at 
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
>at 
> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
>at 
> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
>at 
> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:292)
>at 
> hudson.model.ResourceController.execute(ResourceController.java:97)
>at hudson.model.Executor.run(Executor.java:429)
> ERROR: Error cloning remote repo 'origin'
> ERROR: Maximum checkout retry attempts reached, aborting
> Finished: FAILURE
>
> Master is running on redhat 7.2, openjdk 1.8.0_65 64 bit server VM 
>
>
Check that the temporary directory on the master is not mounted with the 
'noexec' option.  Check that the workspace directory on the master is not 
mounted with the 'noexec' option.

The Jenkins git client plugin needs to communicate credentials to command 
line git.  Red Hat Linux defaults to an old enough version of command line 
git that the only way to communicate those credentials is through an 
executable shell script.  The executable shell script is placed in a 
temporary directory on the master and run from the master.  The preferred 
location for that temporary directory is adjacent to the workspace 
directory.  However, there are cases where the system temporary directory 
is used instead.

Refer to https://issues.jenkins-ci.org/browse/JENKINS-26993 
and https://issues.jenkins-ci.org/browse/JENKINS-44951 for much more detail 
on the topic.

Mark Waite
 

> If I create a project from content of Jenkinsfile directly , which 
> checkouts exactly the same repository , it works fine but node is on redhat 
> 6.4.
>
> I adjusted Xmx, Xms and MaxMetaSpaceSize.
> I checked limits of jenkins and I see no issues:
>
>- Max processes is at 4096
>- Max open files at 1
>- Max locked memory 65536
>
> There is nothing more in /var/log/jenkins/jenkins.log
> It happens even after 

Unable to checkout Jenkinsfile from git for a Pipeline Job: getting unable to fork

2018-12-21 Thread Philippe M.
Hello,

Using Jenkins 2.138.3 and Git client plugin 2.7.4 I get an error when doing 
the following:

1) Create job of type Pipeline
2) Select pipeline from SCM and enter 
- ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git
- Credentials come from a private key

3) Build job , it fails with:

Started by user unknown or anonymous
Checking out git ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git into 
/var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script to read 
Jenkinsfile
Cloning the remote Git repository
Cloning repository ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git
> git init /var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script # 
timeout=10
Fetching upstream changes from 
ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git
> git --version # timeout=10
using GIT_SSH to set credentials
 > git fetch --tags --progress 
ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git 
+refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress 
ssh://g...@bitbucket.foo.com:7999/~userXXX/jmt_poc.git 
+refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: cannot exec 
'/var/lib/jenkins/workspace/POC_JMT_PIPELINE_FROM_GIT2@script@tmp/ssh7220368723599186680.sh':
 
Permission denied
fatal: unable to fork
   at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
   at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
   at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
   at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
   at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629)
   at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
   at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
   at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
   at 
org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:144)
   at 
org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
   at 
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:292)
   at 
hudson.model.ResourceController.execute(ResourceController.java:97)
   at hudson.model.Executor.run(Executor.java:429)
ERROR: Error cloning remote repo 'origin'
ERROR: Maximum checkout retry attempts reached, aborting
Finished: FAILURE

Master is running on redhat 7.2, openjdk 1.8.0_65 64 bit server VM 

If I create a project from content of Jenkinsfile directly , which 
checkouts exactly the same repository , it works fine but node is on redhat 
6.4.

I adjusted Xmx, Xms and MaxMetaSpaceSize.
I checked limits of jenkins and I see no issues:

   - Max processes is at 4096
   - Max open files at 1
   - Max locked memory 65536
   
There is nothing more in /var/log/jenkins/jenkins.log
It happens even after a clean restart of Jenkins and there is no job 
running.

Thanks in advance for your help.
Regards
Philippe M.

-- 
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/dd9de3ba-1a92-4885-aaf3-9eea69275c70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[kubernetes plugin] yamlFile libraryResource

2018-12-21 Thread Arnaud bourree
Hello,

I'd like to move pod definition from pipeline to a file resource in a
shared library.

My pipeline is like:
pipeline {
agent none
stages {
stage('step-in-kubernetes') {
agent {
kubernetes {
label 'kube'
yamlFile libraryResource('myPod.yaml')
}
}
stages {
stage('Checkout') {
steps {
checkout([$class: 'MercurialSCM', clean: true,
source: 'https://acme.com/hg/myproject'])
}
}
}
}
}
}

I put 'myPod.yaml' in resources folder of my library.
I get an error saying that HG is not installed.

But:
- it's work if I used yaml property instead of yamlFile
- libraryResource fails when using wrong filename

Did anyone try same use-case?

Regards,

Arnaud.

-- 
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/CAESUf_DkcgiLK0c_iSXu8b5n83V6Tq%3DeeR99Xk5vswLbXY0MYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.