The problem you see :

****  *DatabaseError: (1055, "Expression #2 of SELECT list is not in GROUP 
BY clause and contains nonaggregated column 
'weewx.archive_day_rain.dateTime' which is not functionally dependent on 
columns in GROUP BY clause; this is incompatible with 
sql_mode=only_full_group_by")*

is related to MySQL* :* Earlier versions were not to strict and accepted 
expressions that are correct for usual logic but incorrect according to SQL 
standard. They are now rejected by default, this is the reason of your 
error.
You can change this behavior by adding the (MySQL) command *" SET 
@@sql_mode=""; " * before the offending " SELECT " or simply at the 
beginning of you SQL code. In any case you have to repeat it whenever you 
reuse MySQL.

Note that this is NOT a MySQL error, the rejection of your command is 
correct according to the SQL standard.

The better solution is to correct the statement, that is adding " DateTime 
" in the " GROUP BY " list.  But to do it I need to dig further into weewx 
code.

An other solution is to change the defaults of MySQL from 
"*sql_mode=only_full_group_by" 
*to* "**sql_mode="" ", *making MySQL non standard for all as* it *was in 
earlier version. I would not do it!


*Paul*
 



Le dimanche 26 août 2018 21:01:10 UTC+2, David Hathaway a écrit :
>
> I'm having a different error, I believe.  Any ideas on how to sort it out?
>
> My weewx is quite old indeed.  Ubuntu 18.04LTS and MySQL.
>
> I downloaded the version the day you posted it first, so it is v0.1?  
> Would the later revisions solve the issue?  I think not, since this appears 
> to be a SQL issue.
>
>
> 13:56:15 localhost weewx[23412]: restx: Wunderground-PWS: Published record 
> 2018-08-26 13:56:00 CDT (1535309760)
> Aug 26 13:56:16 localhost weewx[23412]: cheetahgenerator: Generated 14 
> files for report StandardReport in 0.78 seconds
> Aug 26 13:56:16 localhost weewx[23412]: imagegenerator: Generated 16 
> images for StandardReport in 0.76 seconds
> Aug 26 13:56:16 localhost weewx[23412]: reportengine: Caught unrecoverable 
> exception in generator weewx.cheetahgenerator.CheetahGenerator
> Aug 26 13:56:16 localhost weewx[23412]:        * ****  (1055, "Expression 
> #2 of SELECT list is not in GROUP BY clause and contains nonaggregated 
> column 'weewx.archive_day_rain.dateTime' which is not functionally 
> dependent on columns in GROUP BY clause; this is incompatible with 
> sql_mode=only_full_group_by")*
> Aug 26 13:56:16 localhost weewx[23412]:         ****  Traceback (most 
> recent call last):
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/reportengine.py", line 239, in run
> Aug 26 13:56:16 localhost weewx[23412]:         ****      obj.start()
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/reportengine.py", line 273, in start
> Aug 26 13:56:16 localhost weewx[23412]:         ****      self.run()
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 158, in run
> Aug 26 13:56:16 localhost weewx[23412]:         ****      ngen = 
> self.generate(gen_dict[section_name], self.gen_ts)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
> Aug 26 13:56:16 localhost weewx[23412]:         ****      ngen += 
> self.generate(section[subsection], gen_ts)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
> Aug 26 13:56:16 localhost weewx[23412]:         ****      ngen += 
> self.generate(section[subsection], gen_ts)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 320, in generate
> Aug 26 13:56:16 localhost weewx[23412]:         ****      default_binding)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 372, in _getSearchList
> Aug 26 13:56:16 localhost weewx[23412]:         ****      searchList += 
> obj.get_extension_list(timespan, db_lookup)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/user/belchertown.py", line 82, in get_extension_list
> Aug 26 13:56:16 localhost weewx[23412]:         ****      
> at_rainiest_month = wx_manager.getSql( at_rainiest_month_sql )
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weewx/manager.py", line 394, in getSql
> Aug 26 13:56:16 localhost weewx[23412]:         ****      
> _cursor.execute(sql, sqlargs)
> Aug 26 13:56:16 localhost weewx[23412]:         ****    File 
> "/usr/share/weewx/weedb/mysql.py", line 48, in guarded_fn
> Aug 26 13:56:16 localhost weewx[23412]:         ****      raise klass(e)
> Aug 26 13:56:16 localhost weewx[23412]:         ****  *DatabaseError: 
> (1055, "Expression #2 of SELECT list is not in GROUP BY clause and contains 
> nonaggregated column 'weewx.archive_day_rain.dateTime' which is not 
> functionally dependent on columns in GROUP BY clause; this is incompatible 
> with sql_mode=only_full_group_by")*
> Aug 26 13:56:16 localhost weewx[23412]:         ****  Generator terminated
> Aug 26 13:56:16 localhost weewx[23412]: copygenerator: copied 1 files to 
> /var/www/html/weewx/belchertown
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to