Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with newest django and postgres and PostGIS on debian jessie #254

Closed
MTRNord opened this issue Aug 19, 2016 · 7 comments
Closed

Comments

@MTRNord
Copy link

MTRNord commented Aug 19, 2016

Log and Dockerfile is here: https://hub.docker.com/r/nordgedanken/mapit-docker/builds/bsodxh8yyyubnpaa9p446c/
Django Version being installed: Django-1.10
Postgresql Version: postgresql-9.4
Postgis Version: postgresql-9.4-postgis-2.1

Note I had to edit some files that can be found here: https://github.com/Nordgedanken/mapit-docker/tree/5c826957661b7b9f01d0f83427817844c6ee3f4d

@MTRNord MTRNord changed the title Problem with neweset django and postgres and PostGIS on debian jessie Problem with newest django and postgres and PostGIS on debian jessie Aug 19, 2016
@MTRNord
Copy link
Author

MTRNord commented Aug 19, 2016

Fixed by removing one install

@MTRNord MTRNord closed this as completed Aug 19, 2016
@dracos
Copy link
Member

dracos commented Aug 19, 2016

There are some things that need resolving in our install script to handle jessie fully; we don't claim jessie support for it as yet. It needs to act like trusty and not try and do a PostGIS1 data install.

Something goes wrong with your setting of the locale, looking at all the locale warning outputs, so you should probably work out what is causing that (I don't think that's MapIt related). It would make the log easier to follow certainly :)

The issue here for anyone else reading this was that it was doing a PostGIS1 way of installing PostGIS, but you're running PostGIS2, so in the end Django which now only supports PostGIS2 tries to install both and it errors.

Your script is still currently trying to install postgis1 stuff, but as you've removed the installation of the server package they all error out quickly (e.g. "postgis.sql: No such file or directory"). You should remove those bits too. You don't need:

COPY ./create_template_postgis-debian.sh /create_template_postgis-debian.sh
RUN chmod +x /create_template_postgis-debian.sh && service postgresql start; su -l -c "bash /create_template_postgis-debian.sh" postgres

You also don't need to install Shapely separately, you'll see it says it's already installed.

@MTRNord
Copy link
Author

MTRNord commented Aug 19, 2016

I used a lot of the australian docker thats why some old code is in there. I am still cleaning it up. and the local problem am I working on (somehow it refuses to work like it should). But the Build worked at this time.

@MTRNord
Copy link
Author

MTRNord commented Aug 19, 2016

@dracos

COPY ./create_template_postgis-debian.sh /create_template_postgis-debian.sh
RUN chmod +x /create_template_postgis-debian.sh && service postgresql start; su -l -c "bash /create_template_postgis-debian.sh" postgres

this is somehow needed (note it is changed in the file) because otherwise the installer gives psql: FATAL: database "template_postgis" does not exist

@dracos
Copy link
Member

dracos commented Aug 19, 2016

Right, that's because as I said "There are some things that need resolving in our install script to handle jessie fully" - that's another bit that has hardcoded ubuntu+trusty rather than "recent enough postgis". So you are creating a template in order to get past a check that shouldn't be running.
You don't want to be putting PostGIS1 stuff in a PostGIS2 database because something will get confused along the line. The correct thing to do is to fix the ubuntu trusty checks to work with jessie as well (or better any version of postgis2), then none of your special casing will be necessary.

@MTRNord
Copy link
Author

MTRNord commented Aug 19, 2016

Ok. Maybe if I get it cleaned up fully I will give your team an Snippet for it (Or maybe you are faster ;) )

@dracos
Copy link
Member

dracos commented Aug 19, 2016

I've put in a fix to the main install script at mysociety/commonlib#51
and mapit specific install scripts at #255
They'll probably be reviewed next week sometime, feel free to try them out, let us know if there are any issues with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants