简体   繁体   中英

Failed to call google cloud resource manager V3 java client

I am getting the following error on any attempt to call any method from https://github.com/googleapis/java-resourcemanager/tree/master/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager

 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

This example is got by the following code:

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

but any call to V3 java client causes the same. If I try to send the same request using "try this API" feature on https://cloud.google.com/resource-manager/reference/rest/v3/projects/getIamPolicy , it works. I use the latest version com.google.cloud:google-cloud-resourcemanager:0.119.7-alpha , but an erlier has the same effect.

As seen in the 404 Error documentation of Google Cloud Resource Manager , it's caused by:

  • The requested operation failed because a resource associated with the request could not be found.
  • A resource associated with the request could not be found. If you have not used this API in the last two weeks, please re-deploy the App Engine app and try calling it again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM