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

Does anyone have this error? SELECT GROUP BY #28

Open
dieee opened this issue Nov 14, 2017 · 1 comment
Open

Does anyone have this error? SELECT GROUP BY #28

dieee opened this issue Nov 14, 2017 · 1 comment

Comments

@dieee
Copy link

dieee commented Nov 14, 2017

I'm doing the tests on ubuntu 16. The pyopenssl library was not installed correctly and I removed the version. After performing all the steps, I have this error:

Internal Server Error: /
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, 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 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/die/malspider/malspider_django/dashboard/views.py", line 68, in index
unique_alerts = ModelQuery.get_num_unique_alerts()
File "/home/die/malspider/malspider_django/dashboard/functions/model_helper.py", line 65, in get_num_unique_alerts
return len(list(all_alerts))
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 1219, in iter
query = iter(self.query)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 79, in iter
self._execute_query()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 113, in _execute_query
self.cursor.execute(self.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 95, 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)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 112, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1055, "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'malspider.alert.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by")
[14/Nov/2017 14:38:54] "GET / HTTP/1.1" 500 122406

thanks for everything This project it is a good job

@dieee
Copy link
Author

dieee commented Nov 14, 2017

This solve the error:
mysql -u root -p
Type your mysql root password and you should be presented with a mysql prompt, then type this to remove the strict group_by setting:
mysql> set GLOBAL sql_mode = '';
Thanks user @jasheppa5

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

1 participant