<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hi Paul,</div>
<div class=""><br class="">
</div>
<div class="">as always, thanks for the feedback. We also noticed several issues with the</div>
<div class="">session key usage in the CLI during the 5.1.0 testing which we did not have</div>
<div class="">time to address.</div>
<div class=""><br class="">
</div>
<div class="">The issue you described below is not fully 5.1 specific as far as I can tell.</div>
<div class="">From a 5.0.8 server, I can reproduce a “Bad session key” error if a group was</div>
<div class="">passed while creating the initial connection and this group is not passed when</div>
<div class="">joining the session:</div>
<div class=""><br class="">
</div>
$ rm -rf ~/omero/sessions/<br class="">
$ bin/omero login user-4@localhost:4064 -g read-only-1 <br class="">
Password:<br class="">
Created session 4f481d76-cc77-4884-8941-682f1c3b5d6b (user-4@localhost:4064). Idle timeout: 10.0 min. Current group: read-only-1<br class="">
$ bin/omero login -k 4f481d76-cc77-4884-8941-682f1c3b5d6b localhost:4064<br class="">
Bad session key<br class="">
$ bin/omero login -k 4f481d76-cc77-4884-8941-682f1c3b5d6b localhost:4064 -g read-only-1<br class="">
Joined session 4f481d76-cc77-4884-8941-682f1c3b5d6b (user-4@localhost:4064). Idle timeout: 10.0 min. Current group: read-only-1<br class="">
<br class="">
<div class="">This particular issue is related to the fact that the check_and_attach() logic</div>
<div class="">performs a strict check for properties conflict:</div>
<div class=""><a href="https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.0/components/tools/OmeroPy/src/omero/plugins/sessions.py#L346" class="">https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.0/components/tools/OmeroPy/src/omero/plugins/sessions.py#L346</a></div>
<div class=""><a href="https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.0/components/tools/OmeroPy/src/omero/plugins/sessions.py#L410" class="">https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.0/components/tools/OmeroPy/src/omero/plugins/sessions.py#L410</a></div>
<div class="">This implies every property stored in the session file locally will be tested</div>
<div class="">against the new connection arguments (including omero.port and omero.group if</div>
<div class="">applicable) and throw an error on mismatch.</div>
<div class=""><br class="">
</div>
<div class="">As mentioned above, we are investigating a series of usability issues with the</div>
<div class="">session key usage for the CLI (and potentially other clients). The full scoping</div>
<div class="">for these improvements is scheduled for 5.1.2 and hopefully we will have them</div>
<div class="">implemented for 5.1.3.</div>
<div class=""><br class="">
</div>
<div class="">For your particular scenario, one idea to prevent breaking the API might be to</div>
<div class="">implement a login option to disable strict property checking while logging in</div>
<div class="">using a session key. Any thoughts?</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
Sebastien
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 8 Apr 2015, at 09:15, Paul van Schayck <<a href="mailto:paul@vanschayck.nl" class="">paul@vanschayck.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Dear developers,<br class="">
<br class="">
We are running local scripts in an OMERO.py environment on an OMERO<br class="">
server running on localhost using `OMERO.py/bin/omero script run<br class="">
path/to/script.py`. From this script we are starting the importer<br class="">
using `cli.invoke()`. For this to work we have copied jars<br class="">
`OMERO.server/lib/client` to the `OMERO.py/lib/client`. To prevent<br class="">
users from double login we are passing the session key to<br class="">
`cli.invoke()` using the `-k` argument.<br class="">
<br class="">
So far so good, and this has worked for OMERO 5.0. With OMERO 5.1 we<br class="">
have run into an issue. We suspect this has to do with the new logic<br class="">
regarding checking whether an import to a specific group/dataset is<br class="">
allowed. But the exact cause we have not pin pointed.<br class="">
<br class="">
The error we get during the script is "Bad session key". We can<br class="">
replicate this by running the import command separately. See below.<br class="">
What especially got our attention is the "conflicts:<br class="">
omero.group:dev!=None;" notice.<br class="">
<br class="">
By explicitly specifying the group "-g dev" during import this is<br class="">
fixed. But we don't think this is intended. Nor do we think that the<br class="">
"Bad session key" error is intended.<br class="">
<br class="">
Thanks,<br class="">
<br class="">
Paul van Schayck<br class="">
<br class="">
<br class="">
$ rm -r ~/omero/<br class="">
<br class="">
$ OMERO.py/bin/omero login -g dev<br class="">
Server: [localhost:4064]<br class="">
Username: [PVC]paul<br class="">
Password:<br class="">
Created session c5164797-2ae3-4367-8d73-0c51440e2a71<br class="">
(paul@localhost:4064). Idle timeout: 600.0 min. Current group: dev<br class="">
<br class="">
$ OMERO.py/bin/omero --debug=DEBUG import -k<br class="">
c5164797-2ae3-4367-8d73-0c51440e2a71 -d3611 /path/to/import<br class="">
Server: [localhost:4064]<br class="">
Skipping c5164797-2ae3-4367-8d73-0c51440e2a71 due to conflicts:<br class="">
omero.group:dev!=None;<br class="">
Bad session key<br class="">
<br class="">
$ OMERO.py/bin/omero sessions file<br class="">
/home/PVC/omero/sessions/localhost/paul/c5164797-2ae3-4367-8d73-0c51440e2a71<br class="">
<br class="">
$ cat /home/PVC/omero/sessions/localhost/paul/c5164797-2ae3-4367-8d73-0c51440e2a71<br class="">
omero.sess=c5164797-2ae3-4367-8d73-0c51440e2a71<br class="">
omero.group=dev<br class="">
omero.user=paul<br class="">
omero.host=localhost<br class="">
omero.port=4064<br class="">
<br class="">
<br class="">
$ OMERO.py/bin/omero sessions list<br class="">
Server | User | Group | Session<br class="">
| Active | Started<br class="">
----------------+------+-------+--------------------------------------+-----------+--------------------------<br class="">
localhost:4064 | paul | dev | c5164797-2ae3-4367-8d73-0c51440e2a71<br class="">
| Logged in | Wed Apr 8 10:07:32 2015<br class="">
(1 row)<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>