[JIRA] (JENKINS-51734) sessionTimeout isn't be honoured

4 views
Skip to first unread message

ben.copeland@linaro.org (JIRA)

unread,
Jun 6, 2018, 9:34:01 AM6/6/18
to jenkinsc...@googlegroups.com
Ben Copeland created an issue
 
Jenkins / Bug JENKINS-51734
sessionTimeout isn't be honoured
Issue Type: Bug Bug
Assignee: Kanstantsin Shautsou
Components: crowd2-plugin, docker
Created: 2018-06-06 13:33
Priority: Major Major
Reporter: Ben Copeland

Since upgrade to Jenkins 2.107.1 the sessionTimeout option isn't working.

We run Jenkins in a docker image (jenkins/jenkins:2.107.3) with option "ENV JENKINS_OPTS="–sessionTimeout=1440". We use the crowd2 as our login engine.

Since upgrading to 2.107.1 sessions are only being held active for ~30mins.

I can see that the option is running:

"-Dorg.eclipse.jetty.server.Request.maxFormContentSize=1000000 -jar /usr/share/jenkins/jenkins.war --sessionTimeout=1440"

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

o.v.nenashev@gmail.com (JIRA)

unread,
Jun 6, 2018, 5:50:04 PM6/6/18
to jenkinsc...@googlegroups.com
Oleg Nenashev assigned an issue to Unassigned
 

Removing the assignee according to https://groups.google.com/forum/#!topic/jenkinsci-dev/sFejhRvZiIM

Change By: Oleg Nenashev
Assignee: Kanstantsin Shautsou

mail@martinspielmann.de (JIRA)

unread,
Jun 17, 2018, 5:34:03 AM6/17/18
to jenkinsc...@googlegroups.com
Martin Spielmann assigned an issue to Martin Spielmann
Change By: Martin Spielmann
Assignee: Martin Spielmann

zlei.huang@gmail.com (JIRA)

unread,
Jul 4, 2018, 12:12:02 AM7/4/18
to jenkinsc...@googlegroups.com
Zhenlei Huang commented on Bug JENKINS-51734
 
Re: sessionTimeout isn't be honoured

Hi, Ben Copeland, have you enabled the SSO, i.e. checked the 'Use SSO' option? Can you give it another try without enabling SSO? Thanks

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

scyiwei@163.com (JIRA)

unread,
Jul 30, 2018, 6:06:02 AM7/30/18
to jenkinsc...@googlegroups.com
Wei Yi commented on Bug JENKINS-51734

I hit this issue too. The sessionTimeout doesn't work after I upgrade my jenkins from 2.19.3 to 2.121.2.
After some investigation I found that winstone is upgrade from 3.1 to 4.2.

It seems before 4.2
https://github.com/jenkinsci/winstone/blob/winstone-4.1/src/java/winstone/HostConfiguration.java

It only uses sessionTimeout.

@Override
  public void postConfigure() throws Exception {| | |super.postConfigure();| | | | | |// if specified, override the value in web.xml| | |int sessionTimeout = Option.SESSION_TIMEOUT.get(args);| | |if (sessionTimeout>0)| | |getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);| | |}

 

but in 4.2

https://github.com/jenkinsci/winstone/blob/winstone-4.2/src/main/java/winstone/HostConfiguration.java

It uses sessionTimeout and sessionEviction.

@Override
  public void postConfigure() throws Exception {
  super.postConfigure();
   
  // if specified, override the value in web.xml
  int sessionTimeout = Option.SESSION_TIMEOUT.get(args);
  if (sessionTimeout>0) {| | |getSessionHandler().setMaxInactiveInterval(sessionTimeout * 60);| | |}
  int sessionEviction = Option.SESSION_EVICTION.get(args);
  getSessionHandler().getSessionCache().setEvictionPolicy( sessionEviction );
  }

According to https://github.com/jenkinsci/winstone, the session will be evicted after 30 minutes if we don't set sessionEviction.

--sessionEviction = Set the session eviction timeout for idle sessions. Default value is 30min.

{{}}

After I add --sessionEviction, it works now.

mail@martinspielmann.de (JIRA)

unread,
Jul 30, 2018, 3:13:01 PM7/30/18
to jenkinsc...@googlegroups.com
Martin Spielmann started work on Bug JENKINS-51734
 
Change By: Martin Spielmann
Status: Open In Progress

totoroliu1215@hotmail.com (JIRA)

unread,
Oct 4, 2018, 7:13:03 PM10/4/18
to jenkinsc...@googlegroups.com
Rick Liu commented on Bug JENKINS-51734

I see the same issue after upgrading to Jenkins core v.2.121.3.

On Ubuntu 16.04.4 LTS under /etd/default/jenkins,
I have set JENKINS_ARG with --sessionTimeout=1440, which is 24 hours.

But with a logged-in Jenkins page openned in a browser tab (both Firefox and Chrome),
after about 1 hour inactivity to the tab,
the session would be gone.
Any click to the page would be redirected to the login page to login again.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

totoroliu1215@hotmail.com (JIRA)

unread,
Oct 4, 2018, 7:17:01 PM10/4/18
to jenkinsc...@googlegroups.com
Rick Liu edited a comment on Bug JENKINS-51734
I see the same issue after upgrading to Jenkins core v.2.121.3.

On Ubuntu 16.04.4 LTS under /etd/default/jenkins,
I have set JENKINS_ARG with --sessionTimeout=1440, which is 24 hours.

But with a logged-in Jenkins page openned in a browser tab (both Firefox and Chrome),
after about 1 hour inactivity to the tab,
the session would be gone.
Any click to the page would be redirected to the login page to login again.


this --sessionEvicition setting should be added to the document page.

ben.copeland@linaro.org (JIRA)

unread,
Nov 30, 2018, 9:36:03 AM11/30/18
to jenkinsc...@googlegroups.com

I have both ENV JENKINS_OPTS="--sessionTimeout=1440 --sessionEviction=1440" set in my dockerfile but seem to still be getting logged out every ~10mins. 

inka@mailbox.org (JIRA)

unread,
Jan 25, 2019, 10:28:02 AM1/25/19
to jenkinsc...@googlegroups.com
in ka commented on Bug JENKINS-51734

sessionEviction also not works for me. Anybody found a work around?

 

mail@martinspielmann.de (JIRA)

unread,
Jan 25, 2019, 12:09:02 PM1/25/19
to jenkinsc...@googlegroups.com

Im sorry I won't be able to work I  this topic before March. Any help and PR is highly appreciated.

alexrwave@gmail.com (JIRA)

unread,
Apr 9, 2019, 4:50:02 AM4/9/19
to jenkinsc...@googlegroups.com

Hi! Is there any update on this? Is it possible to workaround this using Groovy init scripts?

tarvip@gmail.com (JIRA)

unread,
Jul 5, 2019, 10:19:03 AM7/5/19
to jenkinsc...@googlegroups.com

sessionEviction is actually working (tested with version 2.176.1), just sessionEviction is in seconds and sessionTimeout is in minutes.

Reply all
Reply to author
Forward
0 new messages