Looks like your MySQL is configured to be very strict, in a way that isn't
compatible with Django's queries.

You'll need to figure out where ONLY_FULL_GROUP_BY is enabled in your
configuration, and turn that off.

Christian

-- 
Christian Hammond
President/CEO of Beanbag <https://www.beanbaginc.com/>
Makers of Review Board <https://www.reviewboard.org/>

On Tue, Mar 1, 2016 at 9:44 AM, Jason Woodrich <jwoodr...@gmail.com> wrote:

> Sure, output is:
>
> SHOW VARIABLES LIKE 'sql_mode';
>
> +---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | Variable_name | Value
>
>                             |
>
> +---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | sql_mode      |
> ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
> |
>
> +---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> 1 row in set (0.00 sec)
>
> mysql> SELECT @@GLOBAL.sql_mode;
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | @@GLOBAL.sql_mode
>
>             |
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> |
> ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
> |
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> 1 row in set (0.00 sec)
>
> mysql> SELECT @@SESSION.sql_mode;
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> | @@SESSION.sql_mode
>
>            |
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
> |
> ONLY_FULL_GROUP_BY,NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
> |
>
> +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
>
>
> On Friday, February 26, 2016 at 3:27:09 PM UTC-7, Christian Hammond wrote:
>>
>> Hi Jason,
>>
>> Python version shouldn't make a difference here (though we require
>> 1.6/1.7), and those versions look good now.
>>
>> I checked again, and I may have been looking at the wrong query before.
>> Looking at our production instance of 2.5.x, we have the exact same query
>> you have, and aren't hitting this problem with MySQL.
>>
>> Please run this and send me the output:
>>
>> $ rb-site manage /path/to/site dbshell
>> SHOW VARIABLES LIKE 'sql_mode';
>> SELECT @@GLOBAL.sql_mode;
>> SELECT @@SESSION.sql_mode;
>>
>> Christian
>>
>> --
>> Christian Hammond
>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>> Makers of Review Board <https://www.reviewboard.org/>
>>
>> On Fri, Feb 26, 2016 at 1:26 PM, Jason Woodrich <jwoo...@gmail.com>
>> wrote:
>>
>>> Django is 1.6.11 and MySQL-python was 1.2.3, but I upgraded to 1.2.5 and
>>> removed 1.2.3.  I'm still getting the same error though.  Is there a
>>> requirement for the python version?
>>>
>>> Thanks
>>> Jason
>>>
>>>
>>> On Wednesday, February 17, 2016 at 2:49:02 PM UTC-7, Christian Hammond
>>> wrote:
>>>>
>>>> Hi Jason,
>>>>
>>>> I looked into this here, and the query that's being generated on my end
>>>> is complete, containing all the GROUP BY terms.
>>>>
>>>> Can you verify the version of Django on your end?
>>>>
>>>> You might also want to try upgrading to MySQLdb-Python 1.2.5.
>>>>
>>>> Christian
>>>>
>>>> --
>>>> Christian Hammond - chri...@beanbaginc.com
>>>> Review Board - https://www.reviewboard.org
>>>> Beanbag, Inc. - https://www.beanbaginc.com
>>>>
>>>> On Wed, Feb 17, 2016 at 9:56 AM, Jason Woodrich <jwoo...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Christian,
>>>>> I'm using mysqld  Ver 5.5.29-rel29.4 for Linux on x86_64 (Percona
>>>>> Server with XtraDB (GPL), Release rel29.4, Revision 401)
>>>>>
>>>>> Thanks,
>>>>> Jason
>>>>>
>>>>> On Monday, February 15, 2016 at 6:18:31 PM UTC-7, Christian Hammond
>>>>> wrote:
>>>>>>
>>>>>> Hi Jason,
>>>>>>
>>>>>> What version of MySQL are you running?
>>>>>>
>>>>>> Christian
>>>>>>
>>>>>> --
>>>>>> Christian Hammond - chri...@beanbaginc.com
>>>>>> Review Board - https://www.reviewboard.org
>>>>>> Beanbag, Inc. - https://www.beanbaginc.com
>>>>>>
>>>>>> On Mon, Feb 15, 2016 at 1:06 PM, Jason Woodrich <jwoo...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Greetings,
>>>>>>> I upgraded from 1.7 to 2.5.2 today and everything seemed to go
>>>>>>> smoothly, but now when I try to access reviews I'm getting this error:
>>>>>>>
>>>>>>> 2016-02-15 21:01:54,090 - ERROR -  - Exception thrown for user X at
>>>>>>> http://X/r/102/
>>>>>>>
>>>>>>> (1055, "'reviewboard20.diffviewer_diffset.name' isn't in GROUP BY")
>>>>>>> Traceback (most recent call last):
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/core/handlers/base.py", line
>>>>>>> 112, in get_response
>>>>>>>     response = wrapped_callback(request, *callback_args,
>>>>>>> **callback_kwargs)
>>>>>>>   File
>>>>>>> "/usr/lib/python2.6/site-packages/ReviewBoard-2.5.2-py2.6.egg/reviewboard/accounts/decorators.py",
>>>>>>> line 23, in _check
>>>>>>>     return login_required(view_func)(*args, **kwargs)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/contrib/auth/decorators.py",
>>>>>>> line 22, in _wrapped_view
>>>>>>>     return view_func(request, *args, **kwargs)
>>>>>>>   File
>>>>>>> "/usr/lib/python2.6/site-packages/ReviewBoard-2.5.2-py2.6.egg/reviewboard/site/decorators.py",
>>>>>>> line 35, in _check
>>>>>>>     return view_func(request, local_site=local_site, *args, **kwargs)
>>>>>>>   File
>>>>>>> "/usr/lib/python2.6/site-packages/ReviewBoard-2.5.2-py2.6.egg/reviewboard/reviews/views.py",
>>>>>>> line 459, in review_detail
>>>>>>>     diffsets = review_request.get_diffsets()
>>>>>>>   File
>>>>>>> "/usr/lib/python2.6/site-packages/ReviewBoard-2.5.2-py2.6.egg/reviewboard/reviews/models/review_request.py",
>>>>>>> line 595, in get_diffsets
>>>>>>>     .prefetch_related('files'))
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/models/query.py", line 
>>>>>>> 96, in
>>>>>>> __iter__
>>>>>>>     self._fetch_all()
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/models/query.py", line 
>>>>>>> 857,
>>>>>>> in _fetch_all
>>>>>>>     self._result_cache = list(self.iterator())
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/models/query.py", line 
>>>>>>> 220,
>>>>>>> in iterator
>>>>>>>     for row in compiler.results_iter():
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/models/sql/compiler.py", 
>>>>>>> line
>>>>>>> 713, in results_iter
>>>>>>>     for rows in self.execute_sql(MULTI):
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/models/sql/compiler.py", 
>>>>>>> line
>>>>>>> 786, in execute_sql
>>>>>>>     cursor.execute(sql, params)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/backends/util.py", line 
>>>>>>> 53,
>>>>>>> in execute
>>>>>>>     return self.cursor.execute(sql, params)
>>>>>>>   File "/usr/lib64/python2.6/site-packages/django/db/utils.py", line
>>>>>>> 99, in __exit__
>>>>>>>     six.reraise(dj_exc_type, dj_exc_value, traceback)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/backends/util.py", line 
>>>>>>> 53,
>>>>>>> in execute
>>>>>>>     return self.cursor.execute(sql, params)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/django/db/backends/mysql/base.py", 
>>>>>>> line
>>>>>>> 124, in execute
>>>>>>>     return self.cursor.execute(query, args)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/MySQLdb/cursors.py",
>>>>>>> line 174, in execute
>>>>>>>     self.errorhandler(self, exc, value)
>>>>>>>   File
>>>>>>> "/usr/lib64/python2.6/site-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/MySQLdb/connections.py",
>>>>>>> line 36, in defaulterrorhandler
>>>>>>>     raise errorclass, errorvalue
>>>>>>> OperationalError: (1055, "'reviewboard20.diffviewer_diffset.name'
>>>>>>> isn't in GROUP BY")
>>>>>>>
>>>>>>> I did some digging and found this is the query that's being
>>>>>>> generated:
>>>>>>>
>>>>>>> SELECT `diffviewer_diffset`.`id`, `diffviewer_diffset`.`name`,
>>>>>>> `diffviewer_diffset`.`revision`, `diffviewer_diffset`.`timestamp`,
>>>>>>> `diffviewer_diffset`.`basedir`, `diffviewer_diffset`.`history_id`,
>>>>>>> `diffviewer_diffset`.`repository_id`,
>>>>>>> `diffviewer_diffset`.`diffcompat`,
>>>>>>> `diffviewer_diffset`.`base_commit_id`, 
>>>>>>> `diffviewer_diffset`.`extra_data`,
>>>>>>> COUNT(`diffviewer_filediff`.`id`) AS `file_count`
>>>>>>> FROM `diffviewer_diffset`
>>>>>>> LEFT OUTER JOIN `diffviewer_filediff` ON ( `diffviewer_diffset`.`id`
>>>>>>> = `diffviewer_filediff`.`diffset_id` )
>>>>>>> WHERE `diffviewer_diffset`.`history_id` = 93
>>>>>>> GROUP BY `diffviewer_diffset`.`id`
>>>>>>> ORDER BY `diffviewer_diffset`.`revision` ASC,
>>>>>>> `diffviewer_diffset`.`timestamp` ASC
>>>>>>>
>>>>>>> Any thoughts?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Jason
>>>>>>>
>>>>>>> --
>>>>>>> Supercharge your Review Board with Power Pack:
>>>>>>> https://www.reviewboard.org/powerpack/
>>>>>>> Want us to host Review Board for you? Check out RBCommons:
>>>>>>> https://rbcommons.com/
>>>>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "reviewboard" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to reviewboard...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>> Supercharge your Review Board with Power Pack:
>>>>> https://www.reviewboard.org/powerpack/
>>>>> Want us to host Review Board for you? Check out RBCommons:
>>>>> https://rbcommons.com/
>>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "reviewboard" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to reviewboard...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>> Supercharge your Review Board with Power Pack:
>>> https://www.reviewboard.org/powerpack/
>>> Want us to host Review Board for you? Check out RBCommons:
>>> https://rbcommons.com/
>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "reviewboard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to reviewboard...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to