@s.verna It happened again this morning and I was able to fire a curl
at it. Sadly this output suggests that the environment exists but we still get the 404 from the source plugin.
$ curl -X POST 'https://graphql.datocms.com/environments/feature-ch5474/preview/' -H 'Authorization: Bearer XXX' -d '{ "query": "{ _site { favicon { url } } }" }' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 104.18.39.139...
* TCP_NODELAY set
* Connected to graphql.datocms.com (104.18.39.139) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
* start date: Jul 6 00:00:00 2020 GMT
* expire date: Jul 6 12:00:00 2021 GMT
* subjectAltName: host "graphql.datocms.com" matched cert's "*.datocms.com"
* issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
* 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 0x7fd5cf008200)
> POST /environments/feature-ch5474/preview/ HTTP/2
> Host: graphql.datocms.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer xxxxx
> Content-Length: 44
> Content-Type: application/x-www-form-urlencoded
>
* We are completely uploaded and fine
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 200
< date: Mon, 14 Sep 2020 08:07:51 GMT
< content-type: application/json; charset=utf-8
< set-cookie: __cfduid=d94b57309922c16d4696d5b69787420fb1600070871; expires=Wed, 14-Oct-20 08:07:51 GMT; path=/; domain=.datocms.com; HttpOnly; SameSite=Lax; Secure
< cf-ray: 5d289de1ea2be65c-LHR
< access-control-allow-origin: *
< age: 64
< cache-control: no-cache, no-store, must-revalidate
< expires: 0
< vary: Authorization, Accept-Encoding
< via: 1.1 vegur, 1.1 varnish
< cf-cache-status: DYNAMIC
< access-control-allow-credentials: true
< access-control-allow-headers: authorization, content-type, x-environment, x-site-domain, x-api-version, user-agent, x-session-id
< access-control-allow-methods: GET, POST, PUT, OPTIONS, DELETE
< access-control-expose-headers: x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset
< access-control-max-age: 1728000
< cf-request-id: 052d41012c0000e65c5ab1e200000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< pragma: no-cache
< x-cache: HIT
< x-cache-hits: 1
< x-complexity: 12
< x-environment: feature-ch5474
< x-queue-time: 4ms
< x-request-id: 5a87a7e4-d67b-4bcf-88b3-6d749f7bfd16
< x-runtime: 0.077614
< x-served-by: cache-lcy19256-LCY
< x-timer: S1600070871.356496,VS0,VE0
< x-worker-method: get
< server: cloudflare
<
* Connection #0 to host graphql.datocms.com left intact
{"data":{"_site":{"favicon":{"url":"https://www.datocms-assets.com/33413/1598427034-favicon.gif"}}}}* Closing connection 0
I’m trying to add a sleep
now to see if waiting for the sandbox might fix it. Maybe the sandbox isn’t ready by the time we try to connect to it.
If this theory hold any merits we should consider waiting for the environment to be ready before completing the command.