By: Brian Parkin user 17 Aug 2020 at 5:19 p.m. CDT

9 Responses
Brian Parkin gravatar
Hi my company is working on a hackathon to create a new process for authenticating users to our stack. The team I am working on selected to standup Gluu Server to demo its capabilities with SSO and OAuth. We worked on creating an OpenLdap instance with a POSTGRESSQL backend that contains our users and we would like to try and use the cache refresh to sync the users. We were able to save and even test the backend LDAP connection but the cache refresh is not running on a the schedule. **This error appears in the oxtrust logs when saving and updating the LDAP backend: ** ``` 2020-08-17 21:48:16,125 ERROR [ForkJoinPool.commonPool-worker-5] [org.gluu.service.config.ConfigurationFactory] (ConfigurationFactory.java:306) - WELD-001334: Unsatisfied dependencies for type CacheRefreshConfiguration with qualifiers @Default org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001334: Unsatisfied dependencies for type CacheRefreshConfiguration with qualifiers @Default at org.jboss.weld.bean.builtin.InstanceImpl.checkBeanResolved(InstanceImpl.java:241) ~[weld-core-impl-3.1.4.Final.jar:3.1.4.Final] at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:113) ~[weld-core-impl-3.1.4.Final.jar:3.1.4.Final] at org.gluu.service.config.ConfigurationFactory.destroy(ConfigurationFactory.java:314) ~[oxtrust-service-4.2.0.Final.jar:?] at org.gluu.oxtrust.service.config.ConfigurationFactory$Proxy$_$$_WeldSubclass.destroy(Unknown Source) ~[classes/:?] at org.gluu.oxtrust.service.config.ConfigurationFactory.destroryLoadedConfiguration(ConfigurationFactory.java:75) ~[classes/:?] at org.gluu.oxtrust.service.config.ConfigurationFactory$Proxy$_$$_WeldSubclass.destroryLoadedConfiguration(Unknown Source) ~[classes/:?] at org.gluu.service.config.ConfigurationFactory.createFromDb(ConfigurationFactory.java:297) [oxtrust-service-4.2.0.Final.jar:?] at org.gluu.service.config.ConfigurationFactory.reloadConfiguration(ConfigurationFactory.java:223) [oxtrust-service-4.2.0.Final.jar:?] at org.gluu.service.config.ConfigurationFactory.reloadConfigurationTimerEvent(ConfigurationFactory.java:175) [oxtrust-service-4.2.0.Final.jar:?] at org.gluu.oxtrust.service.config.ConfigurationFactory$Proxy$_$$_WeldSubclass.reloadConfigurationTimerEvent$$super(Unknown Source) [classes/:?] at jdk.internal.reflect.GeneratedMethodAccessor482.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?] at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51) [weld-core-impl-3.1.4.Final.jar:3.1.4.Final] at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78) [weld-core-impl-3.1.4.Final.jar:3.1.4.Final] at org.gluu.service.cdi.async.AsynchronousInterceptor$1.get(AsynchronousInterceptor.java:36) [oxcore-service-4.2.0.Final.jar:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) [?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) [?:?] at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:?] at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) [?:?] at java.util.concurrent.ForkJoinPool.scan(Unknown Source) [?:?] at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:?] at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:?] org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:153) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:67) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:52) at org.gluu.oxtrust.service.StatusCheckerTimer.getFacterData(StatusCheckerTimer.java:256) at org.gluu.oxtrust.service.StatusCheckerTimer.processInt(StatusCheckerTimer.java:141) at org.gluu.oxtrust.service.StatusCheckerTimer.process(StatusCheckerTimer.java:114) at org.gluu.oxtrust.service.StatusCheckerTimer$Proxy$_$$_WeldSubclass.process$$super(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor796.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.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51) at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78) at org.gluu.service.cdi.async.AsynchronousInterceptor$1.get(AsynchronousInterceptor.java:36) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ** This exception appears when the cache tries to run and we do not see any of the last run entries updated. ** org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:153) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:67) at org.gluu.util.process.ProcessHelper.executeProgram(ProcessHelper.java:52) at org.gluu.oxtrust.service.StatusCheckerTimer.getFacterData(StatusCheckerTimer.java:256) at org.gluu.oxtrust.service.StatusCheckerTimer.processInt(StatusCheckerTimer.java:141) at org.gluu.oxtrust.service.StatusCheckerTimer.process(StatusCheckerTimer.java:114) at org.gluu.oxtrust.service.StatusCheckerTimer$Proxy$_$$_WeldSubclass.process$$super(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor796.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.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:51) at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:78) at org.gluu.service.cdi.async.AsynchronousInterceptor$1.get(AsynchronousInterceptor.java:36) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ```

By Michael Schwartz staff 18 Aug 2020 at 2:18 p.m. CDT

Michael Schwartz gravatar
Is it enabled? Can you upload screenshots of all your config screens somewhere and reference them by a link?

By Brian Parkin user 18 Aug 2020 at 2:51 p.m. CDT

Brian Parkin gravatar
Hello Michael, Yes the Cache Refresh is enabled (blue check next to the Cache Refresh line on the main page). I am able to test our back LDAP successfully and when I click on "Update and Validate Script" it completes successfully. Here is a link to screenshots of our configuration: https://drive.google.com/drive/folders/1f8JFG0JSUvhrs8exrsRm3qzxj4rprxhV?usp=sharing Please let me know if you have trouble accessing it. Rgds, *Brian Parkin *| SOFTWARE ENGINEER brian.parkin@parchment.com mailto:brian.parkin@parchment.com> 7001 N Scottsdale Rd Suite 1050, Scottsdale, AZ 85253 *Parchment *|**Turn Credentials Into Opportunities www.parchment.com http://www.parchment.com/>

By Mohib Zico staff 21 Aug 2020 at 11:28 a.m. CDT

Mohib Zico gravatar
Brian, Can you please check one thing? Change 'Source Backend LDAP Servers' tab's "Name" value. From "Parchment p7 LDAP" to "source". Make oxTrust logging to DEBUG and re-initiate Cache. See what you are getting.

By Brian Parkin user 21 Aug 2020 at 12:28 p.m. CDT

Brian Parkin gravatar
Hi Gluu Support, I have done as you asked.  I changed the "Source Backend LDAP Server's" Name value to "source" I clicked update and validate script, received the expected "Can't load custom script, using default message" (we don't have a custom script). I updated the log level of oxtrust to DEBUG through the admin. I see the same exceptions from my original post.   I am seeing these debug messages in the cache-refresh log: 2020-08-21 17:19:50,622 ERROR [qtp1989335500-13] [org.gluu.oxtrust.action.ConfigureCacheRefreshAction] (ConfigureCacheRefreshAction.java:424) - Can't load Cache Refresh scripts. Using default script 2020-08-21 17:20:07,953 DEBUG [ForkJoinPool.commonPool-worker-9] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:251) - This server isn't master Cache Refresh server 2020-08-21 17:20:07,953 DEBUG [ForkJoinPool.commonPool-worker-9] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:195) - Starting conditions aren't reached 2020-08-21 17:20:07,953 DEBUG [ForkJoinPool.commonPool-worker-9] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:185) - Allowing to run new process exclusively Those messages maybe point to a missing configuration? I have uploaded this log to the google drive location: https://drive.google.com/drive/folders/1f8JFG0JSUvhrs8exrsRm3qzxj4rprxhV?usp=sharing Thanks, *Brian Parkin *| SOFTWARE ENGINEER brian.parkin@parchment.com mailto:brian.parkin@parchment.com> 7001 N Scottsdale Rd Suite 1050, Scottsdale, AZ 85253 *Parchment *|**Turn Credentials Into Opportunities www.parchment.com http://www.parchment.com/>

By Mohib Zico staff 21 Aug 2020 at 12:34 p.m. CDT

Mohib Zico gravatar
>> This server isn't master Cache Refresh server This is your error. "Server IP Address" should be the IP address of the VM where your Gluu Server is installed.

By Branden Cash user 21 Aug 2020 at 12:50 p.m. CDT

Branden Cash gravatar
Might be worth mentioning we are running in docker on a VM. We used the pygluu-compose.pyz to bring up the instance. The host VM machine ip address is what we've put in as the "Server IP Address". Is there are particular service in the gluu server it is looking for? It looks like the only ports that got exposed are ones going to the nginx server which then routes back to some of the various services. But it is not clear what service it is trying to hit.

By Mohib Zico staff 21 Aug 2020 at 12:57 p.m. CDT

Mohib Zico gravatar
Ok, that is totally different scenario. I think you should have selected 'Docker' when created ticket. Whatever we have stated so far is for Gluu Server CE ( Community Edition ) version. Docker / k8s has separate service called [CR-Rotate](https://www.gluu.org/docs/gluu-server/4.2/installation-guide/install-docker/#choose-services) which sync ip address automatically when running Cache Refresh. You need to install that service at the time of Docker/k8s installation.

By Branden Cash user 21 Aug 2020 at 1:21 p.m. CDT

Branden Cash gravatar
Gotcha! That makes sense. So i've got `SVC_CR_ROTATE` enabled. It looks like it updated the "Server IP Address" to `oxtrust`, which I had tried at one point while trying various things to get this working. However even with that it isn't identifying as the master cache refresh server. ``` 2020-08-21 18:13:07,946 DEBUG [ForkJoinPool.commonPool-worker-15] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:251) - This server isn't master Cache Refresh server 2020-08-21 18:13:07,946 DEBUG [ForkJoinPool.commonPool-worker-15] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:195) - Starting conditions aren't reached 2020-08-21 18:13:07,946 DEBUG [ForkJoinPool.commonPool-worker-15] [gluu.oxtrust.ldap.cache.service.CacheRefreshTimer] (CacheRefreshTimer.java:185) - Allowing to run new process exclusively ```

By Branden Cash user 21 Aug 2020 at 1:29 p.m. CDT

Branden Cash gravatar
Or maybe it didn't. Next time I went to look at it the server ip was set back to the host vm ip. I just manually set it to the oxtrust container ip address and i think it actually ran this time. But I think this gives me enough of an understanding of how it works to be useful here. Thank you!