cas 6.1 RC4 and cas-management 6.1 RC4 coexistence with git service registry

55 views
Skip to first unread message

Nathan Lewan

unread,
Jan 31, 2020, 11:00:55 AM1/31/20
to CAS Community
hello!

these forums have been great for me, and I'd like to throw out a question to see if anyone has any insights.

here's what's working:

cas and cas-management 6.1 RC4 running on tomcat9 on the same server, are both able to see the git service registry I have set up.

my fun begins when cas-management commits it's changes. It commits them in the local git cache, which the cas service is also pointing at and picks up, BUT it never pushes the commit to the git repo.

I get java nullopintexception error. actually I get that error right when I select to look at the services in the cas-management web interface:

---------------------------------------
2020-01-31 10:44:07,275 ERROR [org.apereo.cas.mgmt.controller.CommitController] - <null>
java.lang.NullPointerException: null
    at org.apereo.cas.mgmt.controller.CommitController.isPublishedBehind(CommitController.java:201) ~[cas-mgmt-support-version-control-6.1.0-RC4.jar:6.1.0-RC4]
    at org.apereo.cas.mgmt.controller.CommitController.gitStatus(CommitController.java:225) [cas-mgmt-support-version-control-6.1.0-RC4.jar:6.1.0-RC4]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:889) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:794) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [servlet-api.jar:?]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) [spring-webmvc-5.2.0.M2.jar:5.2.0.M2]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:66) [inspektr-common-1.8.5.GA.jar:1.8.5.GA]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130) [spring-boot-2.2.0.M3.jar:2.2.0.M3]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66) [spring-boot-2.2.0.M3.jar:2.2.0.M3]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105) [spring-boot-2.2.0.M3.jar:2.2.0.M3]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123) [spring-boot-2.2.0.M3.jar:2.2.0.M3]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.2.0.M2.jar:5.2.0.M2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.11.2.jar:2.11.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.30]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.30]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [catalina.jar:9.0.30]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.30]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.30]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.30]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.30]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [catalina.jar:9.0.30]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.30]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.30]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-coyote.jar:9.0.30]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.30]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-coyote.jar:9.0.30]
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:1998) [tomcat-coyote.jar:9.0.30]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.30]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.30]
    at java.lang.Thread.run(Thread.java:834) [?:?]




I have a rather fun setup, here's what I think is pertinent:

the git repo in question is set up in a folder on the tomcat server. Call it: git-repo-folder.
the linux user environment this all runs in is aware of the git repo, as well as the ssh key wich allows for unprompted git processes to be run. This was achieved by cloning git-repo-folder via ssh, generating a pub/private key, importing the key into the git server, importing the key into my known_hosts file, then editing the ~/.ssh/config file to have that key used whenever this particular git server is accessed.


so CAS interfaces with all this via these cas.properties:
# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=g...@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.cloneDirectory=${git-repo-folder-location}
cas.serviceRegistry.git.pushChanges=true
cas.serviceRegistry.git.timeout=PT10S
cas.serviceRegistry.git.privateKeyPath=${me.base.dir}/cas-settings/keys/coderepo_id_rsa


and CAS-MANAGEMENT interfaces with all this via these management.properties:
mgmt.versionControl.servicesRepo=${git-repo-folder-location}
mgmt.versionControl=true

# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=g...@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.pushChanges=true


now in the management.properties, if I try and put the cas.serviceRegistry.git.privateKeyPath entry in there, it blows up and says that's not a proper key property and won't even start

it appears as thought the commitController is not happy with my settings. I had a HECK of a time finding the mgmt.versionControl.servicesRepo key. I found it on another site, but haven't actually seen it referenced on any of apereo's docs. they reference it as mgmt.servicesRepo, which always blew up as an unknown key.

that leads me to think, there's another key I need, that I just don't know about... maybe?

any insight would be wonderful! thanks!

Travis Schmidt

unread,
Jan 31, 2020, 1:12:18 PM1/31/20
to CAS Community
I think the key that you are missing is this in the management properties

cas.serviceRegistry.git.cloneDirectory=${git-repo-folder-location}

You cas.serviceRegistry properties from cas.properties to mgmt.properties should be identical.  Also running the Git services repo with management and server in the same JVM, might be an issue.

Try turning version control off in management and make your serviceRegistry properties in both to rule out running in same JVM is a problem.



--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/20003e1c-e2fb-4d44-9982-52a540e4db4a%40apereo.org.

Nathan Lewan

unread,
Jan 31, 2020, 2:33:52 PM1/31/20
to CAS Community
first off, thanks for responding so quickly!

I added this to management.properties first:
cas.serviceRegistry.git.cloneDirectory=${git-repo-folder-location}
that lead to the same behavior

I then set this in management.properties
mgmt.versionControl=false
that lead to the same behavior

I then added in management.properties
cas.serviceRegistry.git.privateKeyPath=${hcc.base.dir}/cas-settings/keys/coderepo_id_rsa
this leads to this error:

***************************
APPLICATION FAILED TO START
***************************

Description:

Binding to target [Bindable@60c98ce4 type = org.apereo.cas.configuration.CasConfigurationProperties, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(ignoreInvalidFields=false, ignoreUnknownFields=false, prefix=cas, value=cas)]] failed:

    Property: cas.serviceregistry.git.privatekeypath
    Value: ${me.base.dir}/cas-settings/keys/coderepo_id_rsa
    Origin: "cas.serviceRegistry.git.privateKeyPath" from property source "bootstrapProperties"
    Reason: The elements [cas.serviceregistry.git.privatekeypath] were left unbound.

Action:

Update your application's configuration



So everything is working great, like when I delete a service record in CAS-MANAGEMENT, it get's deleted in the cloned ${git-repo-folder-location}, it gets picked up by the cas app itself, it even successfully commits it to the cloned  ${git-repo-folder-location}, but neither cas, or cas-management seem to want to actually 'push' it to the git repo.


on a whim, I decided to take a stab at adding this key that I made up to management.properties:
mgmt.versionControl.pushChanges=true
that, predictably lead to this:

***************************
APPLICATION FAILED TO START
***************************

Description:

Binding to target [Bindable@13be93b8 type = org.apereo.cas.configuration.CasManagementConfigurationProperties, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(ignoreInvalidFields=false, ignoreUnknownFields=false, prefix=mgmt, value=mgmt)]] failed:

    Property: mgmt.versioncontrol.pushchanges
    Value: true
    Origin: "mgmt.versionControl.pushChanges" from property source "bootstrapProperties"
    Reason: The elements [mgmt.versioncontrol.pushchanges] were left unbound.

Action:

Update your application's configuration


I guess I should try putting it on another server to rule that out, it's just so close to functional, I feel there's just something silly i'm missing.

thanks again!
# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=git@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.cloneDirectory=${git-repo-folder-location}
cas.serviceRegistry.git.pushChanges=true
cas.serviceRegistry.git.timeout=PT10S
cas.serviceRegistry.git.privateKeyPath=${me.base.dir}/cas-settings/keys/coderepo_id_rsa


and CAS-MANAGEMENT interfaces with all this via these management.properties:
mgmt.versionControl.servicesRepo=${git-repo-folder-location}
mgmt.versionControl=true

# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=git@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.pushChanges=true


now in the management.properties, if I try and put the cas.serviceRegistry.git.privateKeyPath entry in there, it blows up and says that's not a proper key property and won't even start

it appears as thought the commitController is not happy with my settings. I had a HECK of a time finding the mgmt.versionControl.servicesRepo key. I found it on another site, but haven't actually seen it referenced on any of apereo's docs. they reference it as mgmt.servicesRepo, which always blew up as an unknown key.

that leads me to think, there's another key I need, that I just don't know about... maybe?

any insight would be wonderful! thanks!

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-...@apereo.org.

Travis Schmidt

unread,
Jan 31, 2020, 4:32:31 PM1/31/20
to CAS Community
Try adding the module cas-server-support-git-service-registry to your overlay for cas-mgmt if it is not already there.

# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=g...@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.cloneDirectory=${git-repo-folder-location}
cas.serviceRegistry.git.pushChanges=true
cas.serviceRegistry.git.timeout=PT10S
cas.serviceRegistry.git.privateKeyPath=${me.base.dir}/cas-settings/keys/coderepo_id_rsa


and CAS-MANAGEMENT interfaces with all this via these management.properties:
mgmt.versionControl.servicesRepo=${git-repo-folder-location}
mgmt.versionControl=true

# SERVICE REGISTRY
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.git.repositoryUrl=g...@coderepo.server:user/cas-6_1-service-definitions.git
cas.serviceRegistry.git.branchesToClone=master
cas.serviceRegistry.git.activeBranch=master
cas.serviceRegistry.git.pushChanges=true


now in the management.properties, if I try and put the cas.serviceRegistry.git.privateKeyPath entry in there, it blows up and says that's not a proper key property and won't even start

it appears as thought the commitController is not happy with my settings. I had a HECK of a time finding the mgmt.versionControl.servicesRepo key. I found it on another site, but haven't actually seen it referenced on any of apereo's docs. they reference it as mgmt.servicesRepo, which always blew up as an unknown key.

that leads me to think, there's another key I need, that I just don't know about... maybe?

any insight would be wonderful! thanks!

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/20003e1c-e2fb-4d44-9982-52a540e4db4a%40apereo.org.

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/ec44964c-eea0-416a-ad71-eab6ac310cc4%40apereo.org.
Reply all
Reply to author
Forward
0 new messages