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

rfhistoric parser "MySQLdb._exceptions.OperationalError: (1140, "In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'test.TB_EXECUTION.Execution_Pass'; this is incompatible with sql_mode=only_full_group_by")" #21

Open
vikitech83 opened this issue Jul 1, 2020 · 5 comments
Labels
question Further information is requested

Comments

@vikitech83
Copy link

After cleaning up tables and re-installing of latest version of packages.
Creation of project in dashboard is success,also parser returns no errors.
When click View button on project dashboard reports error.

rfhistoricparser -o "output.xml" -s "localhost" -n "test" -e "smoke"
Capturing execution results, This may take few minutes...
INFO: Capturing suite results
INFO: Capturing test results
INFO: Writing execution results

127.0.0.1 - - [02/Jul/2020 10:24:39] "GET /test/dashboard HTTP/1.1" 500 -
[2020-07-02 10:30:43,918] ERROR in app: Exception on /test/dashboard [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/usr/local/lib/python3.6/dist-packages/robotframework_historic/app.py", line 92, in dashboard
cursor.execute("select execution_pass, ROUND(MIN(execution_pass),2), ROUND(AVG(execution_pass),2), ROUND(MAX(execution_pass),2) from TB_EXECUTION order by execution_id desc;")
File "/usr/local/lib/python3.6/dist-packages/MySQLdb/cursors.py", line 209, in execute
res = self._query(query)
File "/usr/local/lib/python3.6/dist-packages/MySQLdb/cursors.py", line 315, in _query
db.query(q)
File "/usr/local/lib/python3.6/dist-packages/MySQLdb/connections.py", line 239, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1140, "In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'test.TB_EXECUTION.Execution_Pass'; this is incompatible with sql_mode=only_full_group_by")
127.0.0.1 - - [02/Jul/2020 10:30:43] "GET /test/dashboard HTTP/1.1" 500 -

@Ankita-020696
Copy link

Ankita-020696 commented Jul 2, 2020

Hello
I faced the same issue before. I resolved it using below steps.

step1: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
step2: Add following line in mysqld.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

step3: sudo service mysql restart

Hope this will help.
Thanks

@adiralashiva8 adiralashiva8 added the question Further information is requested label Jul 2, 2020
@vikitech83
Copy link
Author

vikitech83 commented Aug 5, 2020

applied above solution of :
step1: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
step2: Add following line in mysqld.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

step3: sudo service mysql restart

ISSUE: Getting "rfhistoric -s "remotesqlserver"

  • Serving Flask app "robotframework_historic.app" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [05/Aug/2020 14:45:55] "GET /home HTTP/1.1" 200 -
    127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
    127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
    127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
    127.0.0.1 - - [05/Aug/2020 14:45:58] "GET /home HTTP/1.1" 200 -
    [2020-08-05 14:46:00,012] ERROR in app: Exception on /sqldbremote/dashboard [GET]
    Traceback (most recent call last):
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
    File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/home/viksingh/.local/lib/python3.6/site-packages/robotframework_historic/app.py", line 92, in dashboard
    cursor.execute("select execution_pass, ROUND(MIN(execution_pass),2), ROUND(AVG(execution_pass),2), ROUND(MAX(execution_pass),2) from TB_EXECUTION order by execution_id desc;")
    File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
    File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
    File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
    MySQLdb._exceptions.OperationalError: (1140, "In aggregated query without GROUP BY, expression Change average passed % label to average passed tests #1 of SELECT list contains nonaggregated column 'sqldbremote.TB_EXECUTION.Execution_Pass'; this is incompatible with sql_mode=only_full_group_by")
    127.0.0.1 - - [05/Aug/2020 14:46:00] "GET /sqldbremote/dashboard HTTP/1.1" 500 -

NOTE: msql db is remote.
[mysqld]
sql_mode =
STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

@Ankita-020696
Copy link

applied above solution of :
step1: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
step2: Add following line in mysqld.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

step3: sudo service mysql restart

ISSUE: Getting "rfhistoric -s "remotesqlserver"

* Serving Flask app "robotframework_historic.app" (lazy loading)

* Environment: production
  WARNING: This is a development server. Do not use it in a production deployment.
  Use a production WSGI server instead.

* Debug mode: off

* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
  127.0.0.1 - - [05/Aug/2020 14:45:55] "GET /home HTTP/1.1" 200 -
  127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
  127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
  127.0.0.1 - - [05/Aug/2020 14:45:57] "GET /home HTTP/1.1" 200 -
  127.0.0.1 - - [05/Aug/2020 14:45:58] "GET /home HTTP/1.1" 200 -
  [2020-08-05 14:46:00,012] ERROR in app: Exception on /sqldbremote/dashboard [GET]
  Traceback (most recent call last):
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
  response = self.full_dispatch_request()
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
  reraise(exc_type, exc_value, tb)
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
  raise value
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
  rv = self.dispatch_request()
  File "/home/viksingh/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/viksingh/.local/lib/python3.6/site-packages/robotframework_historic/app.py", line 92, in dashboard
  cursor.execute("select execution_pass, ROUND(MIN(execution_pass),2), ROUND(AVG(execution_pass),2), ROUND(MAX(execution_pass),2) from TB_EXECUTION order by execution_id desc;")
  File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 206, in execute
  res = self._query(query)
  File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 319, in _query
  db.query(q)
  File "/home/viksingh/.local/lib/python3.6/site-packages/MySQLdb/connections.py", line 259, in query
  _mysql.connection.query(self, query)
  MySQLdb._exceptions.OperationalError: (1140, "In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'sqldbremote.TB_EXECUTION.Execution_Pass'; this is incompatible with sql_mode=only_full_group_by")
  127.0.0.1 - - [05/Aug/2020 14:46:00] "GET /sqldbremote/dashboard HTTP/1.1" 500 -

NOTE: msql db is remote.
[mysqld]
sql_mode =
STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Hi,
Could you please tell which mysql version you are using & attached the mysqld.cnf file?

Regards,
Ankita

@vikitech83
Copy link
Author

vikitech83 commented Aug 5, 2020 via email

@vikitech83
Copy link
Author

vikitech83 commented Aug 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants