NNinteractive URL error

NNinteractive used to work, but with a recent nightly, I am getting this error.

Traceback (most recent call last):
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/bin/Python/slicer/util.py", line 3391, in tryWithErrorDisplay
    yield
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/slicer.org/Extensions-33625/NNInteractive/lib/Slicer-5.9/qt-scripted-modules/SlicerNNInteractive.py", line 1109, in request_to_server
    response = requests.post(*args, **kwargs)
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/lib/Python/lib/python3.9/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/lib/Python/lib/python3.9/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/lib/Python/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/lib/Python/lib/python3.9/site-packages/requests/sessions.py", line 697, in send
    adapter = self.get_adapter(url=request.url)
  File "/home/maga/Downloads/Slicer-5.9.0-2025-04-28-linux-amd64/lib/Python/lib/python3.9/site-packages/requests/sessions.py", line 792, in get_adapter
    raise InvalidSchema(f"No connection adapters were found for {url!r}")
requests.exceptions.InvalidSchema: No connection adapters were found for 'localhost:1527/upload_segment'

the docker image is running on the same computer. I have tried replacing the address with 0.0.0.0, localhost, 127.0.0.1 as well as the actual IP address. Still getting the same error. There is no output on the docker console (indicating that request reached the server).
This is on ubuntu 22.04, slicer release 33625.

Same error on using the today’s preview on my Mac, with the same server

Maybe add http:// to localhost in the url

1 Like

additionally there is a separate bug.

If you do not create a segmentation object before switching to NNInteractive, and try to set create the segmentation using the Segment Editor widget in NNInteractive, Slicer application closes with this error:

[CRITICAL][Qt] 06.05.2025 04:51:27 [] (unknown:0) - void qMRMLSegmentEditorWidget::setSourceVolumeNode(vtkMRMLNode*)  failed: need to set segment editor and segmentation nodes first

Himm, that fixed it, but do we really need to specify that?