AzBuilder / terrakube

Open source IaC Automation and Collaboration Software.
https://docs.terrakube.io
Apache License 2.0
523 stars 44 forks source link

Upgrading to version 2.23.0 / 3.21.2 (Chart version) will result in broken Terrakube application #1344

Closed iam-take closed 1 month ago

iam-take commented 1 month ago

Bug description 🐞

After upgrading our cluster to the latest version we are confronted with a broken Terrakube cluster. The Organizations aren't visible anymore and endpoints become unreachable as well to gain access to the state files ect.

Logs file from the API Container


30-9-2024, 08:19:23.320
2024-09-30T06:19:23.318Z ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception
30-9-2024, 08:19:23.320
java.lang.IllegalArgumentException: Can not set boolean field org.terrakube.api.rs.team.Team.manageState to null value
30-9-2024, 08:19:23.320
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:na]
30-9-2024, 08:19:23.320
30-9-2024, 08:19:23.320
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[na:na]
30-9-2024, 08:19:23.320
at java.base/jdk.internal.reflect.UnsafeBooleanFieldAccessorImpl.set(Unknown Source) ~[na:na]
30-9-2024, 08:19:23.320
at java.base/java.lang.reflect.Field.set(Unknown Source) ~[na:na]
30-9-2024, 08:19:23.320
at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:57) ~[hibernate-core-6.5.3.Final.jar:6.5.3.Final]
30-9-2024, 08:19:23.321
java.lang.IllegalArgumentException: Can not set boolean field org.terrakube.api.rs.team.Team.manageState to null value

2024-09-30T06:25:14.385Z ERROR 1 --- [ task-9] c.y.e.j.DefaultJsonApiExceptionHandler : Error or exception uncaught by Elide
30-9-2024, 08:25:14.388
30-9-2024, 08:25:14.388
org.hibernate.PropertyAccessException: Null value was assigned to a property [class org.terrakube.api.rs.team.Team.manageState] of primitive type: 'org.terrakube.api.rs.team.Team.manageState' (setter)
30-9-2024, 08:25:14.388
at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:63) ~[hibernate-core-6.5.3.Final.jar:6.5.3.Final]

Steps to reproduce

Upgrade to Helm chart version 3.21.2 this issue will occur. When reverting the version back this will be gone and working correctly.

Expected behavior

No response

Example repository

No response

Anything else?

It might seem to have relation to the changes created in the state management that were introduced. But I might be wrong here.

We are using: Azure Kubernetes Services Azure SQL Server / Database Azure Storage Account Build-in Redis of Terrakube

alfespa17 commented 1 month ago

I think the script to update all the old values inside the teams table to "false" is missing, I will check today

alfespa17 commented 1 month ago

I fixed this issue, I will create a hotfix once I fix this other issue related to the new permission https://github.com/AzBuilder/terrakube/issues/1342

alfespa17 commented 1 month ago

This is fixed in version 2.23.1

iam-take commented 1 month ago

Thanks for the quick fix I just tested the upgrade and it is working properly now!