When I click on the "Limits" tab for some clients, see https://xxa.se/i/205mg0t483mhaj57.png I get the error message: Code: Create Thread: Duplicate entry '1' for key 'PRIMARY' Where should I look to find root cause of this? I have checked the table client, and the primary key client_id us unique there, and table client_template is also ok.
Did you update recently and did this issue start after that? If so, how did you update? (re-)running the update might help: Code: cd /tmp wget https://www.ispconfig.org/downloads/ISPConfig-3.2.tar.gz tar xvfz ISPConfig-3.2.tar.gz cd ispconfig3_install/install php -q update.php
Nope, I have not updated since the initial 3.2 version, which was installed from scratch. I will see if the update fixes this, however this problem has started to occur.
Which guide did you follow to install your system? What is version shown under Help -> Version? Have you tried rebooting your system (I don't think this would work but it seems that it has worked for a user a while back)?
Code: ISPConfig Version: 3.2 I followed the PDF guide, for Debian 10 and ISPConfig 3.1. But, it used to work, for about a week, something has happened today that caused this. Reboot did not help.
So you've gone through the whole table client and client_template? Maybe in the table client_template_assigned? Did you remove a template that was assigned to some clients maybe? If I understand correctly only some of your clients have this issue, not all?
Yes, I went through the whole table client, there are only 5 clients there, I am just evaluating ISPConfig. I have not checked the other tables you mention, I will do that. There is only one template, and that template has not been removed. Not all clients, 3 of 5 have this issue. If you tell me what I should look after int the db I would be grateful.
The error occurs at Code: parent::onSubmit() in function onSubmit() in file client_edit.php https://xxa.se/i/wyikq41tekyc17oqk0x.png I dont know where to find Code: parent::onSubmit() to debug this further.
A parent comes from php class extension, so go to the top of this file and see what class it extends, then find where that class is defined.
Did you change anything on this code? It is not the same as what's in the 3.2. Release, especially this part: try commenting out the line under Code: if($this->id !=0)
That should not cause any problems except that you're missing GoAccess and some compression packages, I think. And the screenshotted file is incorrect for sure - must have been changed locally. So almost sure that causes it.
BS. The file has been changed, yes, but with debug code I put there to identify the problem. The problem was of course there before I edited it. Please dont underestimate/patronize me. I have however after several of hours debugging identified the root cause. The problem occurs in function Code: protected function _getDatasourceData($field, $record, $api = false) in the file tform_base.inc.php The function die() is called here: Code: // Getting the records $tmp_records = $app->db->queryAllRecords($querystring); if($app->db->errorMessage != '') die($app->db->errorMessage); if(is_array($tmp_records)) { $key_field = $field["datasource"]["keyfield"]; $value_field = $field["datasource"]["valuefield"]; foreach($tmp_records as $tmp_rec) { $tmp_id = $tmp_rec[$key_field]; $values[$tmp_id] = $tmp_rec[$value_field]; } } The query string sent is Code: SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name and Code: $app->db->errorMessage returns Code: 'Duplicate entry \'1\' for key \'PRIMARY\'' If I comment the line Code: //if($app->db->errorMessage != '') die($app->db->errorMessage); the problem disappear. When I feed the above SQL query to mysql, commandline as well via phpmyadmin, there is no error. However, since this problem is solved by commenting the line, I dont bother to debug any more. Thanks. Code: root@ic:/usr/local/ispconfig/interface/lib/classes# diff -c tform_base.inc.php-orig tform_base.inc.php *** tform_base.inc.php-orig 2020-10-24 14:46:06.966750533 +0200 --- tform_base.inc.php 2020-10-25 19:42:37.940873974 +0100 *************** *** 280,286 **** // Getting the records $tmp_records = $app->db->queryAllRecords($querystring); ! if($app->db->errorMessage != '') die($app->db->errorMessage); if(is_array($tmp_records)) { $key_field = $field["datasource"]["keyfield"]; $value_field = $field["datasource"]["valuefield"]; --- 280,286 ---- // Getting the records $tmp_records = $app->db->queryAllRecords($querystring); ! // if($app->db->errorMessage != '') die($app->db->errorMessage); if(is_array($tmp_records)) { $key_field = $field["datasource"]["keyfield"]; $value_field = $field["datasource"]["valuefield"];
I don't mean to underestimate / patronize you. But as you can see in https://git.ispconfig.org/ispconfig/ispconfig3/-/blob/develop/interface/web/client/client_edit.php , your file differs from the original. So I told you that something is wrong there, trying to be helpful to you
Yes, thanks for your extensive debugging. I have not seen any reports about this before, but we will have to check it.
Since there is not problem with the sql query as such I would assume there is some kind of garbage collection issue.