#RDS Connection Issues

4 messages · Page 1 of 1 (latest)

sturdy sand
#

Hi, I've had my application running on aws elastic beanstalk for over a year but recently tried to implement django-q with elasticache. This was a more difficult than I anticipated.
After I moved everything over to a Procfile the migration and connection to the RDS broke (sort of). The weird thing is that the django app still can communicate and work as before, but when I try to manage.py migrate it wont.
I get this error message when ssh in and doing it manually:

django.db.utils.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
#

My container command log:

[ERROR] Command 01_migrate (source /var/app/venv/*/bin/activate && python3 manage.py migrate --settings=app.settings.production) failed
[ERROR] Error encountered during build of postbuild_0_app: Command 01_migrate failed
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 579, in run_config
    CloudFormationCarpenter(config, self._auth_config, self.strict_mode).build(worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 278, in build
    self._config.commands)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
    raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 01_migrate failed
[ERROR] -----------------------BUILD FAILED!------------------------
[ERROR] Unhandled exception during build: Command 01_migrate failed
Traceback (most recent call last):
  File "/opt/aws/bin/cfn-init", line 181, in <module>
    worklog.build(metadata, configSets, strict_mode)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 137, in build
    Contractor(metadata, strict_mode).build(configSets, self)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 567, in build
    self.run_config(config, worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 579, in run_config
    CloudFormationCarpenter(config, self._auth_config, self.strict_mode).build(worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 278, in build
    self._config.commands)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
    raise ToolError(u"Command %s failed" % name)
tiny tendon
#

.

rigid lava
#

It sounds like you're using a different settings file between the web process and your management commands