Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 对Jenkins的RESTAPI调用总是抛出401_Docker_Jenkins_Networking - Fatal编程技术网

Docker 对Jenkins的RESTAPI调用总是抛出401

Docker 对Jenkins的RESTAPI调用总是抛出401,docker,jenkins,networking,Docker,Jenkins,Networking,我尝试对Jenkins进行api调用。Jenkins存储在GCloud VM上的Docker容器中,没有互联网连接(使用Docker网络完成,如)。 如果我在我的本地机器上测试这个,它工作得很好 我的CURL-to-rest API: docker exec jenkins curl -X GET localhost:8080 -u USER:PASS 结果: % Total % Received % Xferd Average Speed Time Time Ti

我尝试对Jenkins进行api调用。Jenkins存储在GCloud VM上的Docker容器中,没有互联网连接(使用Docker网络完成,如)。 如果我在我的本地机器上测试这个,它工作得很好

我的CURL-to-rest API:

docker exec jenkins curl -X GET localhost:8080 -u USER:PASS
结果:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 Invalid password/token for user: USER</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /. Reason:
<pre>    Invalid password/token for user: admin</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>
100   373  100   373    0     0   1703      0 --:--:-- --:--:-- --:--:--  1703
%Total%接收到%x平均速度时间电流
数据加载上载总左速度
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
错误401用户的密码/令牌无效:user
HTTP错误401
访问/时出现问题。原因:
用户的密码/令牌无效:admin
100   373  100   373    0     0   1703      0 --:--:-- --:--:-- --:--:--  1703

尝试重新启动用户/传递并更新请求。@MauroBaraldi重新启动是什么意思?重新运行对jenkinsI的请求多次