[Django] #21504: GeoDjango swallows connection errors as version failures

11 views
Skip to first unread message

Django

unread,
Nov 24, 2013, 12:36:02 AM11/24/13
to django-...@googlegroups.com
#21504: GeoDjango swallows connection errors as version failures
-------------------------------+--------------------
Reporter: paultag@… | Owner: nobody
Type: Uncategorized | Status: new
Component: GIS | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
I'm getting a:

django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS
version for database "glare". GeoDjango requires at least PostGIS version
1.3. Was the database created from a spatial database template?

but, when I look at the actual exception thrown by the version check:

./manage.py syncdbcould not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

It'd be great to be slightly more smart about this :)

--
Ticket URL: <https://code.djangoproject.com/ticket/21504>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 24, 2013, 7:20:18 AM11/24/13
to django-...@googlegroups.com
#21504: GeoDjango swallows connection errors as version failures
-------------------------------------+-------------------------------------
Reporter: paultag@… | Owner: bmispelon
Type: | Status: assigned
Cleanup/optimization | Version: 1.6
Component: GIS | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: nobody => bmispelon
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

The problem happens because we catch a wide range of errors when trying to
determine the postgis version [1].

We could probably be smarter about what we catch.

[1]
https://github.com/django/django/blob/master/django/contrib/gis/db/backends/postgis/operations.py#L261

--
Ticket URL: <https://code.djangoproject.com/ticket/21504#comment:1>

Django

unread,
Nov 24, 2013, 8:35:37 AM11/24/13
to django-...@googlegroups.com
#21504: GeoDjango swallows connection errors as version failures
-------------------------------------+-------------------------------------
Reporter: paultag@… | Owner: bmispelon
Type: | Status: closed
Cleanup/optimization | Version: 1.6
Component: GIS | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon <bmispelon@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"17912522cee1277c8c126394fbe94b7172f92e83"]:
{{{
#!CommitTicketReference repository=""
revision="17912522cee1277c8c126394fbe94b7172f92e83"
Fixed #21504 -- Don't shadow database errors when testing for postgis
version.

Thanks to trac user paultag for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21504#comment:2>

Django

unread,
Dec 10, 2013, 12:23:41 PM12/10/13
to django-...@googlegroups.com
#21504: GeoDjango swallows connection errors as version failures
-------------------------------------+-------------------------------------
Reporter: paultag@… | Owner: bmispelon
Type: | Status: closed
Cleanup/optimization | Version: 1.6
Component: GIS | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

Thanks for the fix, y'all!

--
Ticket URL: <https://code.djangoproject.com/ticket/21504#comment:3>

Reply all
Reply to author
Forward
0 new messages