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

relation "project_access_teams" does not exist at character 13 #2374

Closed
2 tasks done
asoldo11 opened this issue Jan 12, 2023 · 6 comments
Closed
2 tasks done

relation "project_access_teams" does not exist at character 13 #2374

asoldo11 opened this issue Jan 12, 2023 · 6 comments
Labels
defect Something isn't working
Milestone

Comments

@asoldo11
Copy link

asoldo11 commented Jan 12, 2023

Current Behavior

I apologize in advance if this is not the issue with Dependency Track itself, but is actually related to Chart. If this is strictly regarded to Chart, issue can be discarded

We deployed Dependency-Track v4.7.0 via Helm chart on private Kubernetes cluster (chart repo https://github.com/evryfs/helm-charts/tree/master/charts/dependency-track). We have overridden parameters regarding dependency track application version (both frontend and apiserver), all LDAP connection parameters and Ingress definition, everything else is default.

After everything was successfully deployed and started (Kubernetes said that liveness and readiness are OK, we did not investigate the logs of particular pod), we started configuring application. We added some teams successfully, added some AD users, uploaded some BOM for projects and everything was running smooth.

After that we tried to delete some teams but received error, with stacktrace from apiserver below:

Stacktrace from apiserver

2023-01-12 15:16:37,707 ERROR [GlobalExceptionHandler] Uncaught internal server error
javax.jdo.JDODataStoreException: Error executing SQL query "DELETE FROM PROJECT_ACCESS_TEAMS WHERE "PROJECT_ACCESS_TEAMS"."TEAM_ID" = ?".
at org.datanucleus.api.jdo.JDOAdapter.getJDOExceptionForNucleusException(JDOAdapter.java:605)
at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:456)
at org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:318)
at org.dependencytrack.persistence.QueryManager.recursivelyDeleteTeam(QueryManager.java:1278)
at org.dependencytrack.resources.v1.TeamResource.deleteTeam(TeamResource.java:184)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
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:134)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
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:684)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
at alpine.server.filters.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:225)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at alpine.server.filters.ClickjackingFilter.doFilter(ClickjackingFilter.java:93)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at alpine.server.filters.WhitelistUrlFilter.doFilter(WhitelistUrlFilter.java:166)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1383)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1305)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at org.eclipse.jetty.server.Server.handle(Server.java:563)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:139)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:933)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1077)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "project_access_teams" does not exist
Position: 13
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:152)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.datanucleus.store.rdbms.SQLController.executeStatementUpdate(SQLController.java:430)
at org.datanucleus.store.rdbms.query.SQLQuery.performExecute(SQLQuery.java:627)
at org.datanucleus.store.query.Query.executeQuery(Query.java:2004)
at org.datanucleus.store.rdbms.query.SQLQuery.executeWithArray(SQLQuery.java:824)
at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:433)
... 72 common frames omitted

After this error occurred, I tried to create another deployment of Dependency Track on my local machine via Docker Compose. I did not change anything in configuration (so no LDAP, no different DB, etc., everything is default), just executed few commands that are defined on the web. On this local deployment I can create and delete teams without any error.

Steps to Reproduce

  1. Login with user that has ACCESS_MANAGEMENT permissions (we used initial admin user)
  2. Navigate to Settings -> Access Management ->Teams
  3. Select some team and try to delete it

Expected Behavior

Should be able to delete any team with user that has appropriate permissions.

Dependency-Track Version

4.7.0

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

11.13

Browser

Google Chrome

Checklist

@asoldo11
Copy link
Author

@syalioune thank you for the fast response. looking at the code where this delete is performed, I see that relation is already enclosed in double quotes:

DELETE FROM PROJECT_ACCESS_TEAMS WHERE \"PROJECT_ACCESS_TEAMS\".\"TEAM_ID\" = ?

all in all, error is strange as it seems that everything is as it should be. let me know if I can provide any more details that can help with tracking down this issue

@asoldo11
Copy link
Author

@syalioune thank you for the fast response. looking at the code where this delete is performed, I see that relation is already enclosed in double quotes:

DELETE FROM PROJECT_ACCESS_TEAMS WHERE \"PROJECT_ACCESS_TEAMS\".\"TEAM_ID\" = ?

all in all, error is strange as it seems that everything is as it should be. let me know if I can provide any more details that can help with tracking down this issue

ahh I see now, it is not WHERE clause that is problematic, but FROM.

for now, we executed delete SQLs manually in DB, looking forward for the fix

syalioune added a commit to syalioune/dependency-track that referenced this issue Jan 15, 2023
@nscuro nscuro removed the in triage label Jan 16, 2023
@nscuro nscuro added this to the 4.8 milestone Jan 16, 2023
@nscuro
Copy link
Member

nscuro commented Jan 16, 2023

Fixed in #2381, thanks @syalioune! 🙌

@nscuro nscuro closed this as completed Jan 16, 2023
@ShuP1
Copy link

ShuP1 commented Jan 17, 2023

Is there a planned 4.7.1 or is this fix waiting 4.8 as milestone states ?

@nscuro
Copy link
Member

nscuro commented Jan 18, 2023

@ShuP1 see #2319 (comment)

@msymons msymons modified the milestones: 4.8, 4.7.1 Jan 31, 2023
nscuro pushed a commit to nscuro/dependency-track that referenced this issue Jan 31, 2023
@nscuro nscuro mentioned this issue Jan 31, 2023
5 tasks
stephan-wolf-ais pushed a commit to AISAutomation/dependency-track that referenced this issue Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
defect Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants