A
A
Anton Artyomov2016-02-03 12:57:24
Yii
Anton Artyomov, 2016-02-03 12:57:24

Intermittently empty primaryKey in Yii. What can be wrong?

Hello. After updating the CentOS 7 server, and in particular PHP, MariaDB and others, I encountered anomalous behavior of the web application.
The bottom line is this:
on a page that works with one of the tables, I get the error

Invalid argument supplied for foreach() (/home/.yii-framework-1.1.16/db/ar/CActiveFinder.php:469)

This error occurs as a result of the table's primaryKey being empty:
if(is_string($this->_table->primaryKey))
      ...
    else
    {
      ...
      foreach($this->_table->primaryKey as $name)
      ...
    }

But, if I update any row of this table through the database manager, then in $this->_table->primaryKey we get the name of the column, as it should be. If I update the records again, the primaryKey is empty again! And so endlessly. update table - error - update table - works - update table - error - update table - works...
I just don't know where to dig. restart MariaDB also helps.
I can’t reload the database now, because this is prod. I'll try to raise a clone of the application on the same server.
What are your opinions?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question