graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Fix V20190127111728_MigrateWidgetFormatSettings migration

Open bernd opened this issue 3 years ago • 0 comments

Description

The V20190127111728_MigrateWidgetFormatSettings can fail in some setups and block the server startup.

In some setups, most probably older ones, the migration can fail with a ClassCastException in line 92.

https://github.com/Graylog2/graylog2-server/blob/8d6038287a943a5cf9ca2465f085e68432aee6c3/graylog2-server/src/main/java/org/graylog/plugins/views/migrations/V20190127111728_MigrateWidgetFormatSettings.java#L92-L93

Refs https://github.com/Graylog2/graylog2-server/issues/13042

Context

Why didn't this show up earlier?

Since Graylog version 4.3, we execute the migrations at the beginning of the server startup. If a migration fails, we halt the server startup and throw an error. In Graylog version 4.2 and earlier, we skipped a failing migration and executed the next one.

So in some setups, the V20190127111728_MigrateWidgetFormatSettings was probably never executed correctly but was skipped without halting the server. With the new migration behavior, any failing migration stops the server startup.

Possible Solution

We should fix the migration to not fail with a ClassCastException.

For a possible behavior improvement for failing migrations, see:

  • https://github.com/Graylog2/graylog2-server/issues/13053

Steps to Reproduce (for bugs)

We don't have the broken database state, so it's probably hard to reproduce. :confused:

Your Environment

  • Graylog Version: 4.3

bernd avatar Jul 13 '22 16:07 bernd