首页 > 解决方案 > 在建立与 Concourse API 的连接时出现 401 状态错误

问题描述

目前,我们正试图让 CI 在我们的实验室中工作。

我们刚刚按照大厅网站上的说明进行操作。

我们能够正确登录并~/.flyrc按照 concourse-ci.org 和 concoursetutorial.com 网站的推荐设置。

我们注意到大多数命令都返回 401 Unauthorized 错误。

我们已经开始设置审计日志https://concourse-ci.org/concourse-web.html#audit-logs

但不清楚这写到哪里,帮助?

目前很难正确追踪这一点。顺便说一句,这是我们第一次接触大厅。

我们想知道为什么?以及我们能做些什么来解决这个问题(跨越这个小圈子)。

fly -t rdb-ci set-team --team-name a-team --local-user admin --github-org organization --verbose --print-table-headers --non-interactive

2019/07/10 22:02:37 GET /api/v1/info HTTP/1.1
Host: ci.example.org
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip


2019/07/10 22:02:37 HTTP/1.1 200 OK
Content-Length: 88
Connection: keep-alive
Content-Type: application/json
Date: Wed, 10 Jul 2019 21:02:37 GMT
Server: nginx/1.12.2
X-Concourse-Version: 5.3.0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{"version":"5.3.0","worker_version":"2.1","external_url":"https://ci.example.org"}

setting team: a-team

role owner:
  users:
  - local:admin

  groups:
  - github:organization

apply team configuration? [yN]: y
2019/07/10 22:02:53 PUT /api/v1/teams/a-team HTTP/1.1
Host: ci.example.org
User-Agent: Go-http-client/1.1
Content-Length: 71
Content-Type: application/json
Accept-Encoding: gzip

{"auth":{"owner":{"groups":["github:organization"],"users":["local:admin"]}}}

2019/07/10 22:02:53 HTTP/1.1 401 Unauthorized
Content-Length: 14
Connection: keep-alive
Content-Type: text/plain; charset=utf-8
Date: Wed, 10 Jul 2019 21:02:53 GMT
Server: nginx/1.12.2
X-Concourse-Version: 5.3.0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

not authorized
could not find a valid token.
logging in to team 'main'

2019/07/10 22:02:53 GET /api/v1/info HTTP/1.1
Host: ci.example.org
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip


could not reach the Concourse server called rdb-ci:

    Get https://ci.example.org/api/v1/info: x509: certificate is valid for www.example.org, not ci.example.org

is the targeted Concourse running? better go catch it lol

标签: concourse

解决方案


推荐阅读