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

Occasional 504 Gateway Time-out when using api.dev.ooni.io #2741

Closed
ainghazal opened this issue Jun 3, 2024 · 0 comments
Closed

Occasional 504 Gateway Time-out when using api.dev.ooni.io #2741

ainghazal opened this issue Jun 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working triage

Comments

@ainghazal
Copy link

ainghazal commented Jun 3, 2024

Describe the bug

While contacting https://api.dev.ooni.io, the API will occasionally return a 504 after 60 seconds.

To Reproduce

❯ cat data.json
{"charging":true,"on_wifi":true,"platform":"linux","probe_asn":"AS0","probe_cc":"XX","run_type":"manual","software_name":"miniooni","software_version":"3.23.0-alpha","web_connectivity":{"category_codes":[]}}
❯ curl -X POST -H 'Content-type: application/json' --connect-timeout 5 -d @data.json https://api.dev.ooni.io/api/v1/check-in
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>

You need to send the request several times, frequency of the error varies. Some times it fails on check-in, others in submission, etc.

Expected behavior

Not a 504.

@ainghazal ainghazal added bug Something isn't working triage labels Jun 3, 2024
DecFox added a commit to ooni/devops that referenced this issue Jun 5, 2024
The `api.dev.ooni.org` domain was reportedly failing with the check-in
API as reported here: ooni/probe#2741. On more
inspection, we found that the `nginx` server was not configured with
IPv6 support which caused the connection between the upstream server and
the EC2 instance to time out. The `/var/log/nginx/error.log` logs found
on the machine:
```
2024/06/05 09:07:33 [error] 89061#89061: *519419 upstream timed out (110: Unknown error) while connecting to upstream, client: 10.0.1.164, server: _, request: "POST /api/v1/check-in HTTP/1.1", upstream: "https://[2a01:4f9:1a:9494::2]:443/api/v1/check-in", host: "api.dev.ooni.io"
2024/06/05 09:11:34 [error] 89061#89061: *519456 upstream timed out (110: Unknown error) while connecting to upstream, client: 10.0.1.164, server: _, request: "POST /api/v1/check-in HTTP/1.1", upstream: "https://[2a01:4f9:1a:9494::2]:443/api/v1/check-in", host: "api.dev.ooni.io"
```
To this end, the diff here adds support for IPv6 `egress` traffic for
the `nginx_sg` security group.
@DecFox DecFox closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants