In client / server mode, the paraview client does not respond after pvpython completes data operation

In client / server mode, the paraview client does not respond after pvpython completes data operation
Command to start pvserver:

pvserver.exe  --multi-clients

the information of pvserver.exe


Paraview GUI connects to pvserver first

Then, pvpython connects to the server, reads the VTM file and displays it

When pvpython completes the data operation and exits, use the mouse to operate the paraview GUI, and paraview does not respond

please try with ParaView 5.10.0

FYI @timothee.chabat @nicolas.vuaille

Works fine for me on Linux. A few things to try :

  • instead of reading a file try creating a simple sphere or cone or really any builtin source.
  • try opening the vtm from the GUI to double check your file is not corrupted
  • try running
collaboration_manager = servermanager.ActiveConnection.Session.GetCollaborationManager()
collaboration_manager.PromoteToMaster(collaboration_manager.GetUserId())

before opening the file in the python client.

Also note that the --multi-clients option has been deprecated and there is no active development and testing for this feature.

There is no problem when starting pvserver locally(pvserver ip:127.0.0.1). There is only a problem when starting pvserver on another computer(ip:192.168.20.60) in the LAN

According to my business requirements, python automatically loads and displays VTu and VTM files, and after pvpython exits, use the paraview GUI to view the adjustment results.

–Multi clients is described in detail on paraview’s official website:6. Remote and parallel visualization — ParaView Documentation 5.10.0 documentation
6.2.4. Managing multiple clients

You’re right, sadly documentation is not up to date : --multi-client option has been deprecated since ParaView 5.8.

What I would try either way :

from paraview.simple import *

Connect([...])
collaboration_manager = servermanager.ActiveConnection.Session.GetCollaborationManager()
collaboration_manager.UpdateUserInformations()
collaboration_manager.PromoteToMaster(collaboration_manager.GetUserId())
collaboration_manager.UpdateUserInformations()

# Read your file ..
# [...]

collaboration_manager.PromoteToMaster(pvid)
# where pvid is the user id of your GUI (likely 1 if the GUI is the first to connect)
collaboration_manager.UpdateUserInformations()

Also :

  • does creating a sphere (instead of reading your file) with the server on another computer also softlock ?
  • does your file live on client side or server side ?

Definitely. wdyt @utkarsh.ayachit @cory.quammen ?

Are you asking if we should remove that from the documentation or revive multi-client support?

We should remove it from doc.

my file live on server side

Please test the 2 other scenarios I described in my previous message.

@sofeiya2021 Is the other computer also running Windows?

Changes were made in Paraview 5.10.0 with respect to the client/server stream encoding for the remote server manager. Now Windows, Linux and Mac all use utf8 encoding. I don’t know if this is related to the current issue, but it would be sensible to eliminate that possibility by testing against Paraview 5.10 which has just been officially released.

yes,both computers running windows

my test is as follows:
1.First, on the first computer, double-click pvserver.exe
2.Start paraview on the second computer and connect to pvserver


3.run my python script test.py,
test.py:

from paraview.simple import *
Connect("192.168.20.60")
cone = Cone()
#shrinkFilter = Shrink(cone)
#Show(cone)
#Render()
collaboration_manager = servermanager.ActiveConnection.Session.GetCollaborationManager()
print("{0}".format(collaboration_manager.GetUserId()))
collaboration_manager.PromoteToMaster(collaboration_manager.GetUserId())

when run the test.py report errors:

  25.105s) [paraview        ]          vtkSocket.cxx:447    ERR| vtkClientSocket (00000226AE5878E0): Socket error in call to connect. �������ӷ���һ��ʱ���û����ȷ�𸴻����ӵ�����û�з�Ӧ�����ӳ���ʧ�ܡ�
.
(  25.315s) [paraview        ]    vtkClientSocket.cxx:51     ERR| vtkClientSocket (00000226AE5878E0): Failed to connect to server 192.168.20.60:11111
(  25.318s) [paraview        ]vtkTCPNetworkAccessMana:396   WARN| vtkTCPNetworkAccessManager (00000226AACFDDE0): Connect failed. Retrying for 38.724 more seconds.
(  47.367s) [paraview        ]          vtkSocket.cxx:447    ERR| vtkClientSocket (00000226AE5878E0): Socket error in call to connect. �������ӷ���һ��ʱ���û����ȷ�𸴻����ӵ�����û�з�Ӧ�����ӳ���ʧ�ܡ�
.
(  47.376s) [paraview        ]    vtkClientSocket.cxx:51     ERR| vtkClientSocket (00000226AE5878E0): Failed to connect to server 192.168.20.60:11111
(  47.380s) [paraview        ]vtkTCPNetworkAccessMana:396   WARN| vtkTCPNetworkAccessManager (00000226AACFDDE0): Connect failed. Retrying for 16.661 more seconds.
(  69.450s) [paraview        ]          vtkSocket.cxx:447    ERR| vtkClientSocket (00000226AE5878E0): Socket error in call to connect. �������ӷ���һ��ʱ���û����ȷ�𸴻����ӵ�����û�з�Ӧ�����ӳ���ʧ�ܡ�
.
(  69.457s) [paraview        ]    vtkClientSocket.cxx:51     ERR| vtkClientSocket (00000226AE5878E0): Failed to connect to server 192.168.20.60:11111
(  69.460s) [paraview        ]vtkTCPNetworkAccessMana:392    ERR| vtkTCPNetworkAccessManager (00000226AACFDDE0): Connect timeout.
Traceback (most recent call last):
  File "E:/pythonProject/test.py", line 3, in <module>
    cone = Cone()
  File "C:\Program Files\ParaView 5.9.0-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\paraview\simple.py", line 2449, in CreateObject
    px = paraview._backwardscompatibilityhelper.GetProxy(module, key, no_update=True)
  File "C:\Program Files\ParaView 5.9.0-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\paraview\_backwardscompatibilityhelper.py", line 718, in GetProxy
    return module.__dict__[key](**kwargs)
  File "C:\Program Files\ParaView 5.9.0-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\paraview\servermanager.py", line 284, in __init__
    self.Initialize(None, update)
  File "C:\Program Files\ParaView 5.9.0-Windows-Python3.8-msvc2017-64bit\bin\Lib\site-packages\paraview\servermanager.py", line 2620, in aInitialize
    raise RuntimeError ('Cannot create a proxy without a session.')
RuntimeError: Cannot create a proxy without a session.

another test
1.on the first computer ,start pvserver.exe
start command

pvserver.exe  --multi-clients

2.on the second computer,start paraview GUI and connect to pvserver.exe
3. run the test.py,
test.py

from paraview.simple import *
Connect("192.168.20.60")
cone = Cone()
#shrinkFilter = Shrink(cone)
#Show(cone)
#Render()
collaboration_manager = servermanager.ActiveConnection.Session.GetCollaborationManager()
print("{0}".format(collaboration_manager.GetUserId()))
collaboration_manager.PromoteToMaster(collaboration_manager.GetUserId())

after running the test.py,Operate the paraview GUI.But the paraview GUI does not respond

Thanks for testing. First, your first test is expected to fail since you double clicked on the pvserver and did not pass the --multi-clients parameter.

pvserver.exe --multi-clients

is mandatory.

Now, please retry your second test with this script instead :

from paraview.simple import *
Connect("192.168.20.60")

collaboration_manager = servermanager.ActiveConnection.Session.GetCollaborationManager()
collaboration_manager.UpdateUserInformations()
collaboration_manager.PromoteToMaster(collaboration_manager.GetUserId())
collaboration_manager.UpdateUserInformations()

Cone()

collaboration_manager.PromoteToMaster(1)
collaboration_manager.UpdateUserInformations()

If it still doesn’t work then you can still try with ParaView 5.10 as @todoooo suggested. In my mind this is a Windows specific bug that is not likely to be resolved except if someone of the community track it down and fix it.

That said, what you could also do instead of relying on the --multi-clients feature is transfer the script to the ParaView GUI yourself through some custom sockets and execute the script directly within the GUI python shell (View -> Python Shell within the GUI). That is :

  • Create a ParaView plugin that listen to a specific port and can access the Python shell
  • Create a program that sends a python file to a specific IP:port
  • Launch the ParaView GUI you want to control with the ParaView plugin you created loaded
  • Launch the program you created to transfer the python script to your ParaView plugin

when I retry my second test with the script you give,paraview also not respond.

Then sadly this looks like a Windows specific bug … please refer to the second part of my previous message for the solutions I can think of.

What is the Windows locale setting on the server machine?