Google Cloud Platform 인증 - 프로젝트를 나열하거나 프로젝트를 설정할 수 없습니다.

Google Cloud Platform 인증 - 프로젝트를 나열하거나 프로젝트를 설정할 수 없습니다.

이전에 Google Cloud Platform으로 인증했고 모든 것이 올바르게 작동했지만 갑자기 오늘 google-gaxNode 앱에서 다음과 같은 오류가 발생하기 시작했습니다.

2023-09-07T18:13:41: Error: 13 INTERNAL: Received RST_STREAM with code 0
2023-09-07T18:13:41:     at callErrorFromStatus (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
2023-09-07T18:13:41:     at Object.onReceiveStatus (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
2023-09-07T18:13:41:     at Object.onReceiveStatus (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
2023-09-07T18:13:41:     at Object.onReceiveStatus (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
2023-09-07T18:13:41:     at /path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
2023-09-07T18:13:41:     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
2023-09-07T18:13:41: for call at
2023-09-07T18:13:41:     at ServiceClientImpl.makeUnaryRequest (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/client.js:160:32)
2023-09-07T18:13:41:     at ServiceClientImpl.<anonymous> (/path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
2023-09-07T18:13:41:     at /path/to/app/node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/kms/build/src/v1/key_management_service_client.js:241:29
2023-09-07T18:13:41:     at /path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
2023-09-07T18:13:41:     at repeat (/path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/retries.js:80:25)
2023-09-07T18:13:41:     at /path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/retries.js:118:13
2023-09-07T18:13:41:     at OngoingCallPromise.call (/path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/call.js:67:27)
2023-09-07T18:13:41:     at NormalApiCaller.call (/path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
2023-09-07T18:13:41:     at /path/to/app/node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/createApiCall.js:84:30 {
2023-09-07T18:13:41:   code: 13,
2023-09-07T18:13:41:   details: 'Received RST_STREAM with code 0',
2023-09-07T18:13:41:   metadata: Metadata { internalRepr: Map(0) {}, options: {} },
2023-09-07T18:13:41:   note: 'Exception occurred in retry method that was not classified as transient'
2023-09-07T18:13:41: }

그리고 gcloud auth listreturn 을 실행했기 No credentialed accounts.때문에 인증이 제거/만료되었다고 가정했습니다.

내 계정을 삭제 ~/.config/gcloud하고 재인증을 시도했습니다.

$ gcloud auth login
Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?response_type=code...

Enter authorization code: [...]

You are now logged in as [[email protected]].
Your current project is [None].  You can change this setting by running:
  $ gcloud config set project PROJECT_ID

여태까지는 그런대로 잘됐다. 성공적으로 인증된 것 같습니다.

$ gcloud auth list
    Credentialed Accounts
ACTIVE  ACCOUNT
*       [email protected]

To set the active account, run:
    $ gcloud config set account `ACCOUNT`

그러나 프로젝트를 나열할 수 없습니다.

$ gcloud projects list
ERROR: (gcloud.projects.list) HTTPError 403: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 403 (Forbidden)!!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>403.</b> <ins>That’s an error.</ins>
  <p>Your client does not have permission to get URL <code>/v1/projects</code> from this server.  <ins>That’s all we know.</ins>

프로젝트 ID를 수동으로 설정하면 다음과 같이 표시됩니다.

$ gcloud config set project my_project_id
WARNING: You do not appear to have access to project [my_project_id] or it does not exist.
Are you sure you wish to set property [core/project] to my_project_id?

Do you want to continue (Y/n)?  y

Updated property [core/project].

을 선택하면 yNodejs 앱에 다음 오류가 발생합니다.

오류: 기본 자격 증명을 로드할 수 없습니다. 찾아보기https://cloud.google.com/docs/authentication/getting-started자세한 내용은.

다른 컴퓨터에서는 동일한 사용자로 로그인하여 실행하면 gcloud projects list올바르게 작동합니다.

$ gcloud projects list
PROJECT_ID                 NAME       PROJECT_NUMBER
aaa                        aaa        123456789012
bbb                        bbb        123456789012
ccc                        ccc        123456789012
ddd                        ddd        123456789012
eee                        eee        123456789012
fff                        fff        123456789012
ggg                        ggg        123456789012
hhh                        hhh        123456789012

편집하다:

나는 또한 다음을 시도했습니다.

  • gcloud를 최신 버전으로 업데이트하는 중
  • 새로운 사용자 생성
  • 방화벽 비활성화
  • 의류 비활성화

답변1

제한된 VIP가 지원하지 않는 API 엔드포인트에 액세스하려고 하면403 금지된 오류.

차단된 VIP에 대한 응답 내용은 별개입니다.HTML 형식 오류문제는 제한된 VIP 통합 문제입니다.

의 IP 주소 범위는 restricted.googleapis.com and private.googleapis.com각각 199.36.153.4/30 및 199.36.153.8/30입니다. 제한된 Google API는 다음 용도로만 사용해야 합니다.제한된 VIP가 지원하는 서비스.

사용중인 경우 restricted.googleapis.com사용할 수 있습니다DNS 구성해결책으로 필요에 따라 DNS CNAME 레코드를 199.36.153.8/30으로 업데이트 하고 www.googleapis.com비공개 Google API 액세스가 서브넷에 대해 활성화되어 있는지 또는 VM에 외부 IP가 있는지 확인하십시오.private.googleapis.comprivate.googleapis.com기본 도메인마찬가지로 사용할 수 있습니다.

답변2

문제는 내 서버의 IP가 Google Cloud에서 차단된 것 같습니다. 다운로드를 시도했습니다https://packages.cloud.google.com/apt/doc/apt-key.gpg다음 출력으로 403 상태를 생성합니다.

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 403 (Forbidden)!!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>403.</b> <ins>That’s an error.</ins>
  <p>Your client does not have permission to get URL <code>/apt/doc/apt-key.gpg</code> from this server.  <ins>That’s all we know.</ins>

관련 정보