Error in rendering and visualization from docker image for different versions

Hi,

  1. I have pulled an osmesa version pvw image from docker hub docker pull kitware/paraviewweb:pvw-visualizer-osmesa-master. For this version, I have configured the launcher file and also the apache2 configuration file. This image contains paraview5.5 version.

  2. I worked with paraview 5.8 and 5.9 osmesa version by downloading it from paraview web and copying to docker.

Here is my launcher configuration file settings for 5.9.0 osmesa version:

{
  "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ],
  "configuration": {
    "log_dir": "/opt/wslink-launcher/log",
    "host": "localhost",
    "endpoint": "paraview",
    "sessionURL": "ws://localhost/proxy?sessionId=${id}&path=ws",
    "timeout": 25,
    "fields": ["host", "port"],
    "port": 9000,
    "proxy_file": "/opt/wslink-launcher/proxy-mapping.txt",
    "sanitize": {
      "version": {
          "type": "regexp",
          "regexp": "^v[0-9]+.[0-9]+.[0-9]+$",
          "default": "v0.0.0"
      },
      "file": {
          "type": "regexp",
          "regexp": "^[-\\w./]+$",
          "default": "emptyFile"
      }
    }
  },
  "properties": {
    "dataDir": "/data",
    "webapps_dir": "/opt/paraview/pv-5.9.0/share/paraview-5.9/web",
    "python_exec": "/opt/paraview/pv-5.9.0/bin/pvpython"
  },
  "apps": {
    "paraview-lite": {
      "cmd": [
        "${python_exec}",
        "${webapps_dir}/lite/server/pvw-lite.py",
        "--port", "${port}",
        "--data", "${dataDir}",
        "--authKey", "${secret}"
     ],
     "ready_line" : "Starting factory"
    },
 "visualizer": {
      "cmd": [
        "${python_exec}",

        "${webapps_dir}/visualizer/server/pvw-visualizer.py",
        "--port", "${port}",
        "--data", "${dataDir}",
        "--authKey", "${secret}"
      ],
      "ready_line" : "Starting factory"
    }
  }
}

Below is my apache2 conf file settings.

<VirtualHost *:80>
  ServerName   visualizer.example.com
  ServerAdmin  youremail@example.com
  DocumentRoot /var/www/html
  ErrorLog /var/log/apache2/001-pvw_error.log
  CustomLog /var/log/apache2/001-pvw_access.log combined

  <Directory /var/www/html>
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
      AllowOverride None
      Require all granted
  </Directory>

  Alias "/visualizer" "/opt/paraview/pv-5.9.0/share/paraview-5.9/web/visualizer/www"

  <Directory /opt/paraview/pv-5.9.0/share/paraview-5.9/web/visualizer/www>
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
      AllowOverride None
      Require all granted
    </Directory>


  Alias "/lite" "/opt/paraview/pv-5.9.0/share/paraview-5.9/web/lite/www"

  <Directory /opt/paraview/pv-5.9.0/share/paraview-5.9/web/lite/www>
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
      AllowOverride None
      Require all granted
    </Directory>
  # APPLICATION-ENDPOINTS

  # Handle launcher forwarding
  ProxyPass /paraview http://localhost:9000/paraview

 # Handle WebSocket forwarding
  RewriteEngine On
  RewriteMap session-to-port txt:/opt/wslink-launcher/proxy-mapping.txt
  RewriteCond %{QUERY_STRING} ^sessionId=(.*)&path=(.*)$ [NC]
  RewriteRule ^/proxy.*$  ws://${session-to-port:%1}/%2  [P]
</VirtualHost>

  1. When I launch the webserver with http://localhost:9000/visualizer for visualizer and http://localhost:9000/lite, I get Server Disconnected for visualizer with websocker error and for paraview lite, I get connection error. I am able to get the unique session id for proxy-mapping.txt and also able to capture log in launcherlog.log as
2021-11-05 10:18:07,066:INFO:twisted:Site starting on 9000
2021-11-05 10:18:07,066:INFO:twisted:Starting factory <twisted.web.server.Site object at 0x7fa756960b10>
  1. Even in 001-pvw_access.log, I get the response as:
172.17.0.1 - - [05/Nov/2021:09:39:09 +0000] "GET /lite/js/app.6bfdd6b0.js.map HTTP/1.1" 200 87603 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36"
172.17.0.1 - - [05/Nov/2021:09:39:09 +0000] "GET /lite/js/chunk-vendors.455b9032.js.map HTTP/1.1" 200 1041872 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36"
172.17.0.1 - - [05/Nov/2021:09:39:11 +0000] "POST /paraview/ HTTP/1.1" 200 392 "http://localhost:9000/lite/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36"
172.17.0.1 - - [05/Nov/2021:09:40:23 +0000] "POST /paraview/ HTTP/1.1" 200 393 "http://localhost:9000/visualizer/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36"
172.17.0.1 - - [05/Nov/2021:10:09:21 +0000] "POST /paraview/ HTTP/1.1" 200 392 "http://localhost:9000/visualizer/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36"
  1. For version 5.8.0, it doesn’t work and throws an error in the log as:
Traceback (most recent call last):
  File "/opt/paraview/pv-5.8.0/share/paraview-5.8/web/lite/server/lite_protocols.py", line 13, in <module>
    from vtkmodules.vtkPVClientServerCoreRendering import vtkPVRenderView
ModuleNotFoundError: No module named 'vtkmodules.vtkPVClientServerCoreRendering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/paraview/pv-5.8.0/share/paraview-5.8/web/lite/server/pvw-lite.py", line 94, in <module>
    import lite_protocols as local_protocols
  File "/opt/paraview/pv-5.8.0/share/paraview-5.8/web/lite/server/lite_protocols.py", line 16, in <module>
    from paraview.modules.vtkPVClientServerCoreRendering import vtkPVRenderView
ModuleNotFoundError: No module named 'paraview.modules.vtkPVClientServerCoreRendering'
Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion `map->l_init_called' failed!
  1. My question is, I am unable to see the visualization from whichever verison I take say 5.5, 5.8 or 5.9 version of osmesa along with either lite or visualizer.

  2. I am working on this from past 2 weeks and unable to get the visualization running in the server. What mistake is present in either of the files? I am used docker image of pvw and configured it according to my needs. Need some support.

Regards,
Sunag R A.

Hi,

Update from previous message

  1. I have read this documentation docker paraview web and ran the docker container as below for paraview5.6 version.
  2. <APP_ROOT> = /pvw
  3. I am getting the error as “Web socket error” where the image is posted in websocket_error

run.sh file

#!/bin/bash
export PORT=9000
export DATA=/home/Sunag/pvw/data
export DEPLOY=/home/Sunag/pvw
export SERVER_NAME=localhost:80
export PROTOCOL=ws

sudo docker run --name model_osmesa \
	-p 0.0.0.0:${PORT}:80	\
	-v ${DATA}:/data	\
	-v ${DEPLOY}:/pvw	\
	-e "SERVER_NAME=${SERVER_NAME}"\
	-e "PROTOCOL=${PROTOCOL}"\
	-ti kitware/paraviewweb:pvw-v5.6.0-osmesa

My config.json file is as follows:

{
  "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ],
  "sessionData": {
    "updir": "/Home"
   },
  "configuration": {
    "log_dir": "/pvw/launcher/log",
    "host": "localhost",
    "endpoint": "paraview",
    "sessionURL": "SESSION_URL_ROOT/proxy?sessionId=${id}&path=ws",
    "timeout": 60,
    "upload_dir":"/data/upload",
    "fields": [],
    "port": 9000,
    "proxy_file": "/opt/launcher/proxy-mapping.txt",
    "sanitize": {
      "version": {
          "type": "regexp",
          "regexp": "^v[0-9]+.[0-9]+.[0-9]+$",
          "default": "v0.0.0"
      },
      "file": {
          "type": "regexp",
          "regexp": "^[-\\\\w./]+$",
          "default": "emptyFile"
      }
    }
  },
  "properties": {
    "dataDir": "/data",
    "webapps_dir": "/opt/paraview/share/paraview-5.6/web",
    "python_exec": "/opt/paraview/bin/pvpython"
  },
  "apps": {
    "visualizer": {
      "cmd": [
        "${python_exec}",
        EXTRA_PVPYTHON_ARGS
        "${webapps_dir}/visualizer/server/pvw-visualizer.py",
        "--port", "${port}",
        "--data", "${dataDir}",
        "--authKey", "${secret}"
      ],
      "ready_line" : "Starting factory"
    }
  }
}

My endpoints.txt is as follows. Testing only for visualizer as of now.

visualizer /opt/paraview/share/paraview-5.6/web/visualizer/www
DOCUMENT-ROOT-DIRECTORY /pvw/www/
  1. When I got onto “http://localhost:9000/visualizer”, I get the same error as shown in the below link:
    websocket_error

  2. I looked into this issue #523 and worked towards the config file and rest.

  3. I am getting the unique id in proxy and logs are obtained as same as presented in the previous message.

  4. What is wrong in my files and what work around needs to be done? Any suggestions will be helpful.

Regards,
Sunag R A.

Following the link in your #4 websocket_error, I see a recommendation to use a different docker image. Minified reaction error #31 and websocket connection error · Issue #534 · Kitware/paraviewweb · GitHub

Does the error go away when you replace this line

With the recommended image?

Instead of

Should this be the following if your docker listen on port 9000
export SERVER_NAME=localhost:9000

Dear Sebastian,

Thank you for the reply. It was dumb of me by not connecting the dots. Now the things are working.

But, I am having error while loading the “.pvsm” file.

  1. The files in pvw contains both vtk and pvsm files.
  2. When I load vtk first it displays the result. But when I load “.pvsm”, I get error and when I move back to “.vtk” after pvsm, I get another errror.

Below is the error when “.pvsm” is clicked.

Below is the error when “.vtk” is clicked after “.pvsm” is clicked.

  1. How to load pvsm file without these errors? Also, when the pvw is ran without docker, I noticed that pvsm file will run only when its corresponding vtk file is present, is that correct?

  2. Now when the file is rendered, it goes to paraview default color palette, how to change the color palette from the “osmesa” version of paraview.?

Thanks and Regards,
Sunag R A.

  1. You pvsm needs to have valid path for your vtk file. This is especially true since the path in docker will be different than the one on your host machine. You may need to patch the pvsm to fix paths. PV 5.10 has some option to fix path via extra args on the load call.

  2. If you solved it before, you can use your technic to do the same. Just mount your app and use your files instead of the one bundled in pv. No need to create a new docker for that.

Hi,

  1. I will look into pv 5.10 and get back with regards to pvsm file.

  2. For this, I dint completely understand your statement of mounting the app.

Actually, without docker, the pvw was tested with the url where the paraview mount was rc version, where I could open paraview offline (using bin → paraview executable), and then change the color palette, later in url it showed the set color palette.

Since, there is no paraview executable in osmesa version, should I copy related files from rc version to osmesa version?

Is my understanding of point 4 from your reply correct?

Regards,

Sunag R A.

  1. Was about this which is mentioned in the doc that your read here and more specifically the line -v ${DEPLOY}:/pvw

Hi Jourdain,

I was working on the pvsm file and as you mentioned the data path related to local system and docker, for just to check whether it works via docker, I manually changed the path for the pvsm to where the vtk file is presented inside docker.

But I am still unable to visualize the file.

Below are the path changes for pvsm file.

Before: This has the vtk file path of local directory

<Proxy group="sources" type="LegacyVTKFileReader" id="8883" servers="1">
      <Property name="FileNameInfo" id="8883.FileNameInfo" number_of_elements="1">
        <Element index="0" value="/home/data/138344/138344_left.vtk"/>
      </Property>
      <Property name="FileNames" id="8883.FileNames" number_of_elements="1">
        <Element index="0" value="/home/data/138344/138344_left.vtk"/>
        <Domain name="files" id="8883.FileNames.files"/>

After: This has the vtk file path inside docker.

<Proxy group="sources" type="LegacyVTKFileReader" id="8883" servers="1">
      <Property name="FileNameInfo" id="8883.FileNameInfo" number_of_elements="1">
        <Element index="0" value="/data/138344/138344_left.vtk"/>
      </Property>
      <Property name="FileNames" id="8883.FileNames" number_of_elements="1">
        <Element index="0" value="/data/138344/138344_left.vtk"/>
        <Domain name="files" id="8883.FileNames.files"/>
  1. Is only addressing the correct file path to vtk file inside pvsm file enough? Since that is not rendering the visualization . If there are any other changes that need to be done, any suggestions would be helpful.

  2. If for recommendation, I need to use pv 5.10, I really need the understanding on the “extra args on the load call” as mentioned.

Regards,
Sunag R A.

I have a fully working load-state application using trame here