visgence / icinga2-dependency-module

33 stars 12 forks source link

mysql kickstart issues #5

Open bengelberth opened 5 years ago

bengelberth commented 5 years ago

I was getting errors that the database could not save data to the database.

I figured out that even though I did the latest init.sql I was still missing the api_host column.

Trying to use the 01-migration.sql produced this error. ERROR 1101 (42000) at line 1: BLOB/TEXT column 'api_host' can't have a default value

So, I removed the default value from the schema and it now works!

I had to add $e->getMessage() to the db commit message so I could see that the column was missing. I think the api_host column should be in the init.sql rather than having to run upgrade scripts on initial installs????

Neat module and I hope to learn more about it now that it is working:-)

MEschenbacher commented 5 years ago

commit b83545d9d76bc8f0640fcfa750a93fed391c146f provides a default value for api_host which apparently only works for postgresql. The intentation of that default value was to keep the up-to-that-point default value (localhost) in place. We could drop that default value and provide a UPDATE [...] SET api_host = 'localhost' WHERE api_host IS NULL directly after adding the column.

Harvie commented 4 years ago

I wasn't able to get this plugin running on latest debian with mysql. So i reinstalled icinga2 using postgres and it still does not work... Can you please make sure that it installs on fresh debian install with icinga2?

MEschenbacher commented 4 years ago

Do you get the same error message?