<div dir="ltr">Oh, perhaps I should've mentioned that Smuggler doesn't store usernames and passwords anywhere, they're kept in memory just for the time it takes to create an OMERO session and then discarded. also, you can configure Smuggler to use HTTPS to protect your passwords from prying eyes ;)<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 December 2017 at 20:13, Andrea Falconi <span dir="ltr"><<a href="mailto:andrea.falconi@gmail.com" target="_blank">andrea.falconi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi guys,<div><br></div><div>If running an additional service is an option, then you could try using Smuggler: </div><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px"><li style="box-sizing:border-box"><a href="http://c0c0n3.github.io/ome-smuggler/" rel="nofollow" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration-line:none" target="_blank">http://c0c0n3.github.io/ome-<wbr>smuggler/</a></li></ul><div><font color="#24292e" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><span style="font-size:16px">It comes with a JSON API that lets you create an OMERO session:</span></font></div><div><font color="#24292e" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><span style="font-size:16px"><br></span></font></div><div>* <a href="http://c0c0n3.github.io/ome-smuggler/javadoc/server/ome/smuggler/web/omero/CreateSessionRequest.html" target="_blank">http://c0c0n3.github.io/ome-<wbr>smuggler/javadoc/server/ome/<wbr>smuggler/web/omero/<wbr>CreateSessionRequest.html</a></div><div><br></div><div>You can use the same Smuggler instance to create sessions with different OMERO servers and optionally specify a session keep-alive duration. If you specify a keep-alive of D minutes/hours/etc. Smuggler will take care of pinging OMERO to keep that session alive for D minutes/hrs/etc. This may come in handy if you want to run a script multiple times with the same session key without having to worry about OMERO expiring the session between runs.</div><div><br></div><div>You can find an example of creating a session with curl in this directory:</div><div><br></div><div>* <a href="https://github.com/c0c0n3/omero-ms-queue/tree/master/components/server/src/test/scripts/http-omero" target="_blank">https://github.com/c0c0n3/<wbr>omero-ms-queue/tree/master/<wbr>components/server/src/test/<wbr>scripts/http-omero</a></div><div><br></div><div>I'll gladly provide more details if you think this is a good fit for your scenario :)</div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>/a <br></div><div><br></div><div><br></div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 15 December 2017 at 17:45, William Moore (Staff) <span dir="ltr"><<a href="mailto:W.Moore@dundee.ac.uk" target="_blank">W.Moore@dundee.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hi Eilidh,
<div><br>
</div>
<div> We are still discussing this, but one option we are exploring is to use an existing login via the JSON api in webclient that can give you a</div>
<div>session ID.</div>
<div><br>
</div>
<div>If you could go to your remote server’s /webclient/login/ page and open the browser dev-tools (right-click on the page and -> Inspect Element)</div>
<div>Then open the Console.</div>
<div>Then paste in the following command, editing the username and password to yours… (this is easier in Chrome than Firefox, since Firefox you have to type ‘allow pasting’ for security).</div>
<div><br>
</div>
<div>$.post('/api/v0/login/', {'username': ‘your_username', 'password’:'secret', 'server': 1}, data => console.log(data.eventContext.<wbr>sessionUuid));</div>
<div><br>
</div>
<div>This should give you a session ID.</div>
<div>Then you can paste this into your script UI (in Insight) and use the code sample in my previous e-mail to join a session from the script.</div>
<div><br>
</div>
<div>NB: it’s important to close this session as soon as you’ve finished with it, in case someone got hold of the session ID.</div>
<div><br>
</div>
<div>Give this a try and see if it works for you.</div>
<div><br>
</div>
<div>There’s maybe other tests, checks and gotcha’s we need to consider, so we need more discussion before </div>
<div>this workflow gets the green light for production use.</div>
<div><br>
</div>
<div>But it would be good to know if this looks viable from your point of view?</div>
<div><br>
</div>
<div> Cheers,</div>
<div><br>
</div>
<div> Will.</div><div><div class="m_-5169226947375616902h5">
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite">
<div>On 15 Dec 2017, at 15:21, William Moore (Staff) <<a href="mailto:wmoore@dundee.ac.uk" target="_blank">wmoore@dundee.ac.uk</a>> wrote:</div>
<br class="m_-5169226947375616902m_-6876808793025322027Apple-interchange-newline">
<div>
<div style="word-wrap:break-word">
Hi Eilidh,
<div><br>
</div>
<div> Unfortunately, following more discussion in the wider team, we can’t recommend the entry of passwords into script parameters.</div>
<div>You can see some of the ongoing discussion at <a href="https://github.com/openmicroscopy/openmicroscopy/pull/5598" target="_blank">https://github.com/openmicr<wbr>oscopy/openmicroscopy/pull/<wbr>5598</a> .</div>
<div><br>
</div>
<div>Fundamentally, the script service wasn’t designed to handle that level of security.</div>
<div>Everywhere we handle passwords in OMERO, we need to use a secure (encrypted) connection and ensure nothing is</div>
<div>logged, printed or stored anywhere.</div>
<div><br>
</div>
<div>We know that some DEBUG logging levels will log script parameters in OMERO.web (see above) and that OMERO.insight’s</div>
<div>connection to the server is not encrypted (except during login) and we just can’t guarantee that there aren’t other security loop-holes.</div>
<div><br>
</div>
<div>The support of a “Password” field in the script UI would give users the false impression that</div>
<div>their passwords are guaranteed to be safe, which we’d rather not do.</div>
<div><br>
</div>
<div>One suggestion was to use some other key to look-up passwords from some protected resource that was only available</div>
<div>to your script to read. Although I’m not sure whether this is viable or will scale for your use case?</div>
<div>This is included in the ongoing discussion on the PR above.</div>
<div><br>
</div>
<div>The safest way to do what you want is to use a Session key to “join” a current session on the server, although the webclient and Insight</div>
<div>don’t currently let users get hold of their session key.</div>
<div><br>
</div>
<div>If your users could use the command line to login to the remote server then you’d do something like this….</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
$ bin/omero login</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
Previous session expired for root on <a href="http://eel.openmicroscopy.org/" target="_blank">
eel.openmicroscopy.org</a>:4064</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
Server: [<a href="http://eel.openmicroscopy.org/" target="_blank">eel.openmicroscopy.org</a>:4064]</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
Username: [root]user-3</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
Password:</div>
</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
<br>
</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
<div style="margin:0px">$ bin/omero sessions key</div>
<div style="margin:0px">b2c87a07-6728-4a0b-a9a0-1444cd<wbr>d35ad7</div>
</div>
<div><br>
</div>
<div>They would then enter this key as a script parameter and you’d get a connection like this:</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
>>> from omero.gateway import BlitzGateway</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
>>> conn=BlitzGateway(host='<a href="http://eel.openmicroscopy.org/" target="_blank">eel.op<wbr>enmicroscopy.org</a>', port=4064)</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
>>> conn.connect('b2c87a07-6728-4a<wbr>0b-a9a0-1444cdd35ad7’)</div>
</div>
<div style="margin:0px;font-family:Courier;color:rgb(76,47,45);background-color:rgb(223,219,196)">
True</div>
<div><br>
</div>
<div><br>
</div>
<div>We’ll look at supporting session key in webclient but this won’t be in the next release I’m afraid.</div>
<div>So hopefully there’s some workaround you can use in the meantime.</div>
<div>Please let us know if there’s any other way we can help with this...</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div><br>
</div>
<div> Will.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite">
<div>On 11 Dec 2017, at 14:33, Eilidh Troup <<a href="mailto:e.troup@epcc.ed.ac.uk" target="_blank">e.troup@epcc.ed.ac.uk</a>> wrote:</div>
<br class="m_-5169226947375616902m_-6876808793025322027Apple-interchange-newline">
<div>
<div style="word-wrap:break-word">
<div style="word-wrap:break-word">
Thanks very much Will.
<div><br>
<div>
<blockquote type="cite">
<div>On 11 Dec 2017, at 13:37, William Moore (Staff) <<a href="mailto:W.Moore@dundee.ac.uk" target="_blank">W.Moore@dundee.ac.uk</a>> wrote:</div>
<br class="m_-5169226947375616902m_-6876808793025322027Apple-interchange-newline">
<div>
<div style="word-wrap:break-word">
Hi Eilidh,
<div><br>
</div>
<div>I’ve opened at PR for this in web: <a href="https://github.com/openmicroscopy/openmicroscopy/pull/5598" target="_blank">https://github.com/openmi<wbr>croscopy/openmicroscopy/pull/<wbr>5598</a> and Jean-Marie tells me</div>
<div>that it should also be doable in Insight, so I’ve created a card at</div>
<div><a href="https://trello.com/c/C3EqebXJ/61-script-parameter-password" target="_blank">https://trello.com/c/C3EqebXJ/<wbr>61-script-parameter-password</a></div>
<div>These are likely to be included in the next release of OMERO.</div>
<div><br>
</div>
<div>Apart from the visibility of the password in the script UI, it’s important to be aware of other places that the password</div>
<div>could be exposed to others:</div>
<div><br>
</div>
<div> - The connection between Insight and OMERO is not encrypted by default (except for the login). We’ll look at using encrypted connection when submitting script parameters containing passwords, but in the meantime there is the potential for this
data to be read.</div>
<div> - Make sure you’re not logging or printing the script params (as we do in many of our example scripts). Currently, Blitz.log and Processor.log don’t log script params but make sure you don’t log them yourself.</div>
<div> - If you’re using the webclient, you should use https to encrypt the connection between the browser and OMERO.web.</div>
<div> - Currently in webcilent, errors in the handling of script submission are not handled well (display error on page instead of displaying feedback error submission page). This shouldn’t lead to any exposure of passwords, but be careful not to submit
feedback etc that contains the password and if you think you might have done, then be sure to change your password.</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div> Will.</div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite">
<div>On 8 Dec 2017, at 11:55, Eilidh Troup <<a href="mailto:e.troup@epcc.ed.ac.uk" target="_blank">e.troup@epcc.ed.ac.uk</a>> wrote:</div>
<br class="m_-5169226947375616902m_-6876808793025322027Apple-interchange-newline">
<div>
<div style="word-wrap:break-word">
Hi Josh,
<div><br>
</div>
<div>Thanks very much. This is a screenshot from running the script in OMERO.insight. I’d like the text entered in the password to be hidden, like this *****.</div>
<div><br>
</div>
<div>Eilidh </div>
<div><br>
</div>
<div><span id="m_-5169226947375616902m_-6876808793025322027cid:881F9A84-7937-4D81-8216-A1844F3F04F5@ed.ac.uk"><PastedGraphic-2.png></span></div>
<div><br>
<div>
<blockquote type="cite">
<div>On 7 Dec 2017, at 14:39, Josh Moore <<a href="mailto:josh@glencoesoftware.com" target="_blank">josh@glencoesoftware.com</a>> wrote:</div>
<br class="m_-5169226947375616902m_-6876808793025322027Apple-interchange-newline">
<div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hi
Eilidh,</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">On
Tue, Dec 5, 2017 at 10:51 PM, Eilidh Troup <</span><a href="mailto:e.troup@epcc.ed.ac.uk" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">e.troup@epcc.ed.ac.uk</a><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">>
wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Hi Josh,<br>
<br>
Thanks for your help. I can now transfer an image from one OMERO to another<br>
: )<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Congratulations.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
I’ve put the latest version of the script at<br>
<a href="https://github.com/SynthSys/omero-user-scripts/blob/master/Export_to_other_omero.py" target="_blank">https://github.com/SynthSys/om<wbr>ero-user-scripts/blob/master/<wbr>Export_to_other_omero.py</a><br>
<br>
I’ve got more questions though:<br>
How can I find the managed repository directory? (Something like<br>
omero.managed.dir, Default: ${omero.data.dir}/ManagedRepos<wbr>itory ?)<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">In
[2]: client.sf.getConfigService().g<wbr>etConfigValue("omero.managed.d<wbr>ir")</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
How can I hide the password text entry?<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Where
are you seeing password text entry?</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
How can I get the newly created image id? It is printed to stdout as<br>
"Image:920" for example, but I don't know how to get hold of that number in<br>
my script.<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">You
can use something like:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> import
sys</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> old_stdout
= sys.stdout</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> sys.stdout
= open(temporary_file_name, "w")</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> try:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> #
do import</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> finally:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"> sys.stdout
= old_stdout</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Also, the docker script you sent didn’t quite work (don’t worry about it<br>
though, I got what I needed from your example) - I got this error when I ran<br>
the python script:<br>
<br>
bash-4.2$ python /gist/export_to_remote_omero.p<wbr>y<br>
Traceback (most recent call last):<br>
</blockquote>
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">...</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
::Glacier2::PermissionDeniedEx<wbr>ception<br>
{<br>
reason = internal server error<br>
}<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Alright.
If you'd like to investigate further, we'll need the server logs.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Thanks,<br>
Eilidh<br>
</blockquote>
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">All
the best,</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">~Josh</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
On 10 Nov 2017, at 09:22, Josh Moore <<a href="mailto:josh@glencoesoftware.com" target="_blank">josh@glencoesoftware.com</a>> wrote:<br>
<br>
Hi Elidh,<br>
<br>
On Thu, Nov 9, 2017 at 5:07 PM, Eilidh Troup <<a href="mailto:e.troup@epcc.ed.ac.uk" target="_blank">e.troup@epcc.ed.ac.uk</a>> wrote:<br>
<br>
Hi,<br>
<br>
I’ve run into a similar problem as last time.<br>
<br>
<br>
Turns out, there's a similar solution.<br>
<br>
I’ve written a script that<br>
will upload an image to a remote OMERO server, but only from the python<br>
command line, and not from within a script running in a local OMERO. As<br>
before, the script will work from the command line or from with OMERO when<br>
transferring the image to the local OMERO server. When I try to import an<br>
image on the remote server, I get the following error:<br>
<br>
...<br>
<br>
<br>
The code, and full error output are below.<br>
I’ve also put it into a different script on gist that demonstrates the error<br>
by running it from within OMERO as a script.<br>
<a href="https://gist.github.com/eilidh-t/e763dab7d4f3515cc85b0b6ddfb8d9f4" target="_blank">https://gist.github.com/eilidh<wbr>-t/e763dab7d4f3515cc85b0b6ddfb<wbr>8d9f4</a><br>
<br>
<br>
I've update your script:<br>
<a href="https://gist.github.com/joshmoore/0c2e5319d8d5ae7f79ee82e3e68b721b" target="_blank">https://gist.github.com/joshmo<wbr>ore/0c2e5319d8d5ae7f79ee82e3e6<wbr>8b721b</a><br>
<br>
The most important change is:<br>
<br>
del os.environ["ICE_CONFIG"] before importing<br>
<br>
which does the equivalent of `Ice.Config=/dev/null` but for the import<br>
process. Likely, that should be done closer to the top.<br>
<br>
Other changes include:<br>
<br>
* use ome.cli.CLI rather than calling subprocess (simplicity)<br>
* only register the script if it doesn't exist (less test mess)<br>
* pass a key to not store the root's password (security)<br>
* adding a warning about the security whole that this script could<br>
cause (security)<br>
<br>
My general workflow was:<br>
<br>
* docker-compose up -d<br>
* docker-compose exec omero1 bash<br>
* cd /opt/omero/server/OMERO.server<br>
* export PYTHONPATH=lib/python<br>
* python /gist/export_to_remote_omero.p<wbr>y<br>
<br>
If I needed to change the script, I deleted the uploaded file from<br>
lib/script/export_to_remote_om<wbr>ero.py and re-ran.<br>
<br>
Thanks for your help with this,<br>
Eilidh<br>
<br>
<br>
<br>
Let us know if that works for you.<br>
~J<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br>
<br>
<br>
The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br>
</blockquote>
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">ome-devel
mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a></div>
</blockquote>
</div>
<br>
</div>
</div>
The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div></div></div>
<br>______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy<wbr>.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.or<wbr>g.uk/mailman/listinfo/ome-deve<wbr>l</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>