gpt4 book ai didi

git - TeamCity:来自 git 的代理端 checkout 失败

转载 作者:太空狗 更新时间:2023-10-29 13:45:40 29 4
gpt4 key购买 nike

我已经在 Linux SUSE 11 上为 teamCity 设置了一个构建代理,并在该代理上安装了一个 git 客户端。因此,每个 git 提交都会通过 TeamCity Agent 在 TeamCity 中触发新构建。

请注意,“服务器端 checkout ”模式适用于构建代理,这意味着 Enterprise TeamCity 和代理能够对话。不确定,但我猜代理设置有问题。代理设置在:~/.bashrc 和/etc/profile

如果我登录构建代理的框并手动执行:git clone someProject 它工作正常。但是,如果 Enterprise Team City 这样做,则会发生错误:

从Enterprise Team City的网页界面登录:

[13:16:26]Checking for changes
[13:16:32]Publishing internal artifacts
[13:16:32]Clearing temporary directory: /opt/buildAgent/temp/buildTmp
[13:16:32]Checkout directory: /opt/buildAgent/work/413442a249b8bad8
[13:16:32]Updating sources: agent side checkout (3m:11s)
[13:16:32][Updating sources] Using vcs information from server. Reason: no revision information for buildtype my-project:master: build and checkout directory /opt/buildAgent/work/413442a249b8bad8 on agent
[13:16:32][Updating sources] Will perform clean checkout. Reason: Checkout directory was cleaned up with errors
[13:16:32][Updating sources] Cleaning /opt/buildAgent/work/413442a249b8bad8
[13:16:33][Updating sources] VCS Root: [15116-12]Team::VCS_1 (3m:10s)
[13:16:33][VCS Root: [15116-12]_Team::VCS_1] revision: dff43c329bc0495efd66ffcfd4fddd26e66e4a50
[13:16:33][VCS Root: [15116-12]_Team::VCS_1] Cleaning /opt/buildAgent/work/413442a249b8bad8
[13:16:33][VCS Root: [15116-12]_Team::VCS_1] The .git directory is missing in '/opt/buildAgent/work/413442a249b8bad8'. Running 'git init'...
[13:16:33][VCS Root: [15116-12]_Team::VCS_1] Commit 'dff43c329bc0495efd66ffcfd4fddd26e66e4a50' is not found in repository. Running 'git fetch'...
[13:19:44]
[Updating sources] Failed to perform checkout on agent: '/usr/bin/git -c core.askpass=/opt/buildAgent/temp/buildTmp/pass102793096014863366 fetch --progress origin +refs/heads/master:refs/remotes/origin/master' command failed.
stderr: error: Failed connect to stash.mySite.com:8081; Operation now in progress while accessing https://myUserName@stash.someThing.com:8081/scm//myProject.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
[13:19:44]Publishing internal artifacts
[13:19:44]Build failed to start. Artifacts will not be published for this build
[13:19:46]Build finished

从位于\logs\teamcity-agent.log 的 BuildAgent 记录:

[2014-05-29 07:55:04,204]   INFO -    jetbrains.buildServer.AGENT - ===================================================
[2014-05-29 07:55:04,204] INFO - jetbrains.buildServer.AGENT - Starting build buildId = 1258156, buildTypeId=bt10493
[2014-05-29 07:55:04,206] INFO - mpl$TeamCitySpringSubConatiner - Refreshing SubContext: running build context id=1258156: startup date [Thu May 29 07:55:04 BST 2014]; parent: jetbrains.buildServer.agent.AgentMain2$2@6cc06bf7
[2014-05-29 07:55:04,411] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.LogAgentParametersStage
[2014-05-29 07:55:04,413] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.ClearExpiredBuildWorkingDirectoriesStage
[2014-05-29 07:55:04,413] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.UpdateDirectoryMapStage
[2014-05-29 07:55:04,429] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.RegisterPropertiesFileNamesStage
[2014-05-29 07:55:04,431] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.EnableBuildStopStage
[2014-05-29 07:55:04,431] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.FireBuildStartedStage
[2014-05-29 07:55:04,436] INFO - uildServer.swabra.SwabraLogger - Swabra cleanup is disabled
[2014-05-29 07:55:04,436] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CleanAgentTempDirectoryStage
[2014-05-29 07:55:04,437] INFO - rectories.DirectoryCleanerImpl - Move directory /opt/buildAgent/temp/agentTmp to /opt/buildAgent/temp/.old/agentTmp_17 for cleaning
[2014-05-29 07:55:04,437] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CreateAgentTempDirectoryStage
[2014-05-29 07:55:04,437] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.PublishBuildPropertiesStage
[2014-05-29 07:55:04,442] INFO - ernalArtifactsProcessingLogger - Publishing artifacts process started
[2014-05-29 07:55:04,442] INFO - ernalArtifactsProcessingLogger - Start: Searching for artifacts to publish in [/opt/buildAgent/temp/agentTmp/build.start.properties.gz=>.teamcity/properties]
[2014-05-29 07:55:04,442] INFO - ernalArtifactsProcessingLogger - Done: Searching for artifacts to publish, found [1] file
[2014-05-29 07:55:04,442] INFO - ernalArtifactsProcessingLogger - Start: Pre-processing artifacts if needed (archiving)
[2014-05-29 07:55:04,442] INFO - ernalArtifactsProcessingLogger - Done: Pre-processing artifacts if needed (archiving)
[2014-05-29 07:55:04,442] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CleanBuildTempDirectoryStage
[2014-05-29 07:55:04,443] INFO - s.CleanBuildTempDirectoryStage - Clearing temporary directory: /opt/buildAgent/temp/buildTmp
[2014-05-29 07:55:04,443] INFO - rectories.DirectoryCleanerImpl - Move directory /opt/buildAgent/temp/buildTmp to /opt/buildAgent/temp/.old/buildTmp_17 for cleaning
[2014-05-29 07:55:04,443] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CreateBuildTempDirectoryStage
[2014-05-29 07:55:04,444] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CreateCheckoutDirectoryStage
[2014-05-29 07:55:04,445] INFO - ace.DirectoryCleanerForceClean - Free disk space under directory /opt/buildAgent/temp is 3.77 GB, required 3 GB.
[2014-05-29 07:55:04,445] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.CleanGeneratedFilesStage
[2014-05-29 07:55:04,445] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.LogCheckoutDirectoryStage
[2014-05-29 07:55:04,446] INFO - jetbrains.buildServer.AGENT - Checkout directory: /opt/buildAgent/work/413442a249b8bad8
[2014-05-29 07:55:04,446] INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.patch.UpdateSourcesFromAgent
[2014-05-29 07:55:04,446] INFO - ch.UpdateSourcesBuildStageBase - Updating sources: agent side checkout
[2014-05-29 07:55:04,447] INFO - jetbrains.buildServer.AGENT - No revision information for 413442a249b8bad8.xml on agent
[2014-05-29 07:55:04,448] INFO - pl.patch.ProjectSourcesOnAgent - Will perform clean checkout. Reason: [ROOT_DIRECTORY_WAS_CLEANED_UP_WITH_ERRORS]
[2014-05-29 07:55:04,448] INFO - pl.patch.ProjectSourcesOnAgent - Cleaning /opt/buildAgent/work/413442a249b8bad8
[2014-05-29 07:55:04,448] INFO - rectories.DirectoryCleanerImpl - Move directory /opt/buildAgent/work/413442a249b8bad8 to /opt/buildAgent/work/.old/413442a249b8bad8_17 for cleaning
[2014-05-29 07:55:04,449] INFO - jetbrains.buildServer.AGENT - Patch downloaded for build with id 1258156
[2014-05-29 07:55:05,491] INFO - ernalArtifactsProcessingLogger - Start: Publishing files using WebPublisher
[2014-05-29 07:55:05,517] INFO - ernalArtifactsProcessingLogger - Start: Publishing files using ArtifactsCachePublisher
[2014-05-29 07:55:05,563] INFO - ernalArtifactsProcessingLogger - Done publishing artifacts to '.teamcity/properties', using 'WebPublisher', total files published: 1
[2014-05-29 07:55:05,563] INFO - ernalArtifactsProcessingLogger - Done publishing artifacts to '.teamcity/properties', using 'ArtifactsCachePublisher', total files published: 1
[2014-05-29 07:55:05,563] INFO - ernalArtifactsProcessingLogger - Done: Publishing files
[2014-05-29 07:55:05,730] INFO - ernalArtifactsProcessingLogger - Publishing artifacts process finished
[2014-05-29 07:55:06,052] INFO - jetbrains.buildServer.AGENT - Attempting to mark checkoutdir 413442a249b8bad8 for build 1258156 dirty
[2014-05-29 07:55:06,052] INFO - jetbrains.buildServer.AGENT - Number of vcsRootEntries: [VcsRootEntry[VcsSettings["[15116-12]_MYTEAM::GIT_VCS" {internal id=27876, properties: [agentCleanFilesPolicy=ALL_UNTRACKED; agentCleanPolicy=ON_BRANCH_CHANGE; authMethod=PASSWORD; branch=refs/heads/master; ignoreKnownHosts=true; secure:password=*****; submoduleCheckout=CHECKOUT; teamcity:vcsRootName=[15116-12]_MYTEAM::GIT_VCS; url=https://stash.mySite.com:8081/scm/myProject.git; username=build_user; usernameStyle=USERID; vcs=jetbrains.git; ]}; Checkout rules: ]]]
[2014-05-29 07:55:06,052] INFO - jetbrains.buildServer.AGENT - Recording vcs state. C: dff43c329bc0495efd66ffcfd4fddd26e66e4a50, Id: 5085_jetbrains.git_-210835581203928646_60553, CR: =>

[2014-05-29 07:55:06,052] INFO - jetbrains.buildServer.AGENT - Moved configuration file 413442a249b8bad8.xml to old
[2014-05-29 07:55:06,052] WARN - jetbrains.buildServer.AGENT - new file 413442a249b8bad8.xml.new exists. Previous build might have not finished successfully
[2014-05-29 07:55:06,053] INFO - jetbrains.buildServer.AGENT - Stored new configuration file 413442a249b8bad8.xml
[2014-05-29 07:55:06,054] INFO - pl.patch.ProjectSourcesOnAgent - Updating sources for root id=27876; name=[15116-12]_MYTEAM::GIT_VCS; revision: dff43c329bc0495efd66ffcfd4fddd26e66e4a50
[2014-05-29 07:55:06,072] INFO - gers.vcs.git.agent.UpdaterImpl - Starting update of root [15116-12]_MYTEAM::GIT_VCS in /opt/buildAgent/work/413442a249b8bad8 to revision dff43c329bc0495efd66ffcfd4fddd26e66e4a50
[2014-05-29 07:55:06,073] INFO - gers.vcs.git.agent.UpdaterImpl - Cleaning /opt/buildAgent/work/413442a249b8bad8
[2014-05-29 07:55:06,074] INFO - rectories.DirectoryCleanerImpl - Move directory /opt/buildAgent/work/413442a249b8bad8 to /opt/buildAgent/work/.old/413442a249b8bad8_18 for cleaning
[2014-05-29 07:58:16,562] WARN - ch.UpdateSourcesBuildStageBase - Error while checkout on agent: '/usr/bin/git -c core.askpass=/opt/buildAgent/temp/buildTmp/pass4372765007199018345 fetch --progress origin +refs/heads/master:refs/remotes/origin/master' command failed.
stderr: error: Failed connect to stash.mySite.com:8081; Operation now in progress while accessing https://build_user@stash.mySite.com:8081/scm/myProject.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
jetbrains.buildServer.vcs.VcsException: '/usr/bin/git -c core.askpass=/opt/buildAgent/temp/buildTmp/pass4372765007199018345 fetch --progress origin +refs/heads/master:refs/remotes/origin/master' command failed.
stderr: error: Failed connect to stash.mySite.com:8081; Operation now in progress while accessing https://build_user@stash.mySite.com:8081/scm/myProject.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.commandFailed(CommandUtil.java:64)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.checkCommandFailed(CommandUtil.java:41)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.runCommand(CommandUtil.java:109)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.GitCommandLine.run(GitCommandLine.java:83)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.FetchCommandImpl.call(FetchCommandImpl.java:102)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetch(UpdaterImpl.java:496)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetchDefaultBranch(UpdaterImpl.java:452)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetchFromOriginalRepository(UpdaterImpl.java:441)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.ensureCommitLoaded(UpdaterImpl.java:432)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.doFetch(UpdaterImpl.java:427)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.doUpdate(UpdaterImpl.java:109)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.update(UpdaterImpl.java:102)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.GitAgentVcsSupport.updateSources(GitAgentVcsSupport.java:90)
at jetbrains.buildServer.agent.impl.patch.ProjectSourcesOnAgent$1.run(ProjectSourcesOnAgent.java:252)
at java.lang.Thread.run(Thread.java:744)

VCS 根设置:

Type of VCS: Git
Fetch URL: https://stash.mySite.com:8081/scm/myProject.git
Push URL: Empty
Default branch: refs/heads/master
Authentication method: Password
Test connection: ok

请注意,我使用 https 连接进行 git-client 和 Stash 之间的对话。

手动在代理上运行的 TeamCity 上述日志中的命令: buildAgent:~/cd/opt/buildAgent/work/413442a249b8bad8 buildAgent::/opt/buildAgent/work/413442a249b8bad8>/usr/bin/git -c core.askpass=/opt/buildAgent/temp/buildTmp/pass4372765007199018345 fetch --progress origin +refs/heads/master:refs/remotes/起源/主人

结果已连接

 * [new tag]         myProject-1.2 -> myProject-1.2
* [new tag] myProject-1.3 -> myProject-1.3
* [new tag] myProject-1.4 -> myProject-1.4
* Closing connection #0

如何解决?

最佳答案

我解决了这个问题。我们使用 Stash,因此在 build-agent 上我应该为 ~/.gitconfig 添加一个 Stash 用户。

[user]
name = MyUserName
email = myEmail

在 team-city fetch 中,Stash 上的 git repo 的 URL 路径也应该有这个用户,例如:

https:myUser@stash.mySite.com:8081

关于git - TeamCity:来自 git 的代理端 checkout 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23911861/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com