[cas-user] Can't get cas-management 5.3.0-RC4 working with mongo-service-registry

15 views
Skip to first unread message

Scott Tester

unread,
Jun 19, 2018, 8:17:29 PM6/19/18
to CAS Community
cas-management doesn't seem to be loading services from mongodb.  When I try to save a basic service I see:

=============================================================
WHO: scott
WHAT: AbstractRegisteredService(serviceId=https://example.org/auth, name=Example, theme=null, informationUrl=null, privacyUrl=null, responseType=null, id=1529453303797, description=null, expirationPolicy=DefaultRegisteredServiceExpirationPolicy(deleteWhenExpired=false, notifyWhenDeleted=false, expirationDate=null), proxyPolicy=org.apereo.cas.services.RefuseRegisteredServiceProxyPolicy@1, evaluationOrder=3, usernameAttributeProvider=org.apereo.cas.services.DefaultRegisteredServiceUsernameProvider@87297e2, logoutType=BACK_CHANNEL, requiredHandlers=[], attributeReleasePolicy=ReturnAllowedAttributeReleasePolicy(super=AbstractRegisteredServiceAttributeReleasePolicy(attributeFilter=null, principalAttributesRepository=DefaultPrincipalAttributesRepository(), consentPolicy=DefaultRegisteredServiceConsentPolicy(enabled=true, excludedAttributes=null, includeOnlyAttributes=null), authorizedToReleaseCredentialPassword=false, authorizedToReleaseProxyGrantingTicket=false, excludeDefaultAttributes=false, authorizedToReleaseAuthenticationAttributes=true, principalIdAttribute=null), allowedAttributes=[]), multifactorPolicy=DefaultRegisteredServiceMultifactorPolicy(multifactorAuthenticationProviders=[], failureMode=NOT_SET, principalAttributeNameTrigger=null, principalAttributeValueToMatch=null, bypassEnabled=false), logo=null, logoutUrl=null, accessStrategy=DefaultRegisteredServiceAccessStrategy(order=0, enabled=true, ssoEnabled=true, unauthorizedRedirectUrl=null, delegatedAuthenticationPolicy=DefaultRegisteredServiceDelegatedAuthenticationPolicy(allowedProviders=[]), requireAllAttributes=true, requiredAttributes={}, rejectedAttributes={}, caseInsensitive=false), publicKey=null, properties={}, contacts=[])
ACTION: SAVE_SERVICE_FAILED
APPLICATION: CAS_Management
WHEN: Wed Jun 20 10:08:23 AEST 2018
CLIENT IP ADDRESS: 192.168.37.1
SERVER IP ADDRESS: 192.168.14.141
=============================================================

2018-06-20 10:08:23,998 ERROR [org.apereo.cas.mgmt.services.web.AbstractManagementController] - Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value 'https://example.org/auth'; nested exception is java.time.format.DateTimeParseException: Text 'https://example.org/auth' could not be parsed at index 0
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value 'https://example.org/auth'; nested exception is java.time.format.DateTimeParseException: Text 'https://example.org/auth' could not be parsed at index 0
at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:43) ~[spring-core-4.3.17.RELEASE.jar:4.3.17.RELEASE]
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:203) ~[spring-core-4.3.17.RELEASE.jar:4.3.17.RELEASE]
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:187) ~[spring-core-4.3.17.RELEASE.jar:4.3.17.RELEASE]


I have setup the main cas 5.3.0-RC4 application with the same service settings and it seems to be running just fine.

pom.xml:
   <dependencies>
        ...
       
<dependency>

           
<groupId>org.apereo.cas</groupId>
           
<artifactId>cas-server-support-mongo-service-registry</artifactId>
           
<version>${cas.version}</version>
       
</dependency>
        ...
   
</dependencies>


   
<properties>
       
<cas.version>5.3.0-RC4</cas.version>
       
<springboot.version>1.5.13.RELEASE</springboot.version>
        ...
   
</properties>



/etc/cas/config/management.properties:
##################################################################
# CAS SERVICE REGISTRY
cas
.serviceRegistry.mongo.clientUri=mongodb://cas:somePa...@alpha.example.org:27017,beta.example.org:27017/cas-database?replicaSet=rsExample&ssl=true&readPreference=primary
cas
.serviceRegistry.mongo.databaseName=cas-database

cas
.serviceRegistry.mongo.idleTimeout=30000
cas
.serviceRegistry.mongo.dropCollection=false
cas
.serviceRegistry.mongo.socketKeepAlive=false
cas
.serviceRegistry.mongo.collection=casServiceRegistry
cas
.serviceRegistry.mongo.timeout=5000
cas
.serviceRegistry.mongo.writeConcern=NORMAL
cas
.serviceRegistry.mongo.conns.lifetime=60000
cas
.serviceRegistry.mongo.conns.perHost=10
cas
.serviceRegistry.initFromJson=false



The main cas application successfully initiated Mongo from json:
db.casServiceRegistry.find().pretty():
{
 
"_id" : NumberLong(10000002),
 
"_class" : "org.apereo.cas.services.RegexRegisteredService",
 
"serviceId" : "^https://www.apereo.org",
 
"name" : "Apereo",
 
...
}
{
 
"_id" : NumberLong(10000001),
 
"_class" : "org.apereo.cas.services.RegexRegisteredService",
 
"serviceId" : "^(https|imaps)://.*",
 
"name" : "HTTPS and IMAPS",
 
"description" : "This service definition authorizes all application urls that support HTTPS and IMAPS protocols.",
 
...
}

--
- 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/9a5c60b4-6019-4fa4-9e8e-107bc7d1b224%40apereo.org.

Misagh Moayyed

unread,
Jun 19, 2018, 8:20:07 PM6/19/18
to cas-...@apereo.org
You may want to try with 5.3.0-SNAPSHOT instead. 

--Misagh


To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/2102452590.3351477.1529454004868.JavaMail.zimbra%40unicon.net.

Scott Tester

unread,
Jun 19, 2018, 9:34:44 PM6/19/18
to CAS Community, mmoa...@unicon.net
Not sure why, but I think google groups may have deleted my last reply.
With SNAPSHOT, the services are now visible in cas-management, but I still cannot create or edit a service.

I attempted to edit the description in the "HTTPS and IMAPS" service and still got:

=============================================================
WHO: scott
WHAT: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0
ACTION: SAVE_SERVICE_FAILED
APPLICATION: CAS_Management
...


2018-06-20 10:40:46,141 ERROR [org.apereo.cas.mgmt.services.web.AbstractManagementController] - Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0


On Wednesday, 20 June 2018 10:20:07 UTC+10, Misagh Moayyed wrote:
You may want to try with 5.3.0-SNAPSHOT instead. 

--Misagh

--
- 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/8fec8521-4e2b-4042-b777-122c8ad35c04%40apereo.org.

Scott Tester

unread,
Jun 20, 2018, 1:28:06 PM6/20/18
to CAS Community, mmoa...@unicon.net
It is now loading the services ok! YAH!  but when trying to save, it still gives the weird "fail to convert" error.

I have even tried opening the existing "HTTPS and IMAPS" service, and modifying the description slightly, and saving, which still doesn't work:
=============================================================
WHO: scott
WHAT: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0
ACTION: SAVE_SERVICE_FAILED
...
2018-06-20 10:40:46,141 ERROR [org.apereo.cas.mgmt.services.web.AbstractManagementController] - Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*' could not be parsed at index 0

But, at least it is loading now.


On Wednesday, 20 June 2018 10:20:07 UTC+10, Misagh Moayyed wrote:
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/fb9e323e-efde-4501-9e39-81d8168bb9b2%40apereo.org.

Scott Tester

unread,
Jun 22, 2018, 12:51:55 AM6/22/18
to CAS Community
Tried rebuilding it just then.  Now it is all working.


--
- 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/8d336c9d-cbd0-4aca-96e4-32f1a76790fa%40apereo.org.

Scott Tester

unread,
Jun 22, 2018, 9:32:14 PM6/22/18
to CAS Community
So as it stands, cas-management is now loading the services, but it still isn't saving them to mongodb.

It is trying to convert the Service URL into a ZonedDateTime.  Any ideas as to how to diagnose?

Thanks!
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/65029136-8001-4625-b717-301b37c68e91%40apereo.org.

UVASIREDDY

unread,
Feb 12, 2019, 6:26:37 PM2/12/19
to CAS Community
Hi

Whenever we try to add/edit service from service management UI, we are getting the same DateTimeParseException. Adding or editing Services directly from the database works fine.

Tried rebuilding the MongoDB service registry collection nothing works.

This used work for us when we did POC a few months ago. We migrated to mongo cluster with replication recently.

cas Service Management Version: 5.3.1
cas Server: 5.3.2

service_management/app.propeties:
##
#CAS MongoDB Configuration for Services
#
mongo.db=sso
mongo.rs=casdb
mongo.opts=&ssl=false
mongo.creds=****:****
mongo.hosts=****.**.***.corp
mongo.port=8100
#
# The connection string, assembled
#
mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}:${mongo.port}/${mongo.db}?replicaSet=${mongo.rs}${mongo.opts}

#
# Service registry
#
cas.serviceRegistry.mongo.clientUri=${mongo.uri}
cas.serviceRegistry.mongo.collection=casServiceRegistry


WHAT: Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] for value '^(https|imaps)://.*'; nested exception is java.time.format.DateTimeParseException: Text '^(https|imaps)://.*'' could not be parsed at index 0
ACTION: SAVE_SERVICE_FAILED
APPLICATION: CAS_Management
WHEN: Tue Feb 12 18:05:28 EST 2019
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>2019-02-12 18:05:28,214 ERROR [org.apereo.cas.mgmt.services.web.AbstractManagementController] - <Failed to convert from type [java.lang.String] to type [java.time.ZonedDateTime] 


MongoDB - Service Document:
{"_id":10000001,"_class":"org.apereo.cas.services.RegexRegisteredService","serviceId":"^(https|imaps)://.*","name":"HTTPS and IMAPS",
"description":"This service definition authorized all application urls that support HTTPS and IMAPS protocols.","proxyPolicy":{"_class":"org.apereo.cas.services.RefuseRegisteredServiceProxyPolicy"},
"evaluationOrder":10000,"usernameAttributeProvider":{"_class":"org.apereo.cas.services.DefaultRegisteredServiceUsernameProvider"},"logoutType":"BACK_CHANNEL",
"attributeReleasePolicy":{"_class":"org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy","principalAttributesRepository":{"_class":"org.apereo.cas.authentication.principal.DefaultPrincipalAttributesRepository"},
"authorizedToReleaseCredentialPassword":false,"authorizedToReleaseProxyGrantingTicket":false},"accessStrategy":{"_class":"org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy","enabled":true,"ssoEnabled":true},
"logo":"images/logo_cas.png"}

Regards,
Udaykiran Vasireddy
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/24288062-200e-4d7b-b431-caadeddd1818%40apereo.org.
Reply all
Reply to author
Forward
0 new messages