簡體   English   中英

谷歌雲資源管理器V3 java客戶端調用失敗

[英]Failed to call google cloud resource manager V3 java client

在嘗試從https://github.com/googleapis/java-resourcemanager/tree/master/google-cloud-resourcemanager/src/main/java/com/google/cloud/調用任何方法時,我收到以下錯誤資源管理器

 Caused by: io.grpc.StatusRuntimeException: UNIMPLEMENTED: HTTP status code 404 invalid content-type: text/html; charset=UTF-8 Caused by: io.grpc.StatusRuntimeException: UNIMPLEMENTED: HTTP status code 404 headers: Metadata(:status=404,date=Tue, 22 Jun 2021 15:29:57 GMT,content-type=text/html; charset=UTF-8,server=ESF,content-length=1614,x-xss-protection=0,x-frame-options=SAMEORIGIN,x-content-type-options=nosniff,server-timing=gfet4t7; dur=745,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43") DATA----------------------------- <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"> <title>Error 404 (Not Found)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px} </style> <a href=//www.google.com/><span id=logo aria-label=Google></span></a> <p><b>404.</b> <ins>That??s an error.</ins> <p>The requested URL <code>/google.cloud.resourcemanager.v3.Projects/GetIamPolicy</code> was not found on this server. <ins>That??s all we know.</ins> at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.38.0.jar:1.38.0] ... 16 common frames omitted

這個例子是通過以下代碼得到的:

 ProjectsClient projectsClient = null; try { projectsClient = ProjectsClient.create(); } catch (IOException e) { e.printStackTrace(); } com.google.iam.v1.Policy iamPolicy = projectsClient.getIamPolicy("projectName");

但是對 V3 java 客戶端的任何調用都會導致相同的結果。 如果我嘗試使用https://cloud.google.com/resource-manager/reference/rest/v3/projects/getIamPolicy上的“嘗試此 API”功能發送相同的請求,它會起作用。 我使用最新版本com.google.cloud:google-cloud-resourcemanager:0.119.7-alpha ,但 erlier 具有相同的效果。

正如谷歌雲資源管理器404 錯誤文檔中所見,它是由以下原因引起的:

  • 請求的操作失敗,因為找不到與請求關聯的資源。
  • 找不到與請求關聯的資源。 如果您在過去兩周內沒有使用過此 API,請重新部署 App Engine 應用並嘗試再次調用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM