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

SQL exception during Security API TCK run with glassfish 6 #280

Closed
gurunrao opened this issue Jul 21, 2020 · 10 comments
Closed

SQL exception during Security API TCK run with glassfish 6 #280

gurunrao opened this issue Jul 21, 2020 · 10 comments

Comments

@gurunrao
Copy link

gurunrao commented Jul 21, 2020

Following SQL exception during Security API TCK run with glassfish 6, post that there are 5 failures with Security API TCK tests.

[2020-07-21T09:38:50.636+0530] [glassfish 6.0] [INFO] [] [] [tid: _ThreadID=37 _ThreadName=Thread-8] [timeMillis: 1595304530636] [levelValue: 800] [[
Exception met...Column 'INVALID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'INVALID' is not a column in the target table.]]

[2020-07-21T09:38:50.638+0530] [glassfish 6.0] [SEVERE] [] [] [tid: _ThreadID=37 ThreadName=Thread-9] [timeMillis: 1595304530638] [levelValue: 1000] [[
org.glassfish.soteria.identitystores.IdentityStoreConfigurationException: Column 'INVALID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'INVALID' is not a column in the target table.
at org.glassfish.soteria.identitystores.DatabaseIdentityStore.executeQuery(DatabaseIdentityStore.java:147)
at org.glassfish.soteria.identitystores.DatabaseIdentityStore.validate(DatabaseIdentityStore.java:95)
at org.glassfish.soteria.identitystores.DatabaseIdentityStore.validate(DatabaseIdentityStore.java:85)
at org.glassfish.soteria.identitystores.DatabaseIdentityStore$Proxy$
$$WeldClientProxy.validate(Unknown Source)
at org.glassfish.soteria.cdi.DefaultIdentityStoreHandler.validate(DefaultIdentityStoreHandler.java:73)
at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106)
at jakarta.security.enterprise.identitystore.IdentityStoreHandler$489902059$Proxy$
$$WeldClientProxy.validate(Unknown Source)
at com.sun.ts.tests.securityapi.idstore.common.DefaultHamForIDStore.validateRequest(DefaultHamForIDStore.java:67)
at org.glassfish.soteria.mechanisms.jaspic.HttpBridgeServerAuthModule.validateRequest(HttpBridgeServerAuthModule.java:89)
at org.glassfish.soteria.mechanisms.jaspic.DefaultServerAuthContext.validateRequest(DefaultServerAuthContext.java:52)
at com.sun.web.security.RealmAdapter.validate(RealmAdapter.java:1651)
at com.sun.web.security.RealmAdapter.invokeAuthenticateDelegate(RealmAdapter.java:1509)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:536)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:579)
at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:555)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:114)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:199)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:440)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:144)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:174)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:153)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:248)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:181)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:121)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:99)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:34)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLSyntaxErrorException: Column 'INVALID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'INVALID' is not a column in the target table.
at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.ClientConnection.prepareStatement(Unknown Source)
at com.sun.gjc.spi.base.ConnectionHolder.prepareStatement(ConnectionHolder.java:562)
at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:231)
at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareCachedStatement(ConnectionWrapper40.java:28)
at com.sun.gjc.spi.ManagedConnectionImpl.prepareCachedStatement(ManagedConnectionImpl.java:968)
at com.sun.gjc.spi.jdbc40.ConnectionWrapper40.prepareStatement(ConnectionWrapper40.java:149)
at org.glassfish.soteria.identitystores.DatabaseIdentityStore.executeQuery(DatabaseIdentityStore.java:138)
... 41 more
Caused by: ERROR 42X04: Column 'INVALID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'INVALID' is not a column in the target table.
at org.apache.derby.client.am.ClientStatement.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput
(Unknown Source)
at org.apache.derby.client.am.ClientStatement.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.am.ClientPreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.ClientPreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
at org.apache.derby.client.am.ClientPreparedStatement.prepare(Unknown Source)
at org.apache.derby.client.am.ClientConnection.prepareStatementX(Unknown Source)
... 48 more
]]

@gurunrao gurunrao changed the title SQL exception seen during Security API TCK run with glassfish 6 SQL exception during Security API TCK run with glassfish 6 Jul 21, 2020
@arjantijms
Copy link
Contributor

That doesn't look good. I've to debug that to see what's really going on.

@gurunrao
Copy link
Author

Additional details on issues during securityapi TCK run.
We also see ldap exception as below, ldap config can be found at https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/install/securityapi/bin/ldap.ldif


org.glassfish.soteria.identitystores.IdentityStoreConfigurationException: Bad bindDn or bindPassword for: uid=ldap,ou=apps,dc=securityapi,dc=net
at org.glassfish.soteria.identitystores.LdapIdentityStore.createSearchLdapContext(LdapIdentityStore.java:322)
at org.glassfish.soteria.identitystores.LdapIdentityStore.validate(LdapIdentityStore.java:81)
at org.glassfish.soteria.identitystores.LdapIdentityStore.validate(LdapIdentityStore.java:74)
at org.glassfish.soteria.identitystores.LdapIdentityStore$Proxy$_$$_WeldClientProxy.validate(Unknown Source)
at org.glassfish.soteria.cdi.DefaultIdentityStoreHandler.validate(DefaultIdentityStoreHandler.java:73)
at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)


@gurunrao
Copy link
Author

gurunrao commented Aug 8, 2020

@arjantijms @scottmarlow @smillidge

We see multiple 'unknown handler key' exceptions with securityapi test failure.

We do pass username and password from client - https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/securityapi/securitycontext/authenticate/Client.java#L90

Also at authenticate servlet, as seen here - https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/securityapi/securitycontext/authenticate/Servlet.java#L64

LDAP configuration has same user name password - https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/install/securityapi/bin/ldap.ldif#L20

full stack-trace is as follows:


[2020-08-06T14:54:51.232+0530] [glassfish 6.0] [WARNING] [] [jakarta.enterprise.web] [tid: _ThreadID=36 _ThreadName=http-listener-1(5)] [timeMillis: 1596705891232] [levelValue: 900] [[
StandardWrapperValve[com.sun.ts.tests.securityapi.securitycontext.authenticate.Servlet]: Servlet.service() for servlet com.sun.ts.tests.securityapi.securitycontext.authenticate.Servlet threw exception
java.lang.IllegalArgumentException: unknown handler key
at jakarta.security.jacc.PolicyContext.getContext(PolicyContext.java:223)
at org.glassfish.soteria.authorization.JACC$2.run(JACC.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at org.glassfish.soteria.authorization.JACC.getFromContext(JACC.java:151)
at org.glassfish.soteria.authorization.JACC.getSubject(JACC.java:49)
at org.glassfish.soteria.authorization.spi.impl.ReflectionAndJaccCallerDetailsResolver.getCallerPrincipal(ReflectionAndJaccCallerDetailsResolver.java:33)
at org.glassfish.soteria.SecurityContextImpl.getCallerPrincipal(SecurityContextImpl.java:55)
at com.sun.ts.tests.securityapi.securitycontext.authenticate.Servlet.doGet(Servlet.java:88)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:500)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:275)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:308)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:119)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:611)
at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:555)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:114)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:199)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:440)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:144)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:174)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:153)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:248)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:181)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:121)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:99)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:34)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
at java.lang.Thread.run(Thread.java:748)
]]


Do you see any configuration gap with our tests which can resolve these failures?

@smillidge
Copy link
Contributor

In glassfish the key names were changed from javax to jakarta see https://github.com/eclipse-ee4j/glassfish/blob/master/appserver/security/core-ee/src/main/java/com/sun/enterprise/security/authorize/PolicyContextHandlerImpl.java#L31 maybe Soteria or the TCK is using javax key names?

@gurunrao
Copy link
Author

@arjantijms - Please release soteria fixes made by @smillidge, so that we can integrate it with glassfish and get a pass with security-api tck.

@gurunrao
Copy link
Author

@arjantijms @smillidge @scottmarlow @edbratt - fix made by @smillidge are important for passing of securityapi TCK(5 failures).
Please release soteria with fixes.

@arjantijms
Copy link
Contributor

@gurunrao Thank you for your patience!

I staged Soteria M3 and did a PR for integration in GlassFish here: eclipse-ee4j/glassfish#23189

@gurunrao
Copy link
Author

@arjantijms - thanks arjan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants