afgane / cloudlaunch-docker

A Dockerfile for building the Cloud Launch (https://github.com/galaxyproject/cloudlaunch) image
MIT License
0 stars 0 forks source link

Postgres connection failure #1

Closed alexjsmac closed 9 years ago

alexjsmac commented 9 years ago

Thanks for this Enis, but there appears to be an error when the build attempts to do the migrations:

Step 18 : RUN cd /srv/cloudlaunch/cloudlaunch &&     . /srv/cloudlaunch/.cl/bin/activate &&     python /srv/cloudlaunch/cloudlaunch/biocloudcentral/manage.py syncdb --noinput
 ---> Running in 1a7a702c5fc9
Syncing...
Traceback (most recent call last):
  File "/srv/cloudlaunch/cloudlaunch/biocloudcentral/manage.py", line 14, in <module>
    execute_manager(settings)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 56, in handle_noargs
    cursor = connection.cursor()
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 252, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/srv/cloudlaunch/.cl/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 140, in _cursor
    self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

The command '/bin/sh -c cd /srv/cloudlaunch/cloudlaunch &&     . /srv/cloudlaunch/.cl/bin/activate &&     python /srv/cloudlaunch/cloudlaunch/biocloudcentral/manage.py syncdb --noinput' returned a non-zero code: 1

Another student here has had similar problems with postgres and ended up running postrgres in a different container. I'll give that a shot.

afgane commented 9 years ago

Hmm, I didn’t think stuff like this is supposed to be happening with Docker... The image builds fine on my machine. I pushed it to Docker Hub so feel free to try that one: https://registry.hub.docker.com/u/afgane/cloudlaunch/

Reusing a docker potgres image and hooking this up with fig for example would be a nicer way of going about it but until it's demonstrated as useful, I didn't feel like getting into all of that. In other words, if you guys manage to set it up better, please consider issuing a pull request with the enhancements.

alexjsmac commented 9 years ago

Have just come back to this and successfully launched the container on OSX 10.10.5.

Note that boot2docker is deprecated in the most recent version of Docker. Instead of $ boot2docker ssh -vnNTL 8000:localhost:8000, in a separate tab I ran $ ssh docker@$(docker-machine ip default) -L 8000:localhost:8000 and was able to reach the application.

This issue can be closed though.