Facing a similar issue with requests returning HTTP 500 or 503 or hanging:
$ gcloud version
Google Cloud SDK 428.0.0
alpha 2023.04.25
beta 2023.04.25
bq 2.0.91
bundled-python3-unix 3.9.16
core 2023.04.25
gcloud-crc32c 1.0.0
gsutil 5.23
$
$ curl -V
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
$
$ curl -sSkv https://secretmanager.googleapis.com/v1/projects/mkdev/secrets --header "authorization: Bearer XXXXX" --header "content-type: application/json"
* Trying 142.250.178.138:443...
* TCP_NODELAY set
* Connected to secretmanager.googleapis.com (142.250.178.138) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=upload.video.google.com
* start date: Apr 3 08:24:24 2023 GMT
* expire date: Jun 26 08:24:23 2023 GMT
* issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55719bc948f0)
> GET /v1/projects/mkdev/secrets HTTP/2
> Host: secretmanager.googleapis.com
> user-agent: curl/7.68.0
> accept: */*
> authorization: Bearer XXXXX
> content-type: application/json
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 500
< vary: X-Origin
< vary: Referer
< vary: Origin,Accept-Encoding
< content-type: application/json; charset=UTF-8
< date: Wed, 26 Apr 2023 14:31:29 GMT
< server: ESF
< cache-control: private
< x-xss-protection: 0
< x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< accept-ranges: none
<
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
* Connection #0 to host secretmanager.googleapis.com left intact
$
$ curl -sSkv https://secretmanager.googleapis.com/v1/projects/mkdev/secrets --header "authorization: Bearer XXXXX" --header "content-type: application/json"
* Trying 172.217.18.202:443...
* TCP_NODELAY set
* Connected to secretmanager.googleapis.com (172.217.18.202) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=upload.video.google.com
* start date: Apr 3 08:24:24 2023 GMT
* expire date: Jun 26 08:24:23 2023 GMT
* issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55b59bf298f0)
> GET /v1/projects/mkdev/secrets HTTP/2
> Host: secretmanager.googleapis.com
> user-agent: curl/7.68.0
> accept: */*
> authorization: Bearer XXXXX
> content-type: application/json
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 500
< vary: X-Origin
< vary: Referer
< vary: Origin,Accept-Encoding
< content-type: application/json; charset=UTF-8
< date: Wed, 26 Apr 2023 14:35:00 GMT
< server: ESF
< cache-control: private
< x-xss-protection: 0
< x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
< accept-ranges: none
<
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
* Connection #0 to host secretmanager.googleapis.com left intact
$
$ nslookup secretmanager.googleapis.com | sort -u
Address: 10.18.0.50#53
Address: 142.250.178.138
Address: 142.250.179.106
Address: 142.250.179.74
Address: 142.250.201.170
Address: 142.250.75.234
Address: 172.217.18.202
Address: 172.217.20.170
Address: 172.217.20.202
Address: 216.58.213.74
Address: 216.58.214.170
Address: 216.58.214.74
Address: 2a00:1450:4007:807::200a
Address: 2a00:1450:4007:80b::200a
Address: 2a00:1450:4007:80d::200a
Address: 2a00:1450:4007:80e::200a
Name: secretmanager.googleapis.com
Non-authoritative answer:
Server: 10.18.0.50
$
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
$ uname -a
Linux MKD4411 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$
Requests work on another non-WSL Ubuntu 20.04.5 VM with same curl version and Google Cloud SDK 408.0.1. Not clear what the differenciating factor is.