502 Bad Gateway

Hi,

I’ve successfully run the terraform quick-start example for AWS but when trying to send through a test event I get the response:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

This is from using the curl example to the URL http(s)://sp-collector-lb-xxxxxxx.eu-west-1.elb.amazonaws.com/tp2. So both on the http and https port I get the same error.

I’m not sure where I should begin with trying to debug this? There were no errors during terraform apply and it output the collector dns at the end.

Hi @Laichzeit0 - what is your cURL command?

Generally the endpoint for POST requests is /com.snowplowanalytics.snowplow/tp2 rather than just tp2 but a cURL request to an endpoint that doesn’t exist should give a 404 rather than a 502. To double check are there healthy EC2 instances behind the load balancer?

Yes, all the instances are running.

When I ssh into one of the collector servers however, it seems to be just the base image running? There is no docker installed, nor the docker snowplow images? I’ve destroyed and recreated the environment on different regions, same issue. Tried default instead of secure, same issue. There must be something I’m missing here but can’t figure it out as I’ve followed the installation documentation with a fine-toothed comb.

Hey @Laichzeit0 when you are SSHed into the Collector Server can you check the contents of /var/log/user-data.log?

This is the log file that all the bootstrap commands are written to - it sounds like something is failing in the user-data which is causing this failure.


One idea here is that you might be deploying into private subnets but do you have internet access setup for those private subnets? The bootstrap requires internet access so if NAT Gateways / Servers are not configured properly the service won’t be able to launch properly.

Thank you very much, yes the private subnets not having internet access was the issue. Looks like everything is running now.

2 Likes