Opened 7 years ago

Closed 5 years ago

#11038 closed Bug (invalid)

django tests using postgis

Reported by: funkmyster Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gary Wilson)

When running our newly developed test suite for geolocation, I kept receiving:

createlang -d test_<projectDB> -U <username> plpgsql
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/site-packages/django/core/management/__init__.py", line 359, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/site-packages/django/core/management/__init__.py", line 304, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/site-packages/django/core/management/commands/test.py", line 23, in handle
    failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
  File "/usr/local/lib/python2.6/site-packages/django/contrib/gis/tests/__init__.py", line 135, in run_tests
    create_test_spatial_db(verbosity=verbosity, autoclobber=not interactive)
  File "/usr/local/lib/python2.6/site-packages/django/contrib/gis/db/backend/postgis/creation.py", line 119, in create_test_spatial_db
    create_lang(db_name, verbosity=verbosity)
  File "/usr/local/lib/python2.6/site-packages/django/contrib/gis/db/backend/postgis/creation.py", line 25, in create_lang
    raise Exception("Error executing 'plpgsql' command: %s\n" % output)
Exception: Error executing 'plpgsql' command: 

apparently if 'plpgsql' is pre-installed on the newly generated instance:

createlang -d test_<projectDB> -U <username> plpgsql

...raises an exception with the value 2, thus breaking the test suite. Note my stack was built from source.

Attachments (1)

gis.diff (715 bytes) - added by funkmyster 7 years ago.
patch

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by funkmyster

Attachment: gis.diff added

patch

comment:1 Changed 7 years ago by Gary Wilson

Description: modified (diff)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Fixed ticket formatting.

comment:2 Changed 7 years ago by jbronn

Resolution: invalid
Status: newclosed

We added the POSTGIS_TEMPLATE (docs) setting for this exact reason -- set it with the name of your spatial database template that already has the procedural language created along with the PostGIS extension.

comment:3 Changed 5 years ago by Vinay Sajip

Easy pickings: unset
Resolution: invalid
Severity: Normal
Status: closedreopened
Type: Uncategorized
UI/UX: unset

I get the same error when trying to create the postgis_template database using the 'create_template_postgis_debian.sh' script, because plpgsql is apparently already present. Although in this case an error code of 2 is returned from createlang, it's not really an error, so the script should continue to add functions etc. to the template, but it bails before then.

This occurred on Ubuntu Oneiric 64-bit, PostgreSQL 9.1. So I cannot create a valid postgis_template database.

Last edited 5 years ago by Vinay Sajip (previous) (diff)

comment:4 Changed 5 years ago by Vinay Sajip

Type: UncategorizedBug

comment:5 Changed 5 years ago by Aymeric Augustin

This ticket describes a problem that happens when you run the test suite. If I understand correctly, your problem happens earlier, when your create the postgis_template database, so it's a different one.

Could you create a new ticket, if possible with more detail? Attaching the log of your terminal session would be very useful, we could try to understand the cause without setting up an Ubuntu.

Thanks!

comment:6 Changed 5 years ago by Claude Paroz

Resolution: invalid
Status: reopenedclosed

See comment:5 if you still have an issue, but please don't reopen this ticket.

Note: See TracTickets for help on using tickets.
Back to Top