CAS 6.3.1 - Git Service Registry : "Ref master cannot be resolved" error

268 views
Skip to first unread message

Frédéric Lohier

unread,
Feb 9, 2021, 1:43:37 PM2/9/21
to CAS Community
Hello,

 

I get the error « Ref master cannot be resolved » when trying to setup the Git Service Registry with CAS 6.3.1 with the following configuration in my cas.properties :

 

cas.service-registry.git.repository-url=https://base-url.com/gitlab/idp/cas-metadatas

cas.service-registry.git.branches-to-clone=master

cas.service-registry.git.clone-directory.location=file:/var/tmp/cas-services-git

 

The same configuration is working in CAS 6.2.5.

The only property I had to change is the cas.service-registry.git.clone-directory in 6.2.5 to cas.service-registry.git.clone-directory.location in 6.3.1.

 

Also, from my cas server, I checked that I can clone the git repo with the command « git clone https://base-url.com/gitlab/idp/cas-metadatas ».

 

Any idea of where I should look to fix this ?

 

Here is the full error :

 

2021-02-09 19:25:37,506 ERROR [org.apereo.cas.git.GitRepositoryBuilder] - <Ref master cannot be resolved>

org.eclipse.jgit.api.errors.RefNotFoundException: Ref master cannot be resolved

        at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:223) ~[org.eclipse.jgit-5.9.0.202009080501-r.jar!/:5.9.0.202009080501-r]

        at org.apereo.cas.git.GitRepositoryBuilder.getExistingGitRepository(GitRepositoryBuilder.java:196) ~[cas-server-support-git-core-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.git.GitRepositoryBuilder.build(GitRepositoryBuilder.java:157) ~[cas-server-support-git-core-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration.gitServiceRegistryRepositoryInstance(GitServiceRegistryConfiguration.java:62) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf.CGLIB$gitServiceRegistryRepositoryInstance$2(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf$$FastClassBySpringCGLIB$$f2e1c9c6.invoke(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf.gitServiceRegistryRepositoryInstance(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:363) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:389) ~[spring-cloud-context-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]

        at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:186) ~[spring-cloud-context-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:360) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:675) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.apereo.cas.git.GitRepository$$EnhancerBySpringCGLIB$$f5443163.getRepositoryDirectory(<generated>) ~[cas-server-support-git-core-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration.gitServiceRegistry(GitServiceRegistryConfiguration.java:75) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf.CGLIB$gitServiceRegistry$0(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf$$FastClassBySpringCGLIB$$f2e1c9c6.invoke(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.apereo.cas.config.GitServiceRegistryConfiguration$$EnhancerBySpringCGLIB$$cdb51faf.gitServiceRegistry(<generated>) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:363) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:389) ~[spring-cloud-context-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]

        at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:186) ~[spring-cloud-context-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:360) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at com.sun.proxy.$Proxy171.getName(Unknown Source) ~[?:?]

        at org.apereo.cas.services.DefaultServiceRegistryExecutionPlan.registerServiceRegistry(DefaultServiceRegistryExecutionPlan.java:24) ~[cas-server-core-services-registry-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.GitServiceRegistryConfiguration.lambda$gitServiceRegistryExecutionPlanConfigurer$0(GitServiceRegistryConfiguration.java:95) ~[cas-server-support-git-service-registry-6.3.1.jar!/:6.3.1]

        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.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:499) ~[spring-cloud-context-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at com.sun.proxy.$Proxy172.configureServiceRegistry(Unknown Source) ~[?:?]

        at org.apereo.cas.config.CasCoreServicesConfiguration.lambda$serviceRegistryExecutionPlan$1(CasCoreServicesConfiguration.java:177) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) ~[?:?]

        at org.apereo.cas.config.CasCoreServicesConfiguration.serviceRegistryExecutionPlan(CasCoreServicesConfiguration.java:175) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.CasCoreServicesConfiguration$$EnhancerBySpringCGLIB$$d54a5c07.CGLIB$serviceRegistryExecutionPlan$12(<generated>) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.CasCoreServicesConfiguration$$EnhancerBySpringCGLIB$$d54a5c07$$FastClassBySpringCGLIB$$968c7513.invoke(<generated>) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.apereo.cas.config.CasCoreServicesConfiguration$$EnhancerBySpringCGLIB$$d54a5c07.serviceRegistryExecutionPlan(<generated>) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at org.apereo.cas.config.CasCoreServicesConfiguration$$FastClassBySpringCGLIB$$b13b6f59.invoke(<generated>) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687) ~[spring-aop-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.apereo.cas.config.CasCoreServicesConfiguration$$EnhancerBySpringCGLIB$$72062656.serviceRegistryExecutionPlan(<generated>) ~[cas-server-core-services-6.3.1.jar!/:6.3.1]

        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.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) ~[spring-boot-2.3.7.RELEASE.jar!/:2.3.7.RELEASE]

        at org.apereo.cas.web.CasWebApplication.main(CasWebApplication.java:84) ~[cas-server-webapp-init-6.3.1.jar!/:6.3.1]

        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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[cas.war:?]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) ~[cas.war:?]

        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[cas.war:?]

        at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59) ~[cas.war:?]

2021-02-09 19:25:37,508 WARN [org.apereo.cas.web.CasWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceRegistryExecutionPlan' defined in class path resource [org/apereo/cas/config/CasCoreServicesConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apereo.cas.services.ServiceRegistryExecutionPlan]: Factory method 'serviceRegistryExecutionPlan' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.gitServiceRegistry' defined in class path resource [org/apereo/cas/config/GitServiceRegistryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apereo.cas.services.ServiceRegistry]: Factory method 'gitServiceRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.gitServiceRegistryRepositoryInstance' defined in class path resource [org/apereo/cas/config/GitServiceRegistryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apereo.cas.git.GitRepository]: Factory method 'gitServiceRegistryRepositoryInstance' threw exception; nested exception is java.lang.IllegalArgumentException: Ref master cannot be resolved>

 

Reply all
Reply to author
Forward
0 new messages