408 timeout error with postgraphile on AWS elastic beanstalk - amazon-web-services

I'm running postgraphile and apollo to get data for my react app. I am using npm concurrently to run the react server and to run postgraph using the CLI including --cors flag. Everything works fine when i run the app locally. When I upload everything to AWS elastic beanstalk, I can't access app.com:5000/graphiql and the app gives me a 408 timeout error code saying it is a problem with HTTPLink, then tells me there is a cross origin error. If i run the app on AWS and have it point to my localhost:5000/graphiql it works perfectly, but not when it is deployed to AWS. The part that confuses me is that it does not have a cross origin error when it is going from AWS to my localhost, but it does have a cross origin error when it's going from AWS to AWS.

By default PostGraphile binds to localhost; it sounds like you need it to bind to all interfaces. Try the --host 0.0.0.0 option documented here:
https://www.graphile.org/postgraphile/usage-cli/

Related

request times out when pinging aws load balancer

I have a dockerized Node.JS express application that I am migrating to AWS from Google Cloud. I had done this before successfully on the same project before deciding Cloud Run was more cost effective because of their free tier. Now, wanting to switch back to Fargate, but am unable to do it again due what I'm guessing is a crucial step. For minimal setup, I used the following guide: https://docs.docker.com/cloud/ecs-integration/ Essentially, using docker compose up with aws context and project name to deploy to ECS and Fargate.
The Load Balancer gives me a public DNS name in the format: xxxxx.elb.us-west-2.amazonaws.com and I have defined a port of 5002 in my Docker container. I know the issue is not related to exposing port numbers or any code-related issue since I had this successfully running in Google Cloud Run. When I try to hit any of my express endpoints, by sending POST to xxxxx.elb.us-west-2.amazonaws.com:5002/my_endpoint, I end up with Error: Request Timed Out
Note: I have already verified that my inbound security rules have been set to all traffic.
I am very new to AWS, so would love guidance if I am missing a critical step.
Thanks!
EDIT (SOLUTION): Turns out everything was deploying correctly, but after checking CloudWatch Logs, it turns out Fargate can't read environment variables defined inside of docker-compose file. Instead, they need to be defined in .env files, then read in docker-compose through -env-file flag. My code was then trying to listen on a port that was in environment variable but was undefined, so was receiving the below error in CloudWatch.

Django with postgresql deployment on aws elastic beanstalk

I’ve been trying to deploy a django application with postgresql db on aws elastic beanstalk and i ran into many issues that i surfed and solved. Now the application uploads fine however the environment is still not green and I constantly am receiving 502 bad gateway nginx. I’ve checked nginx logs which say 111 connection refused etc. I’ve tried changed the port to 8001 from 8000 but didn’t work out. Somebody please guide me on how to deploy my application successfully.
Here are some of the common errors logfiles. Try checking them out
--- Common Dbug Errors ---
$ eb logs
--Files (after eb ssh):
$ eb ssh
1.sudo nano /var/log/cfn-init.log
2.sudo nano /var/log/cfn-init-cmd.log (see command output and error from config)
And are you using AWS RDS to for PostgreSQL?
Here is a detailed explanation and some common error fixes discuss in this blog

Elastic Beanstalk not deploying and cannot find error in error logs

I am having an issue getting my application to deploy on the elastic beanstalk. It works on my local machine flawlessly however when I try to deploy to beanstalk it fails and rolls back to the sample application. Then when I check the error.log file it is empty. Also when I check the node.js file the only output is
> Elastic-Beanstalk-Sample-App#0.0.1 start /var/app/current
> node app.js
Server running at http://127.0.0.1:8081/
I don't understand how to find the error it sends when deploying to the server. Where should I be looking?
The reason it was deleting my logs is I had rolling with additional batch enabled. Thereby deleting my logs on rollback. As far as the error was concerned it was an error in my code that caused it to require a module that didn't exist
It appears that you are running the app with the HOST set to localhost (127.0.0.1). The localhost is accessible only to internal processes on your Beanstalk instance. Change the host to 0.0.0.0 so that the app can be accessed from other IP addresses.

Docker container runs local, but not on AWS Elastic BeanStalk

I created Docker container with flash and gunicorn. I tested it locally successfully and pushed it without any problems to Docker hub. I also have AWS EB CLI installed so I tested it with eb local run. Everything worked fine.
I used the following link to deploy it on AWS Elastic BeanStalk. When I visit URL of the application, I am getting HTTP ERROR 504. I looked at log file and there are any error messages.
How can I further troubleshoot this issue?

Spring Cloud Config Server requires restart on AWS

I am running a spring cloud config server through AWS Elastic Beanstalk. Everything seems to work fine, but after some time (around 2 weeks) I encounter problems accessing the configurations. I get the error
Loading configuration failed
without further details on the "Whitelabel error" page of spring boot (when accessing the configuration through the browser; access through client just times out).
When I restart the config server instance on Elastic Beanstalk I can access the configuration normally again (no repository/code changes, just restart).
I suppose this is not expected behavior - I don't believe there is a "timeout" on the config server after which a restart is required.
Could it have something to do with AWS?