¿Por qué falla Jenkins cuando obtiene de git, mientras que la línea de command no?

Todas mis versiones de Jenkins están fallando en la línea de git fetch .

Está fallando en la git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git

 Started by user anonymous Building in workspace /Users/ethen/.jenkins/workspace/Build NikNik > git rev-parse --is-inside-work-tree Fetching changes from the remote Git repository > git config remote.origin.url git@bitbucket.org:ethenwilson/whentoact.git Fetching upstream changes from git@bitbucket.org:ethenwilson/whentoact.git > git --version using GIT_SSH to set cnetworkingentials NikNik BitBucket SSH Key > git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git +refs/heads/*:refs/remotes/origin/* FATAL: Failed to fetch from git@bitbucket.org:ethenwilson/whentoact.git hudson.plugins.git.GitException: Failed to fetch from git@bitbucket.org:ethenwilson/whentoact.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879) at hudson.model.AbstractProject.checkout(AbstractProject.java:1252) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530) at hudson.model.Run.execute(Run.java:1732) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:234) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: remote: Counting objects: 2682, done.[K remote: Compressing objects: 0% (1/1399) [K remote: Compressing objects: 1% (14/1399) [K remote: Compressing objects: 2% (28/1399) [K remote: Compressing objects: 3% (42/1399) [K remote: Compressing objects: 4% (56/1399) [K remote: Compressing objects: 5% (70/1399) [K remote: Compressing objects: 6% (84/1399) [K remote: Compressing objects: 7% (98/1399) [K remote: Compressing objects: 8% (112/1399) [K remote: Compressing objects: 9% (126/1399) [K remote: Compressing objects: 10% (140/1399) [K remote: Compressing objects: 11% (154/1399) [K remote: Compressing objects: 12% (168/1399) [K remote: Compressing objects: 13% (182/1399) [K remote: Compressing objects: 14% (196/1399) [K remote: Compressing objects: 15% (210/1399) [K remote: Compressing objects: 16% (224/1399) [K remote: Compressing objects: 17% (238/1399) [K remote: Compressing objects: 18% (252/1399) [K remote: Compressing objects: 19% (266/1399) [K remote: Compressing objects: 20% (280/1399) [K remote: Compressing objects: 21% (294/1399) [K remote: Compressing objects: 22% (308/1399) [K remote: Compressing objects: 23% (322/1399) [K remote: Compressing objects: 24% (336/1399) [K remote: Compressing objects: 25% (350/1399) [K remote: Compressing objects: 26% (364/1399) [K remote: Compressing objects: 27% (378/1399) [K remote: Compressing objects: 28% (392/1399) [K remote: Compressing objects: 29% (406/1399) [K remote: Compressing objects: 30% (420/1399) [K remote: Compressing objects: 31% (434/1399) [K remote: Compressing objects: 32% (448/1399) [K remote: Compressing objects: 33% (462/1399) [K remote: Compressing objects: 34% (476/1399) [K remote: Compressing objects: 35% (490/1399) [K remote: Compressing objects: 36% (504/1399) [K remote: Compressing objects: 37% (518/1399) [K remote: Compressing objects: 38% (532/1399) [K remote: Compressing objects: 39% (546/1399) [K remote: Compressing objects: 40% (560/1399) [K remote: Compressing objects: 41% (574/1399) [K remote: Compressing objects: 42% (588/1399) [K remote: Compressing objects: 43% (602/1399) [K remote: Compressing objects: 44% (616/1399) [K remote: Compressing objects: 45% (630/1399) [K remote: Compressing objects: 46% (644/1399) [K remote: Compressing objects: 47% (658/1399) [K remote: Compressing objects: 48% (672/1399) [K remote: Compressing objects: 49% (686/1399) [K remote: Compressing objects: 50% (700/1399) [K remote: Compressing objects: 51% (714/1399) [K remote: Compressing objects: 52% (728/1399) [K remote: Compressing objects: 53% (742/1399) [K remote: Compressing objects: 54% (756/1399) [K remote: Compressing objects: 55% (770/1399) [K remote: Compressing objects: 56% (784/1399) [K remote: Compressing objects: 57% (798/1399) [K remote: Compressing objects: 58% (812/1399) [K remote: Compressing objects: 59% (826/1399) [K remote: Compressing objects: 60% (840/1399) [K remote: Compressing objects: 61% (854/1399) [K remote: Compressing objects: 62% (868/1399) [K remote: Compressing objects: 63% (882/1399) [K remote: Compressing objects: 64% (896/1399) [K remote: Compressing objects: 65% (910/1399) [K remote: Compressing objects: 66% (924/1399) [K remote: Compressing objects: 67% (938/1399) [K remote: Compressing objects: 68% (952/1399) [K remote: Compressing objects: 69% (966/1399) [K remote: Compressing objects: 70% (980/1399) [K remote: Compressing objects: 71% (994/1399) [K remote: Compressing objects: 72% (1008/1399) [K remote: Compressing objects: 73% (1022/1399) [K remote: Compressing objects: 74% (1036/1399) [K remote: Compressing objects: 75% (1050/1399) [K remote: Compressing objects: 76% (1064/1399) [K remote: Compressing objects: 77% (1078/1399) [K remote: Compressing objects: 78% (1092/1399) [K remote: Compressing objects: 79% (1106/1399) [K remote: Compressing objects: 80% (1120/1399) [K remote: Compressing objects: 81% (1134/1399) [K remote: Compressing objects: 82% (1148/1399) [K remote: Compressing objects: 83% (1162/1399) [K remote: Compressing objects: 84% (1176/1399) [K remote: Compressing objects: 85% (1190/1399) [K remote: Compressing objects: 86% (1204/1399) [K remote: Compressing objects: 87% (1218/1399) [K remote: Compressing objects: 88% (1232/1399) [K remote: Compressing objects: 89% (1246/1399) [K remote: Compressing objects: 90% (1260/1399) [K remote: Compressing objects: 91% (1274/1399) [K remote: Compressing objects: 92% (1288/1399) [K remote: Compressing objects: 93% (1302/1399) [K remote: Compressing objects: 94% (1316/1399) [K remote: Compressing objects: 95% (1330/1399) [K remote: Compressing objects: 96% (1344/1399) [K remote: Compressing objects: 97% (1358/1399) [K remote: Compressing objects: 98% (1372/1399) [K remote: Compressing objects: 99% (1386/1399) [K remote: Compressing objects: 99% (1398/1399) [K remote: Compressing objects: 100% (1399/1399) [K remote: Compressing objects: 100% (1399/1399), done.[K Receiving objects: 0% (1/2682) Receiving objects: 1% (27/2682) Receiving objects: 2% (54/2682) Receiving objects: 3% (81/2682) Receiving objects: 4% (108/2682) Receiving objects: 5% (135/2682) Receiving objects: 6% (161/2682) Receiving objects: 7% (188/2682) Receiving objects: 8% (215/2682) Receiving objects: 9% (242/2682) Receiving objects: 10% (269/2682) Receiving objects: 11% (296/2682) Receiving objects: 12% (322/2682) Receiving objects: 13% (349/2682) Receiving objects: 14% (376/2682) Receiving objects: 15% (403/2682) Receiving objects: 16% (430/2682) Receiving objects: 17% (456/2682) Receiving objects: 18% (483/2682) Receiving objects: 19% (510/2682) Receiving objects: 20% (537/2682) Receiving objects: 21% (564/2682) Receiving objects: 22% (591/2682) Receiving objects: 23% (617/2682) Receiving objects: 24% (644/2682) Receiving objects: 25% (671/2682) Receiving objects: 26% (698/2682) Receiving objects: 27% (725/2682) Receiving objects: 28% (751/2682) Receiving objects: 29% (778/2682) Receiving objects: 30% (805/2682) Receiving objects: 31% (832/2682) Receiving objects: 32% (859/2682) Receiving objects: 33% (886/2682) Receiving objects: 34% (912/2682) Receiving objects: 35% (939/2682) Receiving objects: 36% (966/2682) Receiving objects: 37% (993/2682) Receiving objects: 38% (1020/2682) Receiving objects: 39% (1046/2682) Receiving objects: 40% (1073/2682) Receiving objects: 41% (1100/2682) Receiving objects: 42% (1127/2682) Receiving objects: 43% (1154/2682) Receiving objects: 44% (1181/2682) Receiving objects: 45% (1207/2682) Receiving objects: 46% (1234/2682) Receiving objects: 47% (1261/2682) Receiving objects: 48% (1288/2682) Receiving objects: 49% (1315/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 50% (1341/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 51% (1368/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 52% (1395/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 53% (1422/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 54% (1449/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 55% (1476/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 56% (1502/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 57% (1529/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 58% (1556/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 59% (1583/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 60% (1610/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 61% (1637/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 62% (1663/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 63% (1690/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 64% (1717/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 65% (1744/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 66% (1771/2682), 428.00 KiB | 846.00 KiB/s Receiving objects: 66% (1792/2682), 1.39 MiB | 1.35 MiB/s Receiving objects: 67% (1797/2682), 1.39 MiB | 1.35 MiB/s Receiving objects: 68% (1824/2682), 1.39 MiB | 1.35 MiB/s Receiving objects: 69% (1851/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 70% (1878/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 71% (1905/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 72% (1932/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 73% (1958/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 74% (1985/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 75% (2012/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 76% (2039/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 76% (2042/2682), 2.23 MiB | 1.45 MiB/s Receiving objects: 77% (2066/2682), 3.11 MiB | 1.52 MiB/s Receiving objects: 78% (2092/2682), 4.07 MiB | 1.59 MiB/s Corrupted MAC on input. Disconnecting: Packet corrupt fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1325) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCnetworkingentials(CliGitAPIImpl.java:1186) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:257) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620) ... 10 more 

Cuando ejecuto git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git desde la command-line, funciona bien, lo que significa que mis keys SSH deben estar funcionando.

Me estoy conectando a BitBucket con Jenkins con verificación SSH. Jenkins obtiene la key del file que está ubicado (la pnetworkingeterminada), así que sé que Jenkins está usando la misma key que yo cuando corro desde la línea de command.

Estoy usando la última versión de los complementos BitBucket y Git para Jenkins. Mi Git instalado en mi Mac es la versión 1.8.5.2 (Apple Git-48) .

Mi command jenkins start es nohup java -jar ~/jenkins.war --httpPort=8081 --ajp13Port=8010 > /tmp/jenkins.log 2>&1 & .

¿Qué está mal?

EDITAR: Estaba equivocado, accidentalmente había golpeado una opción para tener la key SSH en el lugar equivocado cuando lo hice. Ahora, usando la sugerencia de @ borrrden, todavía da el mismo error. ** EDITAR: Como sugirió @borrrden, cambié mi command de inicio a nohup java -Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true -jar ~/Downloads/jenkins.war --httpPort=8081 --ajp13Port=8010 > /tmp/jenkins.log 2>&1 & , y ahora recibo un locking diferente:

 Started by user anonymous Building in workspace /Users/ethen/.jenkins/workspace/Build NikNik > git rev-parse --is-inside-work-tree Fetching changes from the remote Git repository > git config remote.origin.url git@bitbucket.org:ethenwilson/whentoact.git Fetching upstream changes from git@bitbucket.org:ethenwilson/whentoact.git > git --version using GIT_SSH to set cnetworkingentials NikNik BitBucket SSH Key > git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git +refs/heads/*:refs/remotes/origin/* FATAL: Failed to fetch from git@bitbucket.org:ethenwilson/whentoact.git hudson.plugins.git.GitException: Failed to fetch from git@bitbucket.org:ethenwilson/whentoact.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879) at hudson.model.AbstractProject.checkout(AbstractProject.java:1252) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530) at hudson.model.Run.execute(Run.java:1732) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:234) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@bitbucket.org:ethenwilson/whentoact.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1406) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCnetworkingentials(CliGitAPIImpl.java:1194) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:265) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620) ... 10 more 

Parece un error de networking:

Recepción de objects: 78% (2092/2682), 4.07 MiB | 1,59 MiB / s

Corrompido MAC en la input.

Desconnection: package corrupto

fatal: el extremo remoto colgó inesperadamente

fatal: primeros EOF

fatal: el package de índice falló

sugiere que la networking se rompió al 78% del path.

Parece ser un problema común .

Para mí, esto fue golpear el time de espera pnetworkingeterminado de 10 minutos para el complemento git-client. Se solucionó estableciendo un comportamiento de clonación avanzado en el trabajo y aumentando el time de espera. Conocimientos adquiridos aquí: https://issues.jenkins-ci.org/browse/JENKINS-20445?focusedCommentId=195638&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-195638

Probablemente, este problema se deba a un control de time de espera en curso mientras se extrae. Puede boostlo siguiendo los consejos que se mencionan a continuación.

En la página de configuration del trabajo en la sección del complemento Git, hay una list desplegable "Agregar". Dentro de esa list desplegable hay una selección de "Comportamientos clónicos avanzados". Cuando agrega los comportamientos de clonación avanzada, verá un campo para "Tiempo de espera (en minutos) para la operación de clonar y recuperar".

También tuve este problema y solo pude resolverlo eliminando el espacio de trabajo del repository problemático en nuestro server maestro de Jenkins.

Creo que el problema fue que hubo un error de connection (como dijo @gbjbaanb) en algunas comstackciones (nuestro Bitbucket se bloqueó). Esto dejó el espacio de trabajo en el maestro en un estado corrupto, y debido a que Jenkins intenta usar espacios de trabajo en caching donde puede, esto provocó que todas las siguientes construcciones fallaran también.

Pude resolver el problema creando una count de BitBucket exclusivamente para Jenkins, dándole permiso de administrador para el repository.

Luego tuve el URL del repository be: https://JenkinsAccountUsername:JenkinsAccountPassword@bitbucket.org/OwnerOfRepositoryUsername/ProjectName.git .