TeamCity with BitBucket Cloud Commit Status Publisher。 404 错误

TeamCity with BitBucket Cloud Commit Status Publisher. 404 Errors

我在让提交状态发布者工作时遇到问题。

详情:

VCS 设置:

提交状态发布者设置:

但是每当应该发布提交消息时,我都会在 TeamCity 构建配置列表中弹出:

Publish status error in build #730 {build id=68270, buildTypeId=Project_BuildConfigurationName}: Cannot publish status to Bitbucket Cloud for VCS root Rootname: response code: 404, reason: NOT FOUND, message: 'Resource not found'

一个奇怪的设置是我正在使用 ssh://git@altssh.bitbucket.org:443 地址来绕过一些出站防火墙限制,尽管我怀疑那会是导致问题。

我是否需要为 VCS 配置服务帐户用户而不是 SSH 部署密钥?如果可能的话,我宁愿不这样做。

未找到意味着您的用户找不到指定的存储库。通常这意味着客户端的vcs设置不正确。

问题似乎是没有专用于构建本身的用户。 **您无法使用部署密钥写入存储库。以任何形状或形式。 ** 通常的做法是创建一个 'build'/'jenkins'/'teamcity' 用户,该用户有权将构建输出写入位桶云本身。这与任何其他用户的创建相同。

我的下一个问题是,您是否需要将此信息写回未加密的云本身,或者只在您的 teamcity 实例外部包含构建状态。假设您有充分的理由这样做,您绝对需要一个构建用户。

似乎这个特定的错误消息无法呈现根本身的名称。这表明它不在系统本身中。

Publish status error in build #730 {build id=68270,
buildTypeId=Project_BuildConfigurationName}: Cannot publish status to
Bitbucket Cloud for VCS root Rootname:<root_should_be_here> response
code: 404, reason: NOT FOUND, message: 'Resource not found'

查看: Source of the error message, see line 125.

也可能很有趣:Source of the Repository Object

这意味着你的bitbucket repo本身没有被正确注册,这与你连接到repo本身的能力有很大的不同,它应该仍然可以在没有连接本身的情况下注册。

有趣的是,这似乎与 Teamcity Common Issues 上描述的问题类似,它表明,如果:

VCS root with id "XXX" does not exist The build configuration or template reference a VCS root which is not defined in the system. Remedy actions: Restore the VCS root or create a new VCS root with the id noted or edit the file noted in the message to remove the reference to the VCS root.

无疑

有关
final VcsRootInstance root = revision.getRoot();

无法找到 git 存储库的根实例。如果可以的话,我建议您在没有防火墙的情况下尝试此操作,因为与服务器同步可能会出现问题,如 this 页面注释

TeamCity regularly queries the version control system for new changes and displays the changes in the Build Configurations that have the root attached

getRoot() supposed 将返回

version of VCS root checked out for the build.

请注意,这是来自界面 Interface SVcsRoot

哪个是

Server side class for the vcs root.

所以这肯定是服务器端配置问题,需要用根 reconfiguration

提交状态发布者解析您使用的 url incorrectly。作为解决方法切换到标准 ssh url git@bitbucket.org:owner/repo.git.