I am trying to get a Django REST Framework API with ReactJS as frontend to work on Beanstalk.
The pages are now showing, however when I try to register I get a 504 error.
Looking at the logs:
/var/log/nginx/error.log
2022/09/14 15:39:29 [error] 4456#4456: *1127 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.32.240, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "django-env1.eba--.us-west-2.elasticbeanstalk.com"
/var/log/web.stdout.log
Sep 15 10:51:30 ip-172-31-29-189 web: Traceback (most recent call last):
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/db/backends/base/base.py", line 244, in ensure_connection
Sep 15 10:51:30 ip-172-31-29-189 web: self.connect()
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
Sep 15 10:51:30 ip-172-31-29-189 web: return func(*args, **kwargs)
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/db/backends/base/base.py", line 225, in connect
Sep 15 10:51:30 ip-172-31-29-189 web: self.connection = self.get_new_connection(conn_params)
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
Sep 15 10:51:30 ip-172-31-29-189 web: return func(*args, **kwargs)
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 244, in get_new_connection
Sep 15 10:51:30 ip-172-31-29-189 web: connection = Database.connect(**conn_params)
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages/MySQLdb/__init__.py", line 123, in Connect
Sep 15 10:51:30 ip-172-31-29-189 web: return Connection(*args, **kwargs)
Sep 15 10:51:30 ip-172-31-29-189 web: File "/var/app/venv/staging-LQM1lest/lib64/python3.8/site-packages/MySQLdb/connections.py", line 185, in __init__
Sep 15 10:51:30 ip-172-31-29-189 web: super().__init__(*args, **kwargs2)
Sep 15 10:51:30 ip-172-31-29-189 web: MySQLdb.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 0")
I am trying to read up on what needs to be fixed for these errors, this is my first time trying to get an app onto Beanstalk.