[ome-users] sessionid files in /tmp
Aleksandra Tarkowska
A.Tarkowska at dundee.ac.uk
Wed Jul 2 09:16:41 BST 2014
Hi John,
Before I start going deeper to resolve your problem I need to know a bit more about your OMERO and web server environment. Could you please send me the following:
1. Output of bin/omero config get (please remove password)
2. Your web server config (apache/nginx).
3. Log files showing HTTP request and/or error logs that could match session creation every 3-5 minutes
4. OMEROweb.log and OMEROweb_request.log that match web server log files from above.
Kind regards
Ola
From: "John Webber (NBI)" <John.Webber at nbi.ac.uk<mailto:John.Webber at nbi.ac.uk>>
Date: Tue, 1 Jul 2014 14:38:31 +0000
To: Douglas Russell <douglas.russell at bioch.ox.ac.uk<mailto:douglas.russell at bioch.ox.ac.uk>>
Cc: Aleksandra Tarkowska <a.tarkowska at dundee.ac.uk<mailto:a.tarkowska at dundee.ac.uk>>, "ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>" <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: RE: [ome-users] sessionid files in /tmp
Hi Douglas
Thank you for your response.
I can certainly employ techniques to clean-up the tmp directory, for example running a job from cron, but this still does not address the issue of why new files are appearing every 3 to 5 minutes. On other Omero servers that we have implemented, these files do not gather in the same way – a fresh file does not appear every few minutes!
I was therefore keen to get to the bottom of why this server seems to be creating these files so regularly. This server is not our main Omero server and is not seeing a high volume of transactions!
Thanks
John
From: Douglas Russell [mailto:douglas.russell at bioch.ox.ac.uk]
Sent: 01 July 2014 10:40
To: John Webber (NBI)
Cc: Aleksandra Tarkowska; ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
Subject: Re: [ome-users] sessionid files in /tmp
Hi John,
cleansessions is too modern for the old django 1.3.1 shipped with omero 4.4.X.
You are right that the old equivalent of this command was 'cleanup', but in this very old version of django it only cleans up sessions in the database, not file based sessions.
To cleanup after yourself on this system I would use whatever mechanism your operating system has to clean-up your tmp directory. For example, you might use something like this to clean-up files that have not been accessed for a while: http://manpages.ubuntu.com/manpages/hardy/man8/tmpreaper.8.html
Cheers,
Douglas
On 30 June 2014 09:56, John Webber (NBI) <John.Webber at nbi.ac.uk<mailto:John.Webber at nbi.ac.uk>> wrote:
Hi Ola,
The server exhibiting the issue is running the same version of Omero as our current production server, which is -4.4.8p1-ice33-b304. The production server does not exhibit the issue. The only difference in the output from the command “bin/omero config get” on these two servers is that the Production server has LDAP configured.
I have also checked this output on two servers running Omero 5 as well.
Thanks
John
From: Aleksandra Tarkowska [mailto:A.Tarkowska at dundee.ac.uk<mailto:A.Tarkowska at dundee.ac.uk>]
Sent: 27 June 2014 17:19
To: John Webber (NBI)
Cc: Blazej Pindelski; ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
Subject: Re: [ome-users] sessionid files in /tmp
Hi John,
Which OMERO version are we talking about, exactly?
Kind regards
Ola
On 27 Jun 2014, at 17:16, "John Webber (NBI)" <John.Webber at nbi.ac.uk<mailto:John.Webber at nbi.ac.uk>> wrote:
Hi Blazej,
Thanks for the email,
I have run the “bin/omero config get” on three different servers to ascertain if there are any major differences.
One of the servers has been configured to used LDAP, so there are a number of LDAP setting which are reported, but these can be ignored. The other key difference is, however, that on the server that is exhibiting the issue the issues, the following two values are set, which are not set on the other servers:
omero.web.debug=False
omero.web.public.enabled=False
It doesn’t seem like either of these two settings could be causing the issue of sessionid files not being cleared up, but do you think either could?
I have run the following commands, but have encountered an issue with this as well:
$ cd /opt/omero.server/lib/python/omeroweb
$ PYTHONPATH=$PYTHONPATH:/opt/omero.server/lib/python python manage.py clearsessions
I see the following error from this command:
Unknown command: 'clearsessions'
Type 'manage.py help' for usage.
Should the command be “cleanup” instead?
Thanks
John
From: Blazej Pindelski [mailto:bpindelski at dundee.ac.uk]
Sent: 27 June 2014 11:55
To: John Webber (NBI)
Cc: ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
Subject: Re: [ome-users] sessionid files in /tmp
On 27/06/14 10:27, John Webber (NBI) wrote:
Hi Ola,
Hi John,
I’ve been going around in circles with this one trying to find what I need, but not got anywhere…
Looking at other servers we have configured previously that DO NOT gather the “sessionid” files in /tmp,, I cannot see that these are running the “clearsessions” command – I do not believe that they are!
I presume there is no difference in the output of "bin/omero config get" between the servers?
When you say that “session data can accumulate in your session store” would you expect this to be a new sessionid file every 3 to 5 minutes, with the old ones never being deleted.
I have also attempted to run the clearsessions command on this server, but I am seeing the following error:
Traceback (most recent call last):
File "manage.py", line 29, in ?
from django.core.management import execute_manager
ImportError: No module named django.core.management
I believe this is because it is not able to locate the python module, so I probably need to change my PYTHONPATH, but I’m not sure what it should be – please can you give any pointers?
You are correct, a simple modification (doesn't have to be permanent) of PYTHONPATH should solve this issue. Let's presume your server code has been unzipped to /opt/omero.server. Then to run the "manage.py" command, you have to append to the PYTHONPATH the "/opt/omero.server/lib/python" directory.
To run the script once, and not preserve the PYTHONPATH changes, do
$ cd /opt/omero.server/lib/python/omeroweb
$ PYTHONPATH=$PYTHONPATH:/opt/omero.server/lib/python python manage.py clearsessions
If you want to add the OMERO Python library directory permanently to your PYTHONPATH, please consult
http://www.openmicroscopy.org/site/support/omero5/sysadmins/unix/server-installation.html#environment-variables.
It mentions the places where the new PYTHONPATH setting can be stored.
Thanks
John
Regards,
Blazej
From: Aleksandra Tarkowska [mailto:A.Tarkowska at dundee.ac.uk]
Sent: 25 June 2014 15:08
To: John Webber (NBI)
Cc: ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
Subject: Re: [ome-users] sessionid files in /tmp
Dear John
As users create new sessions on the OMERO.web, session data can accumulate in your session store. Because OMERO.web uses the file based backend, your temporary directory will contain an increasing number of files. Django does not provide automatic purging of expired sessions. Therefore, it’s your job to purge expired sessions on a regular basis. Django provides a clean-up management command for this purpose: clear sessions. It’s recommended to call this command on a regular basis, for example as a daily cron job.
cd OMERO/lib/python/omeroweb
python manage.py clearsessions
Note that the cache backend isn’t vulnerable to this problem, because caches automatically delete stale data.
If you wish to change it to cache based, first install Memcached and a memcached binding. There are several python memcached bindings available; the two most common are python-memcached and pylibmc. Then set the following
$ bin/omero web stop
$ bin/omero config set omero.web.caches '{"default": { "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", "LOCATION": "127.0.0.1:11211<http://127.0.0.1:11211>", "TIMEOUT": "86400" } }'
$ bin/omero config set omero.web.session_engine "django.contrib.sessions.backends.cache"
$ bin/omero web start
I hope it will help
Kind regards
Ola
From: "John Webber (NBI)" <John.Webber at nbi.ac.uk<mailto:John.Webber at nbi.ac.uk>>
Date: Mon, 23 Jun 2014 11:20:08 +0000
To: William Moore <will at lifesci.dundee.ac.uk<mailto:will at lifesci.dundee.ac.uk>>
Cc: "ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>" <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] sessionid files in /tmp
Hi Will,
Thanks for the response.
I have done some more tests but am still experiencing the same issue. I have restarted HTTPD, Omero and Omero_web. I have also rebooted the server itself.
These files are created when we restart omero web. When omero web is not running the files are not created.
I am running exactly the same python versions, omero versions and ice versions across two servers. The main difference I can see on these servers is that the one which has “sessionid” files gathering in “/tmp” has a later version of httpd as follows:
Server without issue: Server with sessionID issue:
httpd-2.2.3-82.el5.centos httpd-2.2.3-83.el5.centos
httpd-devel-2.2.3-82.el5.centos httpd-devel-2.2.3-83.el5.centos
I have attached a complete list of the different RPMs, but not sure whether any of the others are relevant.
Please can you give me a pointer as to why this is occurring. Is it something that can be corrected, or do I need to set up a cron job to remove the session ID files?
Thanks
John
From: William Moore [mailto:will at lifesci.dundee.ac.uk]
Sent: 20 June 2014 10:46
To: John Webber (NBI)
Cc: ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
Subject: Re: [ome-users] sessionid files in /tmp
Hi John,
It's probably the Django web server that is creating these files in /tmp. See https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-file-based-sessions
and http://stackoverflow.com/questions/10197880/django-file-based-session-doesnt-expire
These are sessions between the browser and the Django server and have nothing to do with OMERO sessions.
Are you aware of any difference in the web server configurations or browser connections between your servers that could explain this behaviour?
Regards,
Will.
On 19 Jun 2014, at 16:38, "John Webber (NBI)" <John.Webber at nbi.ac.uk<mailto:John.Webber at nbi.ac.uk>> wrote:
Hi all,
On one of my Omero servers I am seeing “sessionid” files in /tmp, which are generated every 10 minutes and not removed. These files are called something like “sessionideb93037246a7b1efe7e01f6eec735cef”. On other Omero servers, one or two of these files might exist, but they are not created every 10 minutes or so! These are only small, but there are a lot of them!
Can anyone advise why these are being left behind? This is the SAME server where I was experiencing the “Server error[500]” errors, which have now stopped.
Thanks
John
--------------------------------------------------------------------------------------------------------------------------------------------
John Webber
Computing and Information Services
NBI Partnership Ltd
Norwich Research park
Colney Lane
Norwich
NR4 7UH
E-Mail: john.webber at nbi.ac.uk<mailto:john.webber at nbi.ac.uk>
Web: http://www.nbi.ac.uk<http://www.nbi.ac.uk/>
Tel: +44(0)1603 450 818
Helpdesk (Tel): 1234 HPC Support (Web): http://hpc.nbi.ac.uk<http://hpc.nbi.ac.uk/> (NBI internal)
HPC Support (Tel): 2003 (NBI internal)
The NBI Partnership Ltd provides non-scientific services to the Institute of Food Research, the John Innes Centre, The Genome Analysis Centre and The Sainsbury Laboratory
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
_______________________________________________ ome-users mailing list ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20140702/2b0ad68b/attachment.html>
More information about the ome-users
mailing list