Following the guidance in the SAS® Viya® 3.5 Administration: Configuration Properties guide to increase the timeout of the SAS Viya web applications, I created a global config in the `server` definition with the name / value pair:
servlet.session.timeout: 3600
The documentation states that the global option can be used, eg here:
To specify the time-out interval for all applications, do not change the default value of Global in the Services field.
However - when restarting the services, a number of errors are thrown, the first one being:
WARNING: sas-viya-authorization-default has been started and died 4 times. It will not be restarted.
When I check the log under `/opt/sas/viya/config/var/log/authorization/default` I see:
Failed to bind properties under 'server.servlet.session.timeout' to java.time.Duration
Now, I cannot open Environment Manager, nor any of the web apps (StudioV, JobExecution, SASDrive). Is there any way to undo this change?
This stackoverflow post implies that it could be related to a space after the value. I tried searching for a "bootstrapProperties-config" folder but nothing came up.
I also ran:
Which returned:
It would appear that this configuration change cannot be made through the filesystem. I tried using the `sas-adm` CLI (configuration plugin) but I was not able to run `sas-admin auth login` - presumably for the same reason I cannot log into the web apps.
When logging into the web apps I get:
> The system could not obtain group memberships for {myusername}
Most worryingly, down on page 71 of the aforementioned documentation, the below is mentioned. This should probably be right up there on page 5 where the instructions are listed!
> When adding a property, be extremely careful. Entering the wrong property name or an invalid data type can cause SAS Viya to become inoperable.
Hi Allan,
Please see below....
1. at some point the wrong property was introduced:
Property: server.servlet.session.timeout
Value: 42000
Origin: "server.servlet.session.timeout" from property source "bootstrapProperties-config/application/"
Reason: failed to convert java.lang.String to @org.springframework.boot.convert.DurationUnit java.time.Duration
It should _not_ be:
server.servlet.session.timeout
Instead, the property should be this without the "server" prefix:
servlet.session.timeout
To remove server.servlet.session.timeout now, you can use sas-bootstrap-config as shown:
1. Set the env vars needed for sas-bootstrap-config with these commands:
source /opt/sas/viya/config/consul.conf
export CONSUL_HTTP_TOKEN=$(sudo cat /opt/sas/viya/config/etc/SASSecurityCertificateFramework/tokens/consul/default/client.token)
2. Run sas-bootstrap-config and grep for the problem property
/opt/sas/viya/home/bin/sas-bootstrap-config kv read --recurse config | grep "server.servlet.session.timeout"
3. Based on the output returned, delete the key returned in #2
/opt/sas/viya/home/bin/sas-bootstrap-config kv delete --site-default <key>
So if #2 returned
config/example1/example2/server.servlet.session.timeout=14400
Use the key to the left of '=', e.g.,
/opt/sas/viya/home/bin/sas-bootstrap-config kv delete --site-default config/example1/example2/server.servlet.session.timeout
You can check it's gone by rerunning #2 again.
After this, restart Viya services following: https://go.documentation.sas.com/?cdcId=calcdc&cdcVersion=3.5&docsetId=calchkadm&docsetTarget=n00003...
Hi Allan,
Please see below....
1. at some point the wrong property was introduced:
Property: server.servlet.session.timeout
Value: 42000
Origin: "server.servlet.session.timeout" from property source "bootstrapProperties-config/application/"
Reason: failed to convert java.lang.String to @org.springframework.boot.convert.DurationUnit java.time.Duration
It should _not_ be:
server.servlet.session.timeout
Instead, the property should be this without the "server" prefix:
servlet.session.timeout
To remove server.servlet.session.timeout now, you can use sas-bootstrap-config as shown:
1. Set the env vars needed for sas-bootstrap-config with these commands:
source /opt/sas/viya/config/consul.conf
export CONSUL_HTTP_TOKEN=$(sudo cat /opt/sas/viya/config/etc/SASSecurityCertificateFramework/tokens/consul/default/client.token)
2. Run sas-bootstrap-config and grep for the problem property
/opt/sas/viya/home/bin/sas-bootstrap-config kv read --recurse config | grep "server.servlet.session.timeout"
3. Based on the output returned, delete the key returned in #2
/opt/sas/viya/home/bin/sas-bootstrap-config kv delete --site-default <key>
So if #2 returned
config/example1/example2/server.servlet.session.timeout=14400
Use the key to the left of '=', e.g.,
/opt/sas/viya/home/bin/sas-bootstrap-config kv delete --site-default config/example1/example2/server.servlet.session.timeout
You can check it's gone by rerunning #2 again.
After this, restart Viya services following: https://go.documentation.sas.com/?cdcId=calcdc&cdcVersion=3.5&docsetId=calchkadm&docsetTarget=n00003...
Hi Carmine - thanks for the fast and detailed response.
I followed the steps you described, here are the results:
I dug into this command a little more and found this extract (so was definitely submitted without a trailing space):
I also tried `sas-bootstrap-config kv delete` without the `--site=default`. I then tried to see if I could modify the value - and running _without_ the force flag threw up an interesting (connection refused) message. Does this hold any clues?
Any further tips? I'm 100% certain that I originally typed it in without the server prefix, mainly because right after making the config change, I started getting login issues.
The issue is now fixed
I believe the problem was that it needed to run as sudo, however when I prefixed with sudo, the exported consul value was not available.
I ran `sudu su`, re-exported the consul token, and the command worked (I ran without `--site=default` as advised by Hywel from SAS UK).
Thanks very much!!
I have a similar issue after changing "servlet.session.timeout" value on the "definitions -> server" page.
Getting the following response when starting services:
WARNING: sas-viya-authorization-default has been started and died 4 times. It will not be restarted.
Other services may fail to start due to this. Check logs, remedy the problem and try again.
WARNING: sas-viya-identities-default has been started and died 4 times. It will not be restarted.
Other services may fail to start due to this. Check logs, remedy the problem and try again.
The sas-bootstrap-config command returns:
[root@opcgg100000322 ~]# /opt/sas/viya/home/bin/sas-bootstrap-config kv read --recurse config | grep "servlet.session.timeout"
config/application/server/servlet.session.timeout=10800
However, the following delete command did not work:
[root@opcgg100000322 ~]# /opt/sas/viya/home/bin/sas-bootstrap-config kv delete --site-default config/application/server/servlet.session.timeout=10800
So, unfortunately, this approach did not work for me.
Any ideas?
BTW, I could not find any documentation on using sas-bootstrap-config for deleting configuration entries.
The full content
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.