vpicavet / docker-pggis

Docker image for GIS-enabled PostgreSQL
GNU General Public License v2.0
56 stars 21 forks source link

psql: server closed the connection unexpectedly #2

Closed miloskroulik closed 9 years ago

miloskroulik commented 10 years ago

After successfully downloading the container, I did run it with provided command, however, I could not connect to it with local psql because of error:

psql: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

I saw no errors in docker logs I am running: latest Docker Linux Mint (equivalent to Ubuntu 14.04) psql 9.3.4

elemoine commented 10 years ago

I have the same problem since the upgrade from Ubuntu 13.04 to Ubuntu 14.04.

vpicavet commented 10 years ago

Hi, I can reproduce :-( Apparently something changed in docker wrt baseimage. I will try to find some time to fix this in the next weeks, do not hesitate if you have more feedback or find some fix.

vpicavet commented 10 years ago

I bumped PostgreSQL version to 9.4, and pggis version to 1.3. I rebuilt the image here and it works well. Registry is currently building the image, please test and report if something fails. You can test the registry image, or build it yourself.

elemoine commented 10 years ago

Thanks @vpicavet. I was actually trying to build the image myself. But I had problems. The postgresql service refused to start, and I was surprised to see that the "postgres" user, rather than "root", was used to start the service.

Anyway, I'll try your new image. But I'd really like to be able to build the image myself, to be able to help you with its maintenance.

vpicavet commented 10 years ago

PostgreSQL always runs as postgres user. In a standard distro, the init process runs as root and launch postgresql main process as postgres. As we do not use init.d but the phusion baseimage my_init, we directly launch the service as postgres.

I would be glad to get some maintenance help indeed. If you are on ubuntu 14.04 with stock docker 0.9.1, running the build instruction in the readme should now directly work. Keep me posted if not.

elemoine commented 10 years ago

I will. Thanks.

elemoine commented 10 years ago

The build fails for me. I'm going to create a separate issue for the build failure.

elemoine commented 10 years ago
psql: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

Same issue with the new image unfortunately.

vpicavet commented 10 years ago

Could you test and report with version 1.4 / 1.5 ?

elemoine commented 10 years ago

I just pulled the latest version. It does not work for me. I see a continuous flow of dots in the console, and I cannot connect to the database using psql.

$ docker.io run --rm -P --name pggis_test oslandia/pggis /sbin/my_init
WARNING: Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : [8.8.8.8 8.8.4.4]
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/init_db_script.sh...
Waiting for PostgreSQL to run...
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 13
..............................................................................................................................................................................................................................
$ psql -h localhost -p 49153 -U pggis -d pggis --password
Password for user pggis: 
psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

It worked for me yesterday :-)

tsauerwein commented 10 years ago

I am still having this problem (on 14.04). docker.io run ... keeps on printing out dots, and when trying to connect I also get server closed the connection unexpectedly.

$ sudo docker.io run --rm -P --name pggis_test oslandia/pggis /sbin/my_init
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/init_db_script.sh...
*** Running /etc/rc.local...
Waiting for PostgreSQL to run...
*** Booting runit daemon...
*** Runit started as PID 11
................................................................
vpicavet commented 10 years ago

Hi, Did you try the latest version ? Can you do the following :

There seem to be a very subtle and annoying bug with docker, which appear when downloading the image from the registry and seems to spoil something which stays even if you rebuild the image afterward. Very weird, I cannot nail it for now, but seems like a docker or docker registry bug more than a bug on the image.

Keep me posted if the above works.

tsauerwein commented 10 years ago

Yes, building manually worked. Thanks a lot!

vpicavet commented 9 years ago

Fixed the AUFS bug in 1.6 normally + documented workaround.