Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Databinding exception for ValidationError$ErrorDetails #1345

Closed
willr3 opened this issue Feb 19, 2024 · 4 comments · Fixed by #1386
Closed

Databinding exception for ValidationError$ErrorDetails #1345

willr3 opened this issue Feb 19, 2024 · 4 comments · Fixed by #1386
Assignees
Labels
area/backend branch/master The master branch priority/high High priority type/bug Something isn't working
Milestone

Comments

@willr3
Copy link
Collaborator

willr3 commented Feb 19, 2024

Describe the bug

ValidationError$ErrorDetails does not match some of the entries in the database. This prevents the Test Datasets view from loading and presents an exception to the user.

To Reproduce

Build horreum from master with a production db backup and navigate to run/dataset/list/262

Version

What is the version of Horreum ? master

Error message

{
  "details": "Error id a40e86c5-fe31-415e-af18-eba47e6386a7-2, java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"schemaPath\" (class io.hyperfoil.tools.horreum.api.data.ValidationError$ErrorDetails), not marked as ignorable (12 known properties: \"evaluationPath\", \"details\", \"path\", \"schemaLocation\", \"message\", \"messageKey\", \"type\", \"valid\", \"code\", \"property\", \"arguments\", \"instanceLocation\"])",
  "stack": "java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"schemaPath\" (class io.hyperfoil.tools.horreum.api.data.ValidationError$ErrorDetails), not marked as ignorable (12 known properties: \"evaluationPath\", \"details\", \"path\", \"schemaLocation\", \"message\", \"messageKey\", \"type\", \"valid\", \"code\", \"property\", \"arguments\", \"instanceLocation\"])\n at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: java.lang.Object[][0]->io.hyperfoil.tools.horreum.api.data.ValidationError[\"error\"]->io.hyperfoil.tools.horreum.api.data.ValidationError$ErrorDetails[\"schemaPath\"])\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl.lambda$initTypes$0(DatasetServiceImpl.java:271)\n\tat org.hibernate.sql.results.internal.RowTransformerTupleTransformerAdapter.transformRow(RowTransformerTupleTransformerAdapter.java:30)\n\tat org.hibernate.sql.results.internal.StandardRowReader.readRow(StandardRowReader.java:99)\n\tat org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:199)\n\tat org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:33)\n\tat org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:361)\n\tat org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:168)\n\tat org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.list(JdbcSelectExecutorStandardImpl.java:93)\n\tat org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:31)\n\tat org.hibernate.query.sql.internal.NativeSelectQueryPlanImpl.performList(NativeSelectQueryPlanImpl.java:97)\n\tat org.hibernate.query.sql.internal.NativeQueryImpl.doList(NativeQueryImpl.java:626)\n\tat org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:367)\n\tat org.hibernate.query.Query.getResultList(Query.java:119)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl.listByTest(DatasetServiceImpl.java:225)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl_Subclass.listByTest$$superforward(Unknown Source)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl_Subclass$$function$$3.apply(Unknown Source)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext$NextAroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:97)\n\tat io.hyperfoil.tools.horreum.server.RolesInterceptor.intercept(RolesInterceptor.java:53)\n\tat io.hyperfoil.tools.horreum.server.RolesInterceptor_Bean.intercept(Unknown Source)\n\tat io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:70)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext$NextAroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:97)\n\tat io.quarkus.security.runtime.interceptor.SecurityHandler.handle(SecurityHandler.java:47)\n\tat io.quarkus.security.runtime.interceptor.PermitAllInterceptor.intercept(PermitAllInterceptor.java:23)\n\tat io.quarkus.security.runtime.interceptor.PermitAllInterceptor_Bean.intercept(Unknown Source)\n\tat io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:70)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)\n\tat io.quarkus.resteasy.reactive.server.runtime.StandardSecurityCheckInterceptor.intercept(StandardSecurityCheckInterceptor.java:44)\n\tat io.quarkus.resteasy.reactive.server.runtime.StandardSecurityCheckInterceptor_PermitAllInterceptor_Bean.intercept(Unknown Source)\n\tat io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)\n\tat io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)\n\tat io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl_Subclass.listByTest(Unknown Source)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl_ClientProxy.listByTest(Unknown Source)\n\tat io.hyperfoil.tools.horreum.api.services.DatasetService$quarkusrestinvoker$listByTest_092fd7d50183e1157af107801a2ac67a9cb881af.invoke(Unknown Source)\n\tat org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)\n\tat io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)\n\tat org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)\n\tat io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)\n\tat org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)\n\tat org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)\n\tat org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)\n\tat org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\nCaused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"schemaPath\" (class io.hyperfoil.tools.horreum.api.data.ValidationError$ErrorDetails), not marked as ignorable (12 known properties: \"evaluationPath\", \"details\", \"path\", \"schemaLocation\", \"message\", \"messageKey\", \"type\", \"valid\", \"code\", \"property\", \"arguments\", \"instanceLocation\"])\n at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: java.lang.Object[][0]->io.hyperfoil.tools.horreum.api.data.ValidationError[\"error\"]->io.hyperfoil.tools.horreum.api.data.ValidationError$ErrorDetails[\"schemaPath\"])\n\tat com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1138)\n\tat com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2224)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1709)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1687)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:320)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)\n\tat com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)\n\tat com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:217)\n\tat com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:27)\n\tat com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)\n\tat com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4801)\n\tat com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2974)\n\tat com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3438)\n\tat io.hyperfoil.tools.horreum.svc.DatasetServiceImpl.lambda$initTypes$0(DatasetServiceImpl.java:269)\n\t... 46 more"
}
@willr3
Copy link
Collaborator Author

willr3 commented Feb 19, 2024

It looks like entries in the db can have up to 7 different keys for the error object

horreum=# select distinct jsonb_object_keys(error) from dataset_validationerrors;
 jsonb_object_keys 
-------------------
 code
 arguments
 path
 schemaPath
 message
 details
 type
(7 rows)

Does Horreum need to strongly type the error or is Map<String,JsonObject> suficient? (like we do for LabelValueMap)?
I haven't tried that in a python client but I suspect that will be what determines our best course of action.

@johnaohara
Copy link
Member

@johnaohara
Copy link
Member

@willr3
Copy link
Collaborator Author

willr3 commented Feb 20, 2024

The entries in the DB have fields that are not in the ErrorDetails but the fields were in previous versions of ErrorDetails.

@johnaohara johnaohara added type/bug Something isn't working branch/master The master branch area/backend priority/medium Medium priority labels Feb 20, 2024
@johnaohara johnaohara added this to the 0.12 milestone Feb 23, 2024
@johnaohara johnaohara added priority/high High priority and removed priority/medium Medium priority labels Feb 23, 2024
@johnaohara johnaohara self-assigned this Feb 23, 2024
johnaohara added a commit to johnaohara/Horreum that referenced this issue Feb 23, 2024
johnaohara added a commit to johnaohara/Horreum that referenced this issue Feb 25, 2024
johnaohara added a commit to johnaohara/Horreum that referenced this issue Feb 25, 2024
johnaohara added a commit that referenced this issue Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend branch/master The master branch priority/high High priority type/bug Something isn't working
Projects
None yet
2 participants