Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 status code in "Check PWA reachability" ci step #2694

Open
parkejunior opened this issue Apr 22, 2024 · 0 comments
Open

502 status code in "Check PWA reachability" ci step #2694

parkejunior opened this issue Apr 22, 2024 · 0 comments

Comments

@parkejunior
Copy link

API Platform version(s) affected: 3.2.21

Description

Hey everyone, how is it going?

I recently upgraded to the v3.2.21 tag, performed the git resolves and committed the changes. I run out the tests on my local machine and everything was fine.
I run the pull to my repository on Github, but when I went to check the CI action, the "Check PWA reachability" job in the ci.yml file returned a 502 status code. I used the command git clean -dfX to clean the files in local cache so I could simulate a "clean" environment, and I simulated the curl that this job runs with the command:

docker compose up --wait --build && curl -vk --fail-with-body -H 'Accept: text/html' https://localhost

The return was the same as on Github. Testing a few times I noticed that this only occurs when there is no node_modules directory.

How to reproduce

  1. In an environment without local caching like Github actions.
  2. Using the command git clean -dfX to clear the local cache files or rm -rf pwa/node_modules/ to force pnpm to download the dependencies again.

Possible Solution
It's not a solution, it's more like a "silver tape to cover hole". I added a sleep 10s so that it would wait 10 seconds before run the curl. Running curl after this time is enough for the PWA to return status code 200 again.
CLI:

docker compose up --wait --build && sleep 10s && curl -vk --fail-with-body -H 'Accept: text/html' https://localhost

.github/workflows/ci.yml:

name: Check PWA reachability
  run: |
    sleep 10s
    curl -vk --fail-with-body -H 'Accept: text/html' https://localhost

Additional Context

Github action log
Run curl -vk --fail-with-body -H 'Accept: text/html' https://localhost
  curl -vk --fail-with-body -H 'Accept: text/html' https://localhost
  shell: /usr/bin/bash -e {0}
*   Trying 127.0.0.1:443...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to localhost (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.2 (IN), TLS header, Certificate Status (22):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.2 (IN), TLS header, Finished (20):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [15 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [926 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [78 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* TLSv1.2 (OUT), TLS header, Finished (20):
} [5 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: [NONE]
*  start date: Apr 22 18:47:21 2024 GMT
*  expire date: Apr 23 06:47:21 2024 GMT
*  issuer: CN=Caddy Local Authority - ECC Intermediate
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x56410c341e20)
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
> GET / HTTP/2
> Host: localhost
> user-agent: curl/7.81.0
> accept: text/html
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [122 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
} [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
* TLSv1.2 (IN), TLS header, Supplemental data (23):
{ [5 bytes data]
< HTTP/2 502 
< alt-svc: h3=":443"; ma=2592000
< server: Caddy
< content-length: 0
< date: Mon, 22 Apr 2024 18:47:35 GMT
< 
{ [0 bytes data]

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host localhost left intact
curl: (22) The requested URL returned error: 502
Error: Process completed with exit code 22.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant