You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Business Unit has more than one machine group, and plugins that use the machines query, it fails to load, throwing an exception:
[14/Dec/2016 10:45:58] ERROR [django.request:124] Internal Server Error: /id_pluginload/Status/bu_dashboard/1/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/home/docker/sal/server/views.py", line 574, in plugin_load
html = plugin.plugin_object.widget_content(page, machines, theID)
File "/home/docker/sal/server/plugins/status/status.py", line 40, in widget_content
errors = machines.filter(errors__gt=0).count()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 369, in count
return self.query.get_count(using=self.db)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 476, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 457, in get_aggregation
result = compiler.execute_sql(SINGLE)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
ProgrammingError: more than one row returned by a subquery used as an expression
The root of this problem is actually in the /server/views.py machines query for BusinessUnit filtered machines.
9687da3 rewrote the querying, and mistakenly tries to do a "exact" query on machine groups (which is why we see the "more than one row" error in the logs, and the problem disappears for Business Units with only one Machine Group.
PR incoming.
The text was updated successfully, but these errors were encountered:
When a Business Unit has more than one machine group, and plugins that use the machines query, it fails to load, throwing an exception:
The root of this problem is actually in the
/server/views.py
machines query forBusinessUnit
filtered machines.9687da3 rewrote the querying, and mistakenly tries to do a "exact" query on machine groups (which is why we see the "more than one row" error in the logs, and the problem disappears for Business Units with only one Machine Group.
PR incoming.
The text was updated successfully, but these errors were encountered: