Page MenuHomePhabricator

[XNAT] Opening XNAT session fails
Open, HighPublic

Description

Testing an XNAT session inside the XNAT-MITK plugin fails with the following error:

Connecting failed:
Invalid Server Adress
Possibly due to missing OpenSSL for HTTPS connections

However, the real error seems to be hidden somewhere else. The log output prints:

Retrieving session properties failed. {6d25a108-648b-477a-bf83-f41c4a5565db}: 203: Error transferring https://e230-xnat:443/xnat/data/version?format=json - server replied:

WARNING: In us::ServiceListeners::ServiceChanged at MITK\src\Modules\CppMicroServices\core\src\service\usServiceListeners.cpp:192 : Service listener in org_mitk_gui_qt_xnat threw an exception!

Using different ports yield different results:
8080:

Could not get a session id. {97bebf27-89c2-4900-a994-4ece4be5193e}: 2: Connection closed

WARNING: In us::ServiceListeners::ServiceChanged at MITK\src\Modules\CppMicroServices\core\src\service\usServiceListeners.cpp:192 : Service listener in org_mitk_gui_qt_xnat threw an exception!

8104:

Could not get a session id. {c6aeb38f-eb3d-4c16-9de8-a9877936a38a}: 2: Connection closed

WARNING: In us::ServiceListeners::ServiceChanged at MITK\src\Modules\CppMicroServices\core\src\service\usServiceListeners.cpp:192 : Service listener in org_mitk_gui_qt_xnat threw an exception!

Event Timeline

kalali triaged this task as High priority.Wed, May 4, 3:58 PM
kalali created this task.

The exception happens inside:

ctkXnatSessionPrivate::setSessionProperties():

QUuid uuid = xnat->get("/data/version");
QScopedPointer<qRestResult> restResult(xnat->takeResult(uuid));

Here

qRestResult* qRestAPI::takeResult(const QUuid& queryId)
{
  Q_D(qRestAPI);
  if (d->results.contains(queryId))
    {
    // Do /not/ try to .take() the query before calling waitForDone();
    // the latter triggers SIGNALs which access d->results.
    bool ok = d->results[queryId]->waitForDone();
    qRestResult* result = d->results.take(queryId);
    if (ok)
...

ok is false.

I'm not an expert with these things but I tried the following:

curl -u kalali -X POST http://e230-xnat/xnat/data/JSESSION

and got

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>

So I tried

curl -u kalali -X POST http://e230-xnat:8080/xnat/data/JSESSION

and got

C00AEDAFC9C0690397D5C56163436D1D

So I tried

curl -u kalali -X POST http://e230-xnat:8080/xnat/data/version

and got

<html>
<head>
   <title>Status page</title>
</head>
<body>
<h3>The server has not found anything matching the request URI</h3><p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

Our suspicion is that the XNAT API has changed.
However, as mentioned above the request is implemented inside ctkXnatSessionPrivate::setSessionProperties().

Nikolas Stanczyk was able to connect to XNAT using some MITK Snapshot 2021-07-02, so I tested this version as well. It does not contain the XNAT-plugin so I built MITK from source with snapshots/2021-07-02.
I was not able to successfully connect to XNAT so I asked him to meet me and have a look at his setup.

I met with Nikolas Stanczyk today and he showed me his working version of MITK, connecting to XNAT via the provided plugin. I also used my credentials and I was able to successfully login.
I copied his version to my laptop and here he was also able to login.
I just tested my credentials with this copy on my laptop and I was able to successfully login:

image.png (706×897 px, 35 KB)

One difference that I saw: Two openssl-related files were added to the MITK-directory of the working version:

  • libcrypto-1_1-x64.dll
  • libssl-1_1-x64.dll

These are the two files that are provided by Qt. I added them to my developer-MITK by setting

  • MITK_OPENSSL_CRYPTO_DLL
  • MITK_OPENSSL_SSL_DLL

Now my developer-MITK also contains these two dll's in the bin-directory, but I am still not able to connect to XNAT.

Also copying the ones from the working version to my personal developer-MITK did not work.