• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Issue only_full_group_by error

djchinezu2

New Pleskian
Version: Plesk Onyx v17.8.11_build1708180301.19 OS: Ubuntu 16.04.4 LTS

In my logs I have this error:

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'base.count_traffic.type' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by' in

mysql -V -> mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper

And SQL_MODE settings are: NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Same settings and same Pleask version on another server and all is working, but on this, no!
 
Judging by the error message, could you please temporary comment "sql_mode" directive in my.cnf file and restart mysql service.
If the issue persists, please update this thread.
 
I have this procedure that is not working for me and error is:

PHP:
MySQL said: #1055 - Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cpahub.count_traffic.type' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

But i have delete only_full_group_by from my.conf

PHP:
BEGIN
    DECLARE finished INTEGER DEFAULT '0';
    DECLARE clicks_var int default '0';
    declare payout float default 0;
    declare date_var date;
    declare user_id_var int(11);
    declare tool_id_var int(11);
    declare leads_var int(11);  
    declare offer_id_var int(11);
    declare type_var varchar(25);
    declare country_var varchar(50);
    declare os_var varchar(50);
    declare delete_count_traffic int default 0;

    declare clicks_stats CURSOR FOR SELECT SUM(`raw`) as `clicks` , `user_id` , COALESCE(SUM(`leads`),0)  as `leads` , COALESCE(SUM(`payout`),0)  as `payout` , DATE_FORMAT(date,'%Y-%m-%d') as `date` , `tool_id`, `type`  FROM `count_traffic` GROUP BY `user_id` , `tool_id` , `date`;

    declare country_stats CURSOR FOR SELECT SUM(`raw`) as `clicks` , `user_id` , COALESCE(SUM(`leads`),0)  as `leads` , COALESCE(SUM(`payout`),0)  as `payout` , DATE_FORMAT(date,'%Y-%m-%d') as `date` , `tool_id`, `type`, `country`  FROM `count_traffic` GROUP BY `user_id` , `tool_id` , `date`, `country`;

    declare offers_stats CURSOR FOR SELECT SUM(`raw`) as `clicks` , `user_id` , COALESCE(SUM(`leads`),0)  as `leads` , COALESCE(SUM(`payout`),0)  as `payout` , DATE_FORMAT(date,'%Y-%m-%d') as `date` , `tool_id`, `type`, `offer_id`  FROM `count_traffic` GROUP BY `user_id` , `tool_id` , `date`, `offer_id`;

    declare os_stats CURSOR FOR SELECT SUM(`raw`) as `clicks` , `user_id` , COALESCE(SUM(`leads`),0)  as `leads` , COALESCE(SUM(`payout`),0)  as `payout` , DATE_FORMAT(date,'%Y-%m-%d') as `date` , `tool_id`, `type`, `os`  FROM `count_traffic` GROUP BY `user_id` , `tool_id` , `date`, `os`;
   
    DECLARE CONTINUE HANDLER
    FOR NOT FOUND SET finished = 1;

    open clicks_stats;
    calculate_clicks_stats:LOOP
      FETCH clicks_stats into clicks_var,user_id_var,leads_var,payout,date_var,tool_id_var,type_var;
      IF finished = 1 THEN
        set finished=0;
        LEAVE calculate_clicks_stats;
      END IF;
      INSERT INTO `daily_clicks` (`user_id`, `tool_id`,`payout`,`leads`,`clicks`,`date`,`type`) VALUES (user_id_var,tool_id_var,payout,leads_var,clicks_var,date_var,type_var);
    END LOOP calculate_clicks_stats;
    close clicks_stats;
   
     open country_stats;
    calculate_country_stats:LOOP
      FETCH country_stats into clicks_var,user_id_var,leads_var,payout,date_var,tool_id_var,type_var,country_var;
      IF finished = 1 THEN
        set finished=0;
        LEAVE calculate_country_stats;
      END IF;
      INSERT INTO `daily_country` (`user_id`, `tool_id`,`payout`,`leads`,`clicks`,`date`,`type`,`country`) VALUES (user_id_var,tool_id_var,payout,leads_var,clicks_var,date_var,type_var,country_var);
    END LOOP calculate_country_stats;
    close country_stats;
   
        open offers_stats;
    calculate_offers_stats:LOOP
      FETCH offers_stats into clicks_var,user_id_var,leads_var,payout,date_var,tool_id_var,type_var,offer_id_var;
      IF finished = 1 THEN
        set finished=0;
        LEAVE calculate_offers_stats;
      END IF;
      INSERT INTO `daily_offers` (`user_id`, `tool_id`,`payout`,`leads`,`clicks`,`date`,`type`,`offer_id`) VALUES (user_id_var,tool_id_var,payout,leads_var,clicks_var,date_var,type_var,offer_id_var);
    END LOOP calculate_offers_stats;
    close offers_stats;
   
            open os_stats;
    calculate_os_stats:LOOP
      FETCH os_stats into clicks_var,user_id_var,leads_var,payout,date_var,tool_id_var,type_var,os_var;
      IF finished = 1 THEN
        set finished=0;
        LEAVE calculate_os_stats;
      END IF;
      INSERT INTO `daily_os` (`user_id`, `tool_id`,`payout`,`leads`,`clicks`,`date`,`type`,`os`) VALUES (user_id_var,tool_id_var,payout,leads_var,clicks_var,date_var,type_var,os_var);
    END LOOP calculate_os_stats;
    close os_stats;
    DELETE FROM `count_traffic`;  
    END
 
Look at this commands:

Code:
mysql> show session variables like '%sql_mode%';
+---------------+---------------------------------------------------------------                                                                          ------------------------+
| Variable_name | Value                                                                                                                                                           |
+---------------+---------------------------------------------------------------                                                                          ------------------------+
| sql_mode      | NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+---------------------------------------------------------------                                                                          ------------------------+
1 row in set (0.01 sec)

mysql> show global variables like '%sql_mode%';
+---------------+---------------------------------------------------------------------------------------+
| Variable_name | Value                                                                                 |
+---------------+---------------------------------------------------------------------------------------+
| sql_mode      | NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+---------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
 
I see following on my default Plesk Onyx 17.8 installation:

Code:
# plesk version
Product version: Plesk Onyx 17.8.11 Update #13
   Update date: 2018/06/21 02:58
    Build date: 2018/06/20 16:50
    OS version: CentOS 7.2.1511
      Revision: e14a7d8707c99876b94d78865d751676b8e666dc
   Architecture: 64-bit
Wrapper version: 1.2

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5566
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show global variables like '%sql_mode%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode      |       |
+---------------+-------+
1 row in set (0.00 sec)

MariaDB [(none)]> show session variables like '%sql_mode%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode      |       |
+---------------+-------+
1 row in set (0.01 sec)
 
How I can resolve this? Please help me!

In most distros, the MySQL config file /etc/my.cnf also includes additional config files from a directory like /etc/my.cnf.d (CentOS, for example).
* Check if you have any references to sql_mode in any config file that is included from /etc/my.cnf
* Check if you have any references to sql_mode in the system settings in /etc/debian/mysql (for Debian/Ubuntu systems)
* Check your init scripts (either /etc/init.d/mysql or /etc/systemd/system/mysqld.service or similar) for any references to sql_mode and/or additional config files

And you did restart MySQL, right? Just to make sure...
 
In most distros, the MySQL config file /etc/my.cnf also includes additional config files from a directory like /etc/my.cnf.d (CentOS, for example).
* Check if you have any references to sql_mode in any config file that is included from /etc/my.cnf
* Check if you have any references to sql_mode in the system settings in /etc/debian/mysql (for Debian/Ubuntu systems)
* Check your init scripts (either /etc/init.d/mysql or /etc/systemd/system/mysqld.service or similar) for any references to sql_mode and/or additional config files

And you did restart MySQL, right? Just to make sure...

I have check all of this, all look good, nothing about sql_mode
 
/root/.my.cnf is not required, if it doesn't exist then you don't need to worry about it.

One last idea: Can you please show the output of:
# ps auxw | grep mysql
 
/root/.my.cnf is not required, if it doesn't exist then you don't need to worry about it.

One last idea: Can you please show the output of:
# ps auxw | grep mysql


root@localhost:~# ps auxw | grep mysql
mysql 10801 0.8 14.7 1109820 150352 ? Ssl 11:08 0:00 /usr/sbin/mysqld
root 10845 0.0 0.0 12944 932 pts/0 S+ 11:08 0:00 grep --color=auto mysql
 
+1 having the same error. plesk version output below

Code:
Product version: Plesk Onyx 17.8.11 Update #24
    Update date: 2018/10/08 06:26
     Build date: 2018/09/27 18:08
     OS version: Ubuntu 16.04
       Revision: f184ec1c85934ecb09cf67b41bff796c0ea05c01
   Architecture: 64-bit
Wrapper version: 1.2
 
Back
Top