cas-management error creating service

77 views
Skip to first unread message

lanf detroy

unread,
Oct 27, 2022, 9:45:52 AM10/27/22
to CAS Community

Hello,
 I installed cas-management in version 6.6.0, and when I create a service and I want to register it I have the following error:
An error has occurred while attempting to save the service. Please try again later.

I see the services that I created by hand in the directory /etc/cas/services

Can you help me?

lanf detroy

unread,
Oct 27, 2022, 10:42:42 AM10/27/22
to CAS Community, lanf detroy
[2022-10-27 16:40:14] [info] =============================================================
[2022-10-27 16:40:14] [info] WHO: me
[2022-10-27 16:40:14] [info] WHAT: IO error opening file stream.
[2022-10-27 16:40:14] [info] ACTION: SAVE_SERVICE_FAILED
[2022-10-27 16:40:14] [info] APPLICATION: CAS_Management
[2022-10-27 16:40:14] [info] WHEN: Thu Oct 27 16:40:14 CEST 2022
[2022-10-27 16:40:14] [info] CLIENT IP ADDRESS: 192.168.1.254
[2022-10-27 16:40:14] [info] SERVER IP ADDRESS: 192.168.1.14
[2022-10-27 16:40:14] [info] =============================================================
[2022-10-27 16:40:14] [info] >
[2022-10-27 16:40:14] [info] 2022-10-27 16:40:14,159 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] - <Forwarding to error page from request [/api/services/] due to exception [org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: IO error opening file stream.]>
[2022-10-27 16:40:14] [info] java.lang.RuntimeException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: IO error opening file stream

Ray Bon

unread,
Oct 27, 2022, 12:37:46 PM10/27/22
to cas-...@apereo.org, lanfd...@gmail.com
lanf,

Check that the process that is running cas management has write access to the directory in the config.

Ray

On Thu, 2022-10-27 at 07:42 -0700, lanf detroy wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

lanf detroy

unread,
Oct 28, 2022, 1:46:00 AM10/28/22
to CAS Community, Ray Bon
I don't know where to look for this? What parameter to put?

Ray Bon

unread,
Oct 28, 2022, 2:15:35 PM10/28/22
to lanfd...@gmail.com, cas-...@apereo.org
lanf,

If you are on linux you can use this command to see access and ownership of the services directory (on my laptop):
ls -l /etc/cas/
total 4
drwxrwxr-x 3 rbon rbon 4096 Jun 16 18:36 services

To see the process owner for the container running cas (this is for tomcat running, substitute your app server)
ps aux | grep tomcat
rbon 336911 338 7.0 11769108 2314612 pts/10 SNl 11:12 1:17 /usr/bin/java -Djava.util.logging.config.file=/home/rbon/Applications/mgmt/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Djava.awt.headless=true -XX:+UseG1GC -Xms1024m -Xmx2048m -Dcas.standalone.configurationDirectory=/home/uvtomcat/cas-management_config -Dignore.endorsed.dirs= -classpath /home/rbon/Applications/mgmt/bin/bootstrap.jar:/home/rbon/Applications/mgmt/bin/tomcat-juli.jar -Dcatalina.base=/home/rbon/Applications/mgmt -Dcatalina.home=/home/rbon/Applications/mgmt -Djava.io.tmpdir=/home/rbon/Applications/mgmt/temp org.apache.catalina.startup.Bootstrap start

If you need more info, provide more details about your configuration.

Ray

lanf detroy

unread,
Nov 7, 2022, 1:46:03 AM11/7/22
to CAS Community, Ray Bon, lanf detroy
hello, the directory user is root and the CAS user is tomcat. Do you have to give CAS directory rights to tomcat?

ls -l /etc/cas/
drwxr-xr-x 2 root root 4096 27 oct.  16:07 config
drwxr-xr-x 2 root root 4096 28 oct.  09:56 services

ps aux | grep tomcat
tomcat     35266  1.8 16.3 5092560 1333328 ?     Ssl  oct.27 278:49 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dlog4j2.formatMsgNoLookups=True -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/share/tomcat9/bin/bootstrap.jar:/usr/share/tomcat9/bin/tomcat-juli.jar -Dcatalina.base=/var/lib/tomcat9 -Dcatalina.home=/usr/share/tomcat9 -Djava.io.tmpdir=/tmp org.apache.catalina.startup.Bootstrap start

Ray Bon

unread,
Nov 7, 2022, 1:09:52 PM11/7/22
to lanfd...@gmail.com, cas-...@apereo.org
lanf,

You can change the group for the services directory and give it write permissions.

sudo chgrp --recursive tomcat /etc/cas/services
sudo chmod g+w --recursive /etc/cas/services/

Ray

Ray Bon

unread,
Nov 9, 2022, 4:03:06 PM11/9/22
to lanfd...@gmail.com, cas-...@apereo.org
lanf,

This looks to be the default directory

# mgmt.services-repo=/etc/cas/services-repo 


Have you changed it in your management.properties?

Ray

On Wed, 2022-11-09 at 02:28 -0800, lanf detroy wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

I changed the permissions but it didn't change anything. Is there anything else to do?

lanf detroy

unread,
Nov 9, 2022, 4:03:06 PM11/9/22
to CAS Community, Ray Bon, lanf detroy
I changed the permissions but it didn't change anything. Is there anything else to do?

lanf detroy

unread,
Nov 10, 2022, 2:12:18 AM11/10/22
to CAS Community, lanf detroy, Ray Bon
it does not work. the application no longer launches. Here is the error:

[2022-11-10 07:55:15] [info] 2022-11-10 07:55:15,391 WARN [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mgmt-org.apereo.cas.configuration.CasManagementConfigurationProperties': Could not bind properties to 'CasManagementConfigurationProperties' : prefix=mgmt, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mgmt' to org.apereo.cas.configuration.CasManagementConfigurationProperties>
[2022-11-10 07:55:15] [info] 2022-11-10 07:55:15,456 ERROR [org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter] - <
[2022-11-10 07:55:15] [info] ***************************
[2022-11-10 07:55:15] [info] APPLICATION FAILED TO START
[2022-11-10 07:55:15] [info] ***************************
[2022-11-10 07:55:15] [info] Description:
[2022-11-10 07:55:15] [info] Binding to target [Bindable@669aa5d3 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:
[2022-11-10 07:55:15] [info]     Property: mgmt.services-repo
[2022-11-10 07:55:15] [info]     Value: "/etc/cas/services-repo"
[2022-11-10 07:55:15] [info]     Origin: "mgmt.services-repo" from property source "bootstrapProperties-casCompositePropertySource"
[2022-11-10 07:55:15] [info]     Reason: The elements [mgmt.services-repo] were left unbound.
[2022-11-10 07:55:15] [info] Action:
[2022-11-10 07:55:15] [info] Update your application's configuration
[2022-11-10 07:55:15] [info] >


 I am in version 6.6.0 for the case-management, the properties have not changed?

Ray Bon

unread,
Nov 10, 2022, 7:12:46 PM11/10/22
to lanfd...@gmail.com, cas-...@apereo.org
lanf,

Apologies, that is the the location of the local git repo; and the 6.6.x property is:
mgmt.version-control.services-repo

If you are using json service registry:
cas.serviceRegistry.json.location=file:/etc/cas/services

Had to go through the source docs to find it.


Ray
Reply all
Reply to author
Forward
0 new messages