Search code examples
mysqldockerzend-framework2

Database insert causes docker container to crash?


I'm using Zend Framework 2. When I make a request that involves making an INSERT query into the database, the request hangs with no response or error thrown, and running docker ps takes a while and returns this error:

Error response from daemon: The requested address is not valid in its context.

I'd have to restart docker then to get it to work again.

I can make SELECT, UPDATE, AND DELETE queries with no problem.

Now, while debugging, I created a new database and tried to make the same request there, with an INSERT query, same code, same hostname, just a different database name used, and the INSERT worked.

Has anyone run into this kind of problem before? Any hints? Both databases use MyISAM engine.

I'm not sure what other information to include here, please let me know.

UPDATE: This doesn't happen if I perform a DELETE query first before executing the INSERT.


Solution

  • As a reference for others who will encounter this in the future, the cause for me was referencing a column name with a trailing whitespace (which it should not have), and trying to insert a NULL value into a NOT NULL field.