Icinga / icingadb

Icinga configuration and state database supporting multiple environments
https://icinga.com
GNU General Public License v2.0
60 stars 21 forks source link

icingdb fails to start with "Error 1265" #176

Closed tobiasvdk closed 4 years ago

tobiasvdk commented 4 years ago

The icingadb service fails to start with the following error message on a satellite:

level=fatal msg="Error 1265: Data truncated for column 'notifications_enabled' at row 126"

The master is running:

$ sudo icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.0-rc1-1)

Copyright (c) 2012-2020 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: Debian GNU/Linux
  Platform version: 9 (stretch)
  Kernel: Linux
  Kernel version: 4.9.0-11-amd64
  Architecture: x86_64

Build information:
  Compiler: GNU 6.3.0
  Build host: runner-LTrJQZ9N-project-298-concurrent-0
  OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

This satellite are running version

$ sudo icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.0-rc1-1)

Copyright (c) 2012-2020 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: Debian GNU/Linux
  Platform version: 10 (buster)
  Kernel: Linux
  Kernel version: 4.19.0-6-amd64
  Architecture: x86_64

Build information:
  Compiler: GNU 8.3.0
  Build host: runner-LTrJQZ9N-project-298-concurrent-0
  OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019

IcingaDB version:

$ sudo icingadb --version
Icinga DB version: v1.0.0-rc1
N-o-X commented 4 years ago

Hi @tobiasvdk,

could you try to set the log level to debug? We should be able to see which statement is failing with that.

Greetings Noah

tobiasvdk commented 4 years ago

The last log messages are:

May 07 08:39:48 ewr-icinga2 icingadb[13102]: time="2020-05-07T08:39:48Z" level=debug msg="Finished Exec" affected_rows=1 args="{[[245 99 52 175 252 105 69 13 157 111 88 214 184 136 3 195] [218 57 163 238 94 107 75 13 50 85 191 239 149 96 24 144 175 216 7 9] [197 93 155 200 33 133 189 173 30 105 93 25 127 170 85 254 117 146 92 78] service [244 195 22 234 77 185 76 229 50 116 103 5 70 75 156 109 186 129 162 77] [223 217 99 100 226 222 232 76 202 236 100 131 15 239 196 231 93 166 0 156] 1588838206105 hard 0 0 99 99 1 SMART_STATE OK - SAS Drive [0:14] SMART Health Status seems to be okay. Power on: 945 days, 18 hours.  <nil> 2 ewr-icinga2.XXX]}" benchmark=204273.000000ns context=sql query="REPLACE INTO state_history (id, environment_id, endpoint_id, object_type, host_id, service_id, event_time, state_type,soft_state, hard_state, previous_soft_state, previous_hard_state, attempt, output, long_output, max_check_attempts, check_source)VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
May 07 08:39:48 ewr-icinga2 icingadb[13102]: time="2020-05-07T08:39:48Z" level=info msg="Inserted 243 users in 112.522281ms" action=insert benchmark=112.522281ms count=243 type=user
May 07 08:39:48 ewr-icinga2 icingadb[13102]: time="2020-05-07T08:39:48Z" level=fatal msg="Error 1265: Data truncated for column 'notifications_enabled' at row 188"
tobiasvdk commented 4 years ago

I had many unused contacts (total contacts = 243) configured in Icinga Director. I cleaned them up and icingadb is working now.

N-o-X commented 4 years ago

Interesting, thanks for the feedback! I'll have a look at our user synchronisation then 👍

Littlericket commented 4 years ago

@N-o-X I dont know if this fits, but I feel like your merge is making us fatal errors now:

time="2020-06-11T13:40:27+02:00" level=info msg="Inserted 86 users in 10.005287ms" action=insert benchmark=10.005287ms count=86 type=user
time="2020-06-11T13:40:27+02:00" level=fatal msg="Error 1265: Data truncated for column 'notifications_enabled' at row 1"

We have false/true values but the schema only allows "y / n" as a enum.

image

N-o-X commented 4 years ago

Hi @Littlericket,

this fix isn't available in any package yet. Did you compile Icinga DB yourself? If so, which commit did you use?

Greetings Noah

jprusch commented 4 years ago

I'm also affected by this bug. I see it is fixed. As I don't want to build Icinga DB on my own, is there a plan when a new package will be released?

yoshi314 commented 4 years ago

i am also hitting this on packaged icingadb

level=fatal msg="Error 1265: Data truncated for column 'notifications_enabled' at row 83"

using icingadb0-1.0.0~rc1-2.buster

N-o-X commented 4 years ago

I'm also affected by this bug. I see it is fixed. As I don't want to build Icinga DB on my own, is there a plan when a new package will be released?

sorry for the late reply. You can just use our snapshot repositories instead of testing. They contain the latest fixes.

using icingadb0-1.0.0~rc1-2.buster

That version doesn't contain the fix. Please also try using the snapshot packages 👍

yoshi314 commented 4 years ago

installed latest snapshot

lis 19 10:58:00 icinga2c icingadb[793]: time="2020-11-19T10:58:00+01:00" level=fatal msg="Error 1406: Data too long for column 'value' at row 258"

Related issue?