DependencyTrack / DependencyTrack/dependency-track
Error on Login on UI, org.postgresql.util.PSQLException: ERROR: syntax error at or near "AS"
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
The defect may already be reported! Please search for the defect before creating one.
### Current Behavior:
Throws Exception upon login into UI,
I am not sure on exact steps to reproduce, i run 4-SNAPSHO (latest) on AWS ECS, it was running well, started throwing the exception as below,
Restarted Docker on AWS Ecs and started working well.
this error result in HTTP 500 code on login request on the browser,
This exception more coming from the underline Alpine project and not from the Dependency Track app.
```
2020-12-04 05:09:50,069 [] WARN [org.eclipse.jetty.server.HttpChannelState] unhandled due to prior sendError
javax.servlet.ServletException: javax.jdo.JDODataStoreException: Iteration request failed : SELECT 'alpine.model.Team''alpine.model.Team' AS "DN_TYPE","A1"."ID","A1"."NAME" AS "NUCORDER0" AS "NUCORDER0"null,"A1"."UUID","A0"."MANAGEDUSER_ID" FROM "MANAGEDUSERS_TEAMS" "A0""A0"."MANAGEDUSER_ID" FROM "MANAGEDUSERS_TEAMS" "A0" INNER JOIN "TEAM" "A1" ON "A0"."TEAM_ID" = "A1"."ID" WHERE INNER JOIN "TEAM" "A1" ON "A0"."TEAM_ID" = "A1"."ID" WHERE EXISTS (SELECT 'alpine.model.ManagedUser' AS "DN_TYPE","A0_SUB"."ID") ORDER BY "NUCORDER0"EXISTS (SELECT 'alpine.model.ManagedUser' AS "DN_TYPE","A0_SUB"."ID" AS "DN_APPID" FROM "MANAGEDUSER" "A0_SUB" WHERE "A0_SUB"."USERNAME" = ? AND "A0"."MANAGEDUSER_ID" = "A0_SUB"."ID") ORDER BY "NUCORDER0"
NestedThrowables:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "AS"
Position: 97
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:410)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1452)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:791)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
at alpine.filters.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:224)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at alpine.filters.ClickjackingFilter.doFilter(ClickjackingFilter.java:92)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at alpine.filters.WhitelistUrlFilter.doFilter(WhitelistUrlFilter.java:149)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1612)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1582)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.jdo.JDODataStoreException: Iteration request failed : SELECT 'alpine.model.Team''alpine.model.Team' AS "DN_TYPE","A1"."ID","A1"."NAME" AS "NUCORDER0" AS "NUCORDER0"null,"A1"."UUID","A0"."MANAGEDUSER_ID" FROM "MANAGEDUSERS_TEAMS" "A0""A0"."MANAGEDUSER_ID" FROM "MANAGEDUSERS_TEAMS" "A0" INNER JOIN "TEAM" "A1" ON "A0"."TEAM_ID" = "A1"."ID" WHERE INNER JOIN "TEAM" "A1" ON "A0"."TEAM_ID" = "A1"."ID" WHERE EXISTS (SELECT 'alpine.model.ManagedUser' AS "DN_TYPE","A0_SUB"."ID") ORDER BY "NUCORDER0"EXISTS (SELECT 'alpine.model.ManagedUser' AS "DN_TYPE","A0_SUB"."ID" AS "DN_APPID" FROM "MANAGEDUSER" "A0_SUB" WHERE "A0_SUB"."USERNAME" = ? AND "A0"."MANAGEDUSER_ID" = "A0_SUB"."ID") ORDER BY "NUCORDER0"
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:542)
at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:456)
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:276)
at alpine.persistence.AlpineQueryManager.getManagedUser(AlpineQueryManager.java:472)
at alpine.auth.ManagedUserAuthenticationService.authenticate(ManagedUserAuthenticationService.java:72)
at alpine.auth.Authenticator.authenticate(Authenticator.java:65)
at org.dependencytrack.resources.v1.UserResource.validateCredentials(UserResource.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
... 47 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "AS"
Position: 97
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeQuery(ParamLoggingPreparedStatement.java:375)
at org.datanucleus.store.rdbms.SQLController.executeStatementQuery(SQLController.java:553)
at org.datanucleus.store.rdbms.query.JDOQLQuery.performExecute(JDOQLQuery.java:703)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1975)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:1864)
at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:433)
... 74 common frames omitted
[
```
### Steps to Reproduce:
### Expected Behavior:
### Environment:
- Dependency-Track Version: 4-SNAPSHOT
- Distribution: Docker
- BOM Format & Version: 4-SNAPSHOT
- Database Server: PostgreSQL
- Browser: FF on Linux,
### Additional Details:
(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Contributor guide
Assessment
This issue has not been assessed yet.