1

I am trying to deploy a website I created using flask framework on AWS.

I created an EC2 instance, a security group profile and then created an environment on Elastic Beanstalk to upload and deploy the website. Everything ran smoothly and it even generated my website link in like 2 minutes but when I click the link the website, I get an HTTP 502 error.

How do I figure out what is wrong?

Zags
  • 37,389
  • 14
  • 105
  • 140
  • Please describe what "does not work" means. Do you get an error message, or a timeout error or what? Be precise in what exactly the current behavior or error is. – Mark B Jul 09 '23 at 21:36
  • THe error I get is This page isn’t working b***s.af-south-1.elasticbeanstalk.com is currently unable to handle this request. HTTP ERROR 502 – Nyiko Maswanganyi Jul 10 '23 at 07:42
  • That sounds like your request is making it to the load balancer, but the load balancer can't communicate with the EC2 server. I would start by looking at the logs for your server to see if there was some sort of issue or startup error. – Mark B Jul 10 '23 at 13:23

1 Answers1

0

If you're getting a 502, it is very likely your deployment failed and you need to look at the deployment logs for the particular error that happened during deployment. Try the eb logs command from the EB CLI.

If that doesn't tell you enough information, ssh onto your EB instance and tail all of the files in the /var/logs directory.

Once you find your error, then you can either debug it or post a more specific question.

As an aside, Elastic Beanstalk will launch an EC2 instance and configure security groups for you. If you launched your own EC2 instance, it is likely you have two EC2 instances running.

Zags
  • 37,389
  • 14
  • 105
  • 140
  • the log files gave me the error below /var/log/nginx/error.log ---------------------------------------- 2023/07/11 18:14:24 [warn] 1936#1936: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size I tried to add types_hash_bucket_size: 4069 as an environmental property but nothing changed – Nyiko Maswanganyi Jul 11 '23 at 18:46
  • @NyikoMaswanganyi It's possible that you didn't fix that error (in which case you should post a question specifically about that error). It is also possible that there is a new error now, and you should check the logs again. You often have to do multiple rounds of deploying and debugging to get it to work. – Zags Jul 11 '23 at 19:23