Hi
We are having som trouble with the ip/mactracker. Running nav on debian 6.0.7, current nav versjon 3.14.1592653. Suspect the problems came a few versions back. Hopefully someone has a suggestion on what could be wrong. If we search for a mac we get the follow error :
Environment:
Request Method: GET Request URL: http://xxx.karmoy.kommune.no/machinetracker/mac/?mac=000ab7448360&days=7 Django Version: 1.2.3 Python Version: 2.6.6 Installed Applications: ['nav.django'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')
Traceback: File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/pymodules/python2.6/nav/web/machinetracker/views.py" in mac_search 164. return mac_do_search(request) File "/usr/lib/pymodules/python2.6/nav/web/machinetracker/views.py" in mac_do_search 216. ip_count = len(arp_result) File "/usr/lib/pymodules/python2.6/django/db/models/query.py" in __len__ 81. self._result_cache = list(self.iterator()) File "/usr/lib/pymodules/python2.6/django/db/models/query.py" in iterator 829. for row in self.query.get_compiler(self.db).results_iter(): File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py" in results_iter 672. for rows in self.execute_sql(MULTI): File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py" in execute_sql 727. cursor.execute(sql, params) File "/usr/lib/pymodules/python2.6/django/db/backends/util.py" in execute 15. return self.cursor.execute(sql, params) File "/usr/lib/pymodules/python2.6/django/db/backends/postgresql_psycopg2/base.py" in execute 44. return self.cursor.execute(query, args)
Exception Type: DatabaseError at /machinetracker/mac/ Exception Value: function array_agg(character varying) does not exist LINE 1: SELECT (SELECT array_to_string(array_agg(DISTINCT name),', '... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Hilsen Jostein Berge It-konsulent Karmøy Kommune
On Mon, 26 Aug 2013 08:00:41 +0200 (CEST) Jostein Berge jostein.berge@karmoy.kommune.no wrote:
Hi
We are having som trouble with the ip/mactracker. Running nav on debian 6.0.7, current nav versjon 3.14.1592653. Suspect the problems came a few versions back.
Hopefully someone has a suggestion on what could be wrong. If we search for a mac we get the follow error :
[snip]
Exception Type: DatabaseError at /machinetracker/mac/ Exception Value: function array_agg(character varying) does not exist LINE 1: SELECT (SELECT array_to_string(array_agg(DISTINCT name),', '... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Yes, this is a bug, which we have regrettably forgotten/neglected to fix.
NAV 3.14 claims compatibility with PostgreSQL 8.3, but the new netbios scanning feature in 3.14 also introduced an unintended dependency on PostgreSQL 9 in the Machine Tracker UI. We thought we worked around this - but apparently, it will still need PostgreSQL 8.4.
There are two workarounds, one of which we can introduce as a bugfix in the 3.14 series. The bugfix version would be to create the aggregate function that doesn't exist in PostgreSQL 8.3, by running `sudo -u postgres psql nav` and issuing the following SQL:
CREATE AGGREGATE manage.array_agg(anyelement) ( SFUNC=array_append, STYPE=anyarray, INITCOND='{}' );
The workaround version is to simply upgrade to PostgreSQL 8.4 or newer. On that note, one of the coming NAV releases, either in September or December, will require PostgreSQL 9, so you may already start thinking about upgrades.
morten.brekkevold@uninett.no said:
On that note, one of the coming NAV releases, either in September or December, will require PostgreSQL 9, so you may already start thinking about upgrades.
Will something break if I upgrade to PostgreSQL 9 while still running 3.14.15etc?
Which version will UNINETT use? 9.0, 9.1 or 9.2?
--Ingeborg
On Thu, 19 Sep 2013 10:31:44 +0200 Ingeborg Hellemo ingeborg.hellemo@uit.no wrote:
Will something break if I upgrade to PostgreSQL 9 while still running 3.14.15etc?
No.
Which version will UNINETT use? 9.0, 9.1 or 9.2?
We have been using 9.1 in production the past year or so. 9.1 is the default on the latest Debian stable version (Wheezy), so we will continue using it.