cryostatio / cryostat

Secure JDK Flight Recorder management for containerized JVMs
https://cryostat.io
Other
11 stars 9 forks source link

[Bug] Custom Target creation failures no longer include relevant error information #487

Closed andrewazores closed 4 months ago

andrewazores commented 4 months ago

Current Behavior

If the custom target creation fails, for example due to duplicate connection URL, no error status is shown.

Expected Behavior

No response

Steps To Reproduce

Run smoketest, try to create custom target cryostat3:9091

Environment

No response

Anything else?

cryostat_1  | WARN: Invalid target definition
cryostat_1  | org.hibernate.exception.ConstraintViolationException: could not execute statement [ERROR: duplicate key value violates unique constraint "target_connecturl_key"
cryostat_1  |   Detail: Key (connecturl)=(\xaced00057372000c6a6176612e6e65742e555249ac01782e439e49ab0300014c0006737472696e677400124c6a6176612f6c616e672f537472696e673b7870740033736572766963653a6a6d783a726d693a2f2f2f6a6e64692f726d693a2f2f6372796f73746174333a393039312f6a6d78726d6978) already exists.] [insert into Target (alias,annotations,connectUrl,discoveryNode,jvmId,labels,id) values (?,?,?,?,?,?,?)]
cryostat_1  |   at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:95)
cryostat_1  |   at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:56)
cryostat_1  |   at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:108)
cryostat_1  |   at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:278)
cryostat_1  |   at org.hibernate.engine.jdbc.mutation.internal.AbstractMutationExecutor.performNonBatchedMutation(AbstractMutationExecutor.java:107)
cryostat_1  |   at org.hibernate.engine.jdbc.mutation.internal.MutationExecutorSingleNonBatched.performNonBatchedOperations(MutationExecutorSingleNonBatched.java:40)
cryostat_1  |   at org.hibernate.engine.jdbc.mutation.internal.AbstractMutationExecutor.execute(AbstractMutationExecutor.java:52)
cryostat_1  |   at org.hibernate.persister.entity.mutation.InsertCoordinator.doStaticInserts(InsertCoordinator.java:171)
cryostat_1  |   at org.hibernate.persister.entity.mutation.InsertCoordinator.coordinateInsert(InsertCoordinator.java:112)
cryostat_1  |   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2790)
cryostat_1  |   at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:102)
cryostat_1  |   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:635)
cryostat_1  |   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:502)
cryostat_1  |   at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:364)
cryostat_1  |   at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:55)
cryostat_1  |   at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
cryostat_1  |   at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1375)
cryostat_1  |   at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$0(ConcreteSqmSelectQueryPlan.java:108)
cryostat_1  |   at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:303)
cryostat_1  |   at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:244)
cryostat_1  |   at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(QuerySqmImpl.java:518)
cryostat_1  |   at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:367)
cryostat_1  |   at org.hibernate.query.Query.getResultList(Query.java:119)
cryostat_1  |   at io.quarkus.hibernate.orm.panache.common.runtime.CommonPanacheQueryImpl.singleResultOptional(CommonPanacheQueryImpl.java:317)
cryostat_1  |   at io.quarkus.hibernate.orm.panache.runtime.PanacheQueryImpl.singleResultOptional(PanacheQueryImpl.java:174)
cryostat_1  |   at io.cryostat.discovery.DiscoveryNode.getUniverse(DiscoveryNode.java:110)
cryostat_1  |   at io.cryostat.discovery.DiscoveryNode.getRealm(DiscoveryNode.java:116)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery.doV2Create(CustomDiscovery.java:199)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery.create(CustomDiscovery.java:147)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_Subclass.create$$superforward(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_Subclass$$function$$2.apply(Unknown Source)
cryostat_1  |   at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)
cryostat_1  |   at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:136)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:107)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.doIntercept(TransactionalInterceptorRequired.java:38)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:61)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:32)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired_Bean.intercept(Unknown Source)
cryostat_1  |   at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
cryostat_1  |   at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
cryostat_1  |   at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_Subclass.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_ClientProxy.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery$quarkusrestinvoker$create_a2d4a2d205177c85e611b9c0327c35c9085f99d5.invoke(Unknown Source)
cryostat_1  |   at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
cryostat_1  |   at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
cryostat_1  |   at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
cryostat_1  |   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
cryostat_1  |   at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
cryostat_1  |   at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
cryostat_1  |   at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
cryostat_1  |   at java.base/java.lang.Thread.run(Thread.java:840)
cryostat_1  | Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "target_connecturl_key"
cryostat_1  |   Detail: Key (connecturl)=(\xaced00057372000c6a6176612e6e65742e555249ac01782e439e49ab0300014c0006737472696e677400124c6a6176612f6c616e672f537472696e673b7870740033736572766963653a6a6d783a726d693a2f2f2f6a6e64692f726d693a2f2f6372796f73746174333a393039312f6a6d78726d6978) already exists.
cryostat_1  |   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
cryostat_1  |   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
cryostat_1  |   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
cryostat_1  |   at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
cryostat_1  |   at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
cryostat_1  |   at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
cryostat_1  |   at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:152)
cryostat_1  |   at io.agroal.pool.wrapper.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:88)
cryostat_1  |   at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:275)
cryostat_1  |   ... 51 more
cryostat_1  | 
cryostat_1  | 2024-05-31 16:48:37,861 DEBUG [io.ver.ext.web.RoutingContext] (executor-thread-7) RoutingContext failure (500): java.lang.RuntimeException: ARJUNA016108: Wrong transaction on thread
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.endTransaction(TransactionalInterceptorBase.java:400)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:171)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:107)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.doIntercept(TransactionalInterceptorRequired.java:38)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:61)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:32)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired_Bean.intercept(Unknown Source)
cryostat_1  |   at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
cryostat_1  |   at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
cryostat_1  |   at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_Subclass.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_ClientProxy.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery$quarkusrestinvoker$create_a2d4a2d205177c85e611b9c0327c35c9085f99d5.invoke(Unknown Source)
cryostat_1  |   at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
cryostat_1  |   at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
cryostat_1  |   at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
cryostat_1  |   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
cryostat_1  |   at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
cryostat_1  |   at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
cryostat_1  |   at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
cryostat_1  |   at java.base/java.lang.Thread.run(Thread.java:840)
cryostat_1  | 
cryostat_1  | May 31, 2024 4:48:37 PM io.quarkus.vertx.http.runtime.QuarkusErrorHandler handle
cryostat_1  | ERROR: HTTP Request to /api/v2/targets?storeCredentials=true&dryrun=false failed, error id: 0bb38767-2839-4cc9-b7e7-a951c18f30ea-1
cryostat_1  | java.lang.RuntimeException: ARJUNA016108: Wrong transaction on thread
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.endTransaction(TransactionalInterceptorBase.java:400)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:171)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:107)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.doIntercept(TransactionalInterceptorRequired.java:38)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:61)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:32)
cryostat_1  |   at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired_Bean.intercept(Unknown Source)
cryostat_1  |   at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
cryostat_1  |   at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
cryostat_1  |   at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_Subclass.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery_ClientProxy.create(Unknown Source)
cryostat_1  |   at io.cryostat.discovery.CustomDiscovery$quarkusrestinvoker$create_a2d4a2d205177c85e611b9c0327c35c9085f99d5.invoke(Unknown Source)
cryostat_1  |   at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
cryostat_1  |   at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
cryostat_1  |   at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
cryostat_1  |   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
cryostat_1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
cryostat_1  |   at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
cryostat_1  |   at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
cryostat_1  |   at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
cryostat_1  |   at java.base/java.lang.Thread.run(Thread.java:840)