Re: Random Authentication Error at git checkout

2020-09-29 Thread 'Grant Liu' via Jenkins Users
You are right, Mark. Upon further investigation, we run this script to push
tags to git repo:

#!/usr/bin/env bash
> set -e
> #set -x
> git reset --hard $GIT_COMMIT
> git tag $1
> git config remote.origin.url g...@github.com:$2
> git config credential.username ${GIT_USERNAME}
> git config credential.helper '!echo password=${GIT_PASSWORD}; echo'
> GIT_ASKPASS=true git push origin $1
>
Without the following unset, any jobs in the same worksapce that run
afterwards would consistently fail with authentication issue.

script.sh("git config --unset credential.username")
> script.sh("git config --unset credential.helper")
>

I am not sure why they would need to be unset though, because each run
should have the same GIT_USERNAME and GIT_PASSWORD.


On Tue, Sep 29, 2020 at 6:28 PM Mark Waite 
wrote:

> Are your agents 100% ephemeral?  If not, then a preceding job could have
> inadvertently activated a git credential manager.
>
> I believe that git credential managers operate at the account level rather
> than at the workspace level.  If a prior job installed a credential manager
> or misconfigured git to think there was a credentials manager, then later
> jobs could be affected by it.
>
> I believe that git credential manager information may be stored in the git
> configuration for the user.  If so, then you could report the contents of
> `git config --global --list` at the start of the job and then report `git
> config --global --list` at the end of the job.  Comparison should show that
> the global configuration before the job started should be the same as the
> global configuration at the end of the job.
>
> The git source code suggests that the specific message is coming from
> either git-credential-libsecret.c
> ,
> credential.c
> ,
> or credential-gnome-keyring.c
> .
> If your agent is running on a Linux user desktop, then you might check if
> the user has enabled the Gnome keyring.  If it is running on Windows on a
> desktop, you may want to ask the user if they enabled a credential manager.
>
> Mark Waite
>
> On Tue, Sep 29, 2020 at 6:06 PM 'Grant Liu' via Jenkins Users <
> jenkinsci-users@googlegroups.com> wrote:
>
>> Hi Mark,
>>
>> This error happens randomly. So probably not a configuration issue, but
>> rather some kind of conflict. Is there a way to narrow this down further
>> when this issue occurs to get to the root cause?
>>
>> Today when this happened, I did "yum remove git" then "yum install git"
>> then the issue went away when I rebuilt the job. But this still doesn't
>> point me to the root cause.
>>
>> Any idea is appreciated.
>>
>> Thanks,
>> Grant
>>
>> On Tuesday, September 29, 2020 at 4:09:38 PM UTC-7 Mark Waite wrote:
>>
>>> Usually the message "invalid credentials line" indicates that a git
>>> credentials manager has been configured on that agent or in that
>>> workspace.  https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
>>> describes credential storage in general.
>>> http://microsoft.github.io/Git-Credential-Manager-for-Windows/Docs/Configuration.html
>>> describes more details of the Windows implementation.
>>>
>>> On Tue, Sep 29, 2020 at 1:25 PM 'Grant Liu' via Jenkins Users <
>>> jenkins...@googlegroups.com> wrote:
>>>
 Hi,

 At random times, I am getting Authentication error with git checkout.
 This issue would persist through rebuilding, until the job is reassigned to
 a new slave. The slaves also have git installed via yum:

 Installed Packages
 git.x86_64
 1.8.3.1-23.el7_8

 Attempting to resolve master from remote references...
  > git --version # timeout=10
  > git --version # 'git version 1.8.3.1'
 using GIT_SSH to set credentials jenkins ssh creds
  > git ls-remote -h 
 Found match: refs/heads/master revision
 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
 Selected Git installation does not exist. Using Default
 The recommended git tool is: NONE
 using credential jenkins_ssh
  > git rev-parse --is-inside-work-tree # timeout=10
 Fetching changes from the remote Git repository
  > git config remote.origin.url .git # timeout=10
 Fetching without tags
 Fetching upstream changes from .git
  > git --version # timeout=10
  > git --version # 'git version 1.8.3.1'
 using GIT_SSH to set credentials jenkins ssh creds
  > git fetch --no-tags --progress * # timeout=10
 Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
  > git config core.sparsecheckout # timeout=10
  > git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10

Re: Random Authentication Error at git checkout

2020-09-29 Thread Mark Waite
Are your agents 100% ephemeral?  If not, then a preceding job could have
inadvertently activated a git credential manager.

I believe that git credential managers operate at the account level rather
than at the workspace level.  If a prior job installed a credential manager
or misconfigured git to think there was a credentials manager, then later
jobs could be affected by it.

I believe that git credential manager information may be stored in the git
configuration for the user.  If so, then you could report the contents of
`git config --global --list` at the start of the job and then report `git
config --global --list` at the end of the job.  Comparison should show that
the global configuration before the job started should be the same as the
global configuration at the end of the job.

The git source code suggests that the specific message is coming from
either git-credential-libsecret.c
,
credential.c
,
or credential-gnome-keyring.c
.
If your agent is running on a Linux user desktop, then you might check if
the user has enabled the Gnome keyring.  If it is running on Windows on a
desktop, you may want to ask the user if they enabled a credential manager.

Mark Waite

On Tue, Sep 29, 2020 at 6:06 PM 'Grant Liu' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hi Mark,
>
> This error happens randomly. So probably not a configuration issue, but
> rather some kind of conflict. Is there a way to narrow this down further
> when this issue occurs to get to the root cause?
>
> Today when this happened, I did "yum remove git" then "yum install git"
> then the issue went away when I rebuilt the job. But this still doesn't
> point me to the root cause.
>
> Any idea is appreciated.
>
> Thanks,
> Grant
>
> On Tuesday, September 29, 2020 at 4:09:38 PM UTC-7 Mark Waite wrote:
>
>> Usually the message "invalid credentials line" indicates that a git
>> credentials manager has been configured on that agent or in that
>> workspace.  https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
>> describes credential storage in general.
>> http://microsoft.github.io/Git-Credential-Manager-for-Windows/Docs/Configuration.html
>> describes more details of the Windows implementation.
>>
>> On Tue, Sep 29, 2020 at 1:25 PM 'Grant Liu' via Jenkins Users <
>> jenkins...@googlegroups.com> wrote:
>>
>>> Hi,
>>>
>>> At random times, I am getting Authentication error with git checkout.
>>> This issue would persist through rebuilding, until the job is reassigned to
>>> a new slave. The slaves also have git installed via yum:
>>>
>>> Installed Packages
>>> git.x86_64
>>> 1.8.3.1-23.el7_8
>>>
>>> Attempting to resolve master from remote references...
>>>  > git --version # timeout=10
>>>  > git --version # 'git version 1.8.3.1'
>>> using GIT_SSH to set credentials jenkins ssh creds
>>>  > git ls-remote -h 
>>> Found match: refs/heads/master revision
>>> 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
>>> Selected Git installation does not exist. Using Default
>>> The recommended git tool is: NONE
>>> using credential jenkins_ssh
>>>  > git rev-parse --is-inside-work-tree # timeout=10
>>> Fetching changes from the remote Git repository
>>>  > git config remote.origin.url .git # timeout=10
>>> Fetching without tags
>>> Fetching upstream changes from .git
>>>  > git --version # timeout=10
>>>  > git --version # 'git version 1.8.3.1'
>>> using GIT_SSH to set credentials jenkins ssh creds
>>>  > git fetch --no-tags --progress * # timeout=10
>>> Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
>>>  > git config core.sparsecheckout # timeout=10
>>>  > git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10
>>> Commit message: "DEVOPS-4254: update slack channel to
>>> #jenkins_maven_alerts (#186)"
>>> [Checks API] No suitable checks publisher found.
>>> [Pipeline] Start of Pipeline
>>> [Pipeline] node
>>> Running on EC2 (Personalcapital) - Jenkins slave centos
>>> (i-0fae3510929c96322) in
>>> /home/centos/jenkins/workspace/web_pcap-website_master
>>> [Pipeline] {
>>> [Pipeline] stage
>>> [Pipeline] { (Declarative: Checkout SCM)
>>> [Pipeline] checkout
>>> The recommended git tool is: NONE
>>> using credential pcap_github
>>> Fetching changes from the remote Git repository
>>> Fetching without tags
>>> ERROR: Error fetching remote repo 'origin'
>>> hudson.plugins.git.GitException: Failed to fetch from
>>> https://github.com/personalcapital/.git
>>> at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:957)
>>> at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
>>> at hudson.plugins.git.GitSCM.checkou

Re: master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread Ashish Sharma
Thanks, are these setting to be applied on master side or slave or both?

On Wednesday, September 30, 2020 at 12:15:23 AM UTC+8 kuisat...@gmail.com 
wrote:

>
>- Why does agent tries to connect to master when its already connected?
>
> That suggests half-closed connections, it means that the agent loses the 
> connection with the Jenkins instance but the FIN notification never arrived 
> to the Jenkins instance so the connection is open in the Jenkins instance 
> side. It could be related to networks equipment and the policies that have 
> for open connections, the recommendation is to tune the TCP stack to keep 
> those connections open with traffic see 
> https://support.cloudbees.com/hc/en-us/articles/115001416548#7tcpretransmissiontimeoutossperhapsincrease
>
> El martes, 29 de septiembre de 2020 a las 10:47:22 UTC+2, 
> ashish...@gmail.com escribió:
>
>> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>>
>> Jenkins agent keeps disconnecting frequently, and we are getting below 
>> logs in master.
>>
>> Can you please suggest how to resolve this? What are the steps to further 
>> triage the same.
>>
>> Some of the questions we are trying to answer is:
>>
>>- What is EOFException?
>>- Why does agent tries to connect to master when its already 
>>connected?
>>- Why does eventually the ping / connection fails? 
>>
>> We keep seeing this pattern in logs too often and too frequently. Any 
>> help would be appreciated.
>>
>> Results are same even if we try any of the below options:
>>
>>- Connected using *Launch agent from Browser*
>>- Connected by *starting automator* in Mac which runs shell/zsh to 
>>run agent.jar
>>- Connected by running *plist* in Mac
>>
>> * Jenkins environment:*
>>
>>- Jenkins: 2.249.1
>>- Master Node: Linux RHEL 8.1
>>- Master Java Version: 1.8.0_242
>>- Slave System: macOS Catalina, Version 10.15.6
>>- Slave Java Version: 1.8.0_261
>>
>> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
>> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
>> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
>> 2:45:21 AM  
>> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
>> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
>> from remote:  is already connected to this master. Rejecting 
>> this connection.Sep 29, 2020 2:45:31 AM  
>> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
>> failed: java.io.EOFException Sep 29, 2020 2:45:31 
>> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
>> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
>> 2:45:32 AM  
>> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
>> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
>> remote:  is already connected to this master. Rejecting this 
>> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
>> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
>> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
>> at 1601318492966 hasn't completed by 1601318732966at 
>> hudson.remoting.PingThread.ping(PingThread.java:134)at 
>> hudson.remoting.PingThread.run(PingThread.java:90) *
>>
>>  
>>
>> TIA
>>
>>  
>>
>

-- 
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/f81d4870-df94-4bb9-8087-e882ad27a6fcn%40googlegroups.com.


Re: Random Authentication Error at git checkout

2020-09-29 Thread 'Grant Liu' via Jenkins Users
Hi Mark,

This error happens randomly. So probably not a configuration issue, but 
rather some kind of conflict. Is there a way to narrow this down further 
when this issue occurs to get to the root cause?

Today when this happened, I did "yum remove git" then "yum install git" 
then the issue went away when I rebuilt the job. But this still doesn't 
point me to the root cause.

Any idea is appreciated.

Thanks,
Grant

On Tuesday, September 29, 2020 at 4:09:38 PM UTC-7 Mark Waite wrote:

> Usually the message "invalid credentials line" indicates that a git 
> credentials manager has been configured on that agent or in that 
> workspace.  https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage 
> describes credential storage in general.  
> http://microsoft.github.io/Git-Credential-Manager-for-Windows/Docs/Configuration.html
>  
> describes more details of the Windows implementation.
>
> On Tue, Sep 29, 2020 at 1:25 PM 'Grant Liu' via Jenkins Users <
> jenkins...@googlegroups.com> wrote:
>
>> Hi, 
>>
>> At random times, I am getting Authentication error with git checkout. 
>> This issue would persist through rebuilding, until the job is reassigned to 
>> a new slave. The slaves also have git installed via yum:
>>
>> Installed Packages
>> git.x86_64
>>   1.8.3.1-23.el7_8
>>
>> Attempting to resolve master from remote references...
>>  > git --version # timeout=10
>>  > git --version # 'git version 1.8.3.1'
>> using GIT_SSH to set credentials jenkins ssh creds
>>  > git ls-remote -h 
>> Found match: refs/heads/master revision 
>> 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
>> Selected Git installation does not exist. Using Default
>> The recommended git tool is: NONE
>> using credential jenkins_ssh
>>  > git rev-parse --is-inside-work-tree # timeout=10
>> Fetching changes from the remote Git repository
>>  > git config remote.origin.url .git # timeout=10
>> Fetching without tags
>> Fetching upstream changes from .git
>>  > git --version # timeout=10
>>  > git --version # 'git version 1.8.3.1'
>> using GIT_SSH to set credentials jenkins ssh creds
>>  > git fetch --no-tags --progress * # timeout=10
>> Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
>>  > git config core.sparsecheckout # timeout=10
>>  > git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10
>> Commit message: "DEVOPS-4254: update slack channel to 
>> #jenkins_maven_alerts (#186)"
>> [Checks API] No suitable checks publisher found.
>> [Pipeline] Start of Pipeline
>> [Pipeline] node
>> Running on EC2 (Personalcapital) - Jenkins slave centos 
>> (i-0fae3510929c96322) in 
>> /home/centos/jenkins/workspace/web_pcap-website_master
>> [Pipeline] {
>> [Pipeline] stage
>> [Pipeline] { (Declarative: Checkout SCM)
>> [Pipeline] checkout
>> The recommended git tool is: NONE
>> using credential pcap_github
>> Fetching changes from the remote Git repository
>> Fetching without tags
>> ERROR: Error fetching remote repo 'origin'
>> hudson.plugins.git.GitException: Failed to fetch from 
>> https://github.com/personalcapital/.git
>> at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:957)
>> at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
>> at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1258)
>> at 
>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
>> at 
>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
>> at 
>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
>> at 
>> org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
>> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>> at java.lang.Thread.run(Thread.java:748)
>> Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags 
>> --progress https://github.com/personalcapital/pcap-website.git 
>> +refs/heads/master:refs/remotes/origin/master" returned status code 128:
>> stdout: 
>> stderr: warning: invalid credential line: get
>> remote: Invalid username or password.
>> fatal: Authentication failed for '
>> https://github.com/personalcapital/.git/'
>>
>> at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
>> at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
>> at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
>> at 
>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
>> at 
>> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandIn

Re: Random Authentication Error at git checkout

2020-09-29 Thread Mark Waite
Usually the message "invalid credentials line" indicates that a git
credentials manager has been configured on that agent or in that
workspace.  https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
describes credential storage in general.
http://microsoft.github.io/Git-Credential-Manager-for-Windows/Docs/Configuration.html
describes more details of the Windows implementation.

On Tue, Sep 29, 2020 at 1:25 PM 'Grant Liu' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hi,
>
> At random times, I am getting Authentication error with git checkout. This
> issue would persist through rebuilding, until the job is reassigned to a
> new slave. The slaves also have git installed via yum:
>
> Installed Packages
> git.x86_64
>   1.8.3.1-23.el7_8
>
> Attempting to resolve master from remote references...
>  > git --version # timeout=10
>  > git --version # 'git version 1.8.3.1'
> using GIT_SSH to set credentials jenkins ssh creds
>  > git ls-remote -h 
> Found match: refs/heads/master revision
> 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
> Selected Git installation does not exist. Using Default
> The recommended git tool is: NONE
> using credential jenkins_ssh
>  > git rev-parse --is-inside-work-tree # timeout=10
> Fetching changes from the remote Git repository
>  > git config remote.origin.url .git # timeout=10
> Fetching without tags
> Fetching upstream changes from .git
>  > git --version # timeout=10
>  > git --version # 'git version 1.8.3.1'
> using GIT_SSH to set credentials jenkins ssh creds
>  > git fetch --no-tags --progress * # timeout=10
> Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10
> Commit message: "DEVOPS-4254: update slack channel to
> #jenkins_maven_alerts (#186)"
> [Checks API] No suitable checks publisher found.
> [Pipeline] Start of Pipeline
> [Pipeline] node
> Running on EC2 (Personalcapital) - Jenkins slave centos
> (i-0fae3510929c96322) in
> /home/centos/jenkins/workspace/web_pcap-website_master
> [Pipeline] {
> [Pipeline] stage
> [Pipeline] { (Declarative: Checkout SCM)
> [Pipeline] checkout
> The recommended git tool is: NONE
> using credential pcap_github
> Fetching changes from the remote Git repository
> Fetching without tags
> ERROR: Error fetching remote repo 'origin'
> hudson.plugins.git.GitException: Failed to fetch from
> https://github.com/personalcapital/.git
> at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:957)
> at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
> at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1258)
> at
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
> at
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
> at
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
> at
> org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags
> --progress https://github.com/personalcapital/pcap-website.git
> +refs/heads/master:refs/remotes/origin/master" returned status code 128:
> stdout:
> stderr: warning: invalid credential line: get
> remote: Invalid username or password.
> fatal: Authentication failed for '
> https://github.com/personalcapital/.git/'
>
> at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
> at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
> at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
> at
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
> at
> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
> at
> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
> at hudson.remoting.UserRequest.perform(UserRequest.java:211)
> at hudson.remoting.UserRequest.perform(UserRequest.java:54)
> at hudson.remoting.Request$2.run(Request.java:369)
> at
> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
> ... 4 more
> Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2
> (Personalcapital) - Jenkins slave centos (i-0fae3510929c96322)
> at hudson.remoting.Channel.attachCallSiteSt

Random Authentication Error at git checkout

2020-09-29 Thread 'Grant Liu' via Jenkins Users
Hi, 

At random times, I am getting Authentication error with git checkout. This 
issue would persist through rebuilding, until the job is reassigned to a 
new slave. The slaves also have git installed via yum:

Installed Packages
git.x86_64  
1.8.3.1-23.el7_8

Attempting to resolve master from remote references...
 > git --version # timeout=10
 > git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials jenkins ssh creds
 > git ls-remote -h 
Found match: refs/heads/master revision 
2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
using credential jenkins_ssh
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url .git # timeout=10
Fetching without tags
Fetching upstream changes from .git
 > git --version # timeout=10
 > git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials jenkins ssh creds
 > git fetch --no-tags --progress * # timeout=10
Checking out Revision 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd (master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 2ca56ccc896a62bdb199924dccf4ca6eebbcb9cd # timeout=10
Commit message: "DEVOPS-4254: update slack channel to #jenkins_maven_alerts 
(#186)"
[Checks API] No suitable checks publisher found.
[Pipeline] Start of Pipeline
[Pipeline] node
Running on EC2 (Personalcapital) - Jenkins slave centos 
(i-0fae3510929c96322) in 
/home/centos/jenkins/workspace/web_pcap-website_master
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
The recommended git tool is: NONE
using credential pcap_github
Fetching changes from the remote Git repository
Fetching without tags
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from 
https://github.com/personalcapital/.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:957)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1198)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1258)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at 
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags 
--progress https://github.com/personalcapital/pcap-website.git 
+refs/heads/master:refs/remotes/origin/master" returned status code 128:
stdout: 
stderr: warning: invalid credential line: get
remote: Invalid username or password.
fatal: Authentication failed for 
'https://github.com/personalcapital/.git/'

at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
... 4 more
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 
(Personalcapital) - Jenkins slave centos (i-0fae3510929c96322)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
at 
hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:998)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor639.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$P

Re: master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread Ivan Fernandez Calvo

   
   - Why does agent tries to connect to master when its already connected?

That suggests half-closed connections, it means that the agent loses the 
connection with the Jenkins instance but the FIN notification never arrived 
to the Jenkins instance so the connection is open in the Jenkins instance 
side. It could be related to networks equipment and the policies that have 
for open connections, the recommendation is to tune the TCP stack to keep 
those connections open with traffic 
see 
https://support.cloudbees.com/hc/en-us/articles/115001416548#7tcpretransmissiontimeoutossperhapsincrease

El martes, 29 de septiembre de 2020 a las 10:47:22 UTC+2, 
ashish...@gmail.com escribió:

> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>
> Jenkins agent keeps disconnecting frequently, and we are getting below 
> logs in master.
>
> Can you please suggest how to resolve this? What are the steps to further 
> triage the same.
>
> Some of the questions we are trying to answer is:
>
>- What is EOFException?
>- Why does agent tries to connect to master when its already connected?
>- Why does eventually the ping / connection fails? 
>
> We keep seeing this pattern in logs too often and too frequently. Any help 
> would be appreciated.
>
> Results are same even if we try any of the below options:
>
>- Connected using *Launch agent from Browser*
>- Connected by *starting automator* in Mac which runs shell/zsh to run 
>agent.jar
>- Connected by running *plist* in Mac
>
> * Jenkins environment:*
>
>- Jenkins: 2.249.1
>- Master Node: Linux RHEL 8.1
>- Master Java Version: 1.8.0_242
>- Slave System: macOS Catalina, Version 10.15.6
>- Slave Java Version: 1.8.0_261
>
> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
> 2:45:21 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
> from remote:  is already connected to this master. Rejecting 
> this connection.Sep 29, 2020 2:45:31 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
> failed: java.io.EOFException Sep 29, 2020 2:45:31 
> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
> 2:45:32 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
> remote:  is already connected to this master. Rejecting this 
> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
> at 1601318492966 hasn't completed by 1601318732966at 
> hudson.remoting.PingThread.ping(PingThread.java:134)at 
> hudson.remoting.PingThread.run(PingThread.java:90) *
>
>  
>
> TIA
>
>  
>

-- 
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/1e7bdce3-dbb1-47c8-9d2a-0257496388een%40googlegroups.com.


Re: master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread jeremy mordkoff
We have a similar issue that only seems to occur during long running jobs 
(over 5 hours). The traceback is different but we also see the EOF 
exception. My client is Ubuntu linux 

I tried to trace the issue by running tcpdumps at both ends on the ssh 
session from the master to the slave but I saw nothing amiss. I suspect 
that there is a connection inside the ssh session but that will be hard to 
catch using tcpdump. 

I wonder if I need to enable some kind of keep alives.


On Tuesday, September 29, 2020 at 4:47:22 AM UTC-4 ashish...@gmail.com 
wrote:

> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>
> Jenkins agent keeps disconnecting frequently, and we are getting below 
> logs in master.
>
> Can you please suggest how to resolve this? What are the steps to further 
> triage the same.
>
> Some of the questions we are trying to answer is:
>
>- What is EOFException?
>- Why does agent tries to connect to master when its already connected?
>- Why does eventually the ping / connection fails? 
>
> We keep seeing this pattern in logs too often and too frequently. Any help 
> would be appreciated.
>
> Results are same even if we try any of the below options:
>
>- Connected using *Launch agent from Browser*
>- Connected by *starting automator* in Mac which runs shell/zsh to run 
>agent.jar
>- Connected by running *plist* in Mac
>
> * Jenkins environment:*
>
>- Jenkins: 2.249.1
>- Master Node: Linux RHEL 8.1
>- Master Java Version: 1.8.0_242
>- Slave System: macOS Catalina, Version 10.15.6
>- Slave Java Version: 1.8.0_261
>
> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
> 2:45:21 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
> from remote:  is already connected to this master. Rejecting 
> this connection.Sep 29, 2020 2:45:31 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
> failed: java.io.EOFException Sep 29, 2020 2:45:31 
> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
> 2:45:32 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
> remote:  is already connected to this master. Rejecting this 
> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
> at 1601318492966 hasn't completed by 1601318732966at 
> hudson.remoting.PingThread.ping(PingThread.java:134)at 
> hudson.remoting.PingThread.run(PingThread.java:90) *
>
>  
>
> TIA
>
>  
>

-- 
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/2eeea79b-b0bb-40cb-9181-94ca2361182bn%40googlegroups.com.


Automate Adding users in jenkins

2020-09-29 Thread jyothibasu kalyanapu


I have my Azure AD connected to Jenkins. post this step, I am manually 
adding users and configuring their roles.

is there any automation possibility that I can take a user from Azure AD 
and add as a user in Jenkins and assign an initial or basic rule (like 
read-only).

-- 
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/24226600-7374-4841-b870-7b6d4653cf83n%40googlegroups.com.


master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread Ashish Sharma


Hi Team, We are using JNLP to connect Mac agent to Linux master node.

Jenkins agent keeps disconnecting frequently, and we are getting below logs 
in master.

Can you please suggest how to resolve this? What are the steps to further 
triage the same.

Some of the questions we are trying to answer is:

   - What is EOFException?
   - Why does agent tries to connect to master when its already connected?
   - Why does eventually the ping / connection fails? 

We keep seeing this pattern in logs too often and too frequently. Any help 
would be appreciated.

Results are same even if we try any of the below options:

   - Connected using *Launch agent from Browser*
   - Connected by *starting automator* in Mac which runs shell/zsh to run 
   agent.jar
   - Connected by running *plist* in Mac

* Jenkins environment:*

   - Jenkins: 2.249.1
   - Master Node: Linux RHEL 8.1
   - Master Java Version: 1.8.0_242
   - Slave System: macOS Catalina, Version 10.15.6
   - Slave Java Version: 1.8.0_261

*Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
2:45:21 AM  
INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
from remote:  is already connected to this master. Rejecting 
this connection.Sep 29, 2020 2:45:31 AM  
INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
failed: java.io.EOFException Sep 29, 2020 2:45:31 
AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
2:45:32 AM  
INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
remote:  is already connected to this master. Rejecting this 
connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
onDeadPing failed. Terminating the channel JNLP4-connect connection from 
x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
at 1601318492966 hasn't completed by 1601318732966at 
hudson.remoting.PingThread.ping(PingThread.java:134)at 
hudson.remoting.PingThread.run(PingThread.java:90) *

 

TIA

 

-- 
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/6be77200-35d8-42a3-91ff-cf1e3df208aan%40googlegroups.com.