Kitware / visualizer

The ParaViewWeb Visualizer application which can be used standalone or as a component within another web context.
https://kitware.github.io/visualizer/
BSD 3-Clause "New" or "Revised" License
115 stars 28 forks source link

Server Disconneted and not showing anything #97

Open rasunag27 opened 3 years ago

rasunag27 commented 3 years ago

Hello, I am working with OpenFOAM Simulations with Ubuntu 16.04. I wanted to use paraview web as a visualizer.

For this, I followed this documentation to set up a paraViewWeb server instance: http://kitware.github.io/paraviewweb/docs/ubuntu_14_04.html

  1. Based on the setup, I received error when I try with "http://localhost/visualizer". As per the issue seen in Paraview web configuration issue, I created the folder directory as suggested in /opt. Still I am facing the same problem.

  2. Below are the details of my launcher.json file and the apache2 configuration file details. I have also given permission as explained in the document.

  3. Also, when I run ./start.sh, it will through an error stating permission denied although I gave permission with chmod u+x

Launcher.json file

{
    "resources": [ {"port_range": [9001, 9103], "host": "localhost"} ],
    "configuration": {
      "log_dir": "/opt/data/pvw/logs",
      "host": "localhost",
      "proxy_file": "/opt/data/proxy.txt",
      "endpoint": "paraview",
      "sessionURL": "ws://localhost:8080/proxy?sessionId=${id}&path=ws",
      "timeout": 25,
      "upload_dir": "/opt/data/pvw/upload",
      "fields": [],
      "port": 8080,
      "dataFile": "/opt/data/pvw/data/simulation_file/"
    },
    "properties": {
      "web_path": "/opt/data/pv/pv-5.6.0/share/paraview-5.6/web",
      "python_exec": "/opt/data/pv/pv-5.6.0/bin/pvpython",
      "content": "/opt/data/pv/pv-5.6.0/share/paraview-5.6/web/visualizer/www",
      "dataDir": "/opt/data/pvw/data"
    },
    "apps": {
      "visualizer": {
        "cmd": [
          "${python_exec}", 
          "-dr",
      "${web_path}/visualizer/server/pvw-visualizer.py",
          "--port", "${port}",
      "--data", "${dataDir}",
      "--load-file", "${dataFile}",  
          "--authKey", "${secret}",
      "--content", "${content}"
        ],
        "ready_line" : "Starting factory"
      }
  }
}

start.sh file

#!/bin/bash
  export DISPLAY=:0.0
  /opt/data/pv/pv-5.6.0/bin/pvpython /opt/data/pv/pv-5.6.0/lib/python2.7/site-packages/wslink/launcher.py /opt/data/pvw/conf/launcher.json &

Apache2 config file

 <VirtualHost *:80>
      ServerName   localhost
      ServerAdmin  sunag.ra@niramai.com
      DocumentRoot /opt/data/www

      ErrorLog /opt/data/logs/apache_error.log
      CustomLog /opt/data/logs/apache_access.log combined

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

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

      # Handle WebSocket forwarding
      RewriteEngine On
      RewriteMap session-to-port txt:/opt/data/proxy.txt
      RewriteCond %{QUERY_STRING} ^sessionId=(.*)&path=(.*)$ [NC]
      RewriteRule ^/proxy.*$  ws://${session-to-port:%1}/%2  [P]
    </VirtualHost>
  1. Link to screenshot of the display from the domain "http://localhost/visualizer" : Server Disconnected

  2. I do not know much about the localhost related stuff. Could you please help me out as I am completely new to this domain.

Any leads will be appriciated.

Thanks and Regards, Sunag R A.

scottwittenburg commented 3 years ago

Just glancing quickly at your configs, the sessionURL (in your launcher config) looks suspicious, try removing the :8080 as it appears you configured apache to listen on port 80 and do websocket forwarding. Also, can you share the error message you referred to when you run start.sh? That seems like it could be important.

rasunag27 commented 3 years ago

Hi Scottwittenburg,

I will check with the sessionURL. Below is the start.sh error after running it with ./start.sh

Error running "/opt/data/pv/pv-5.6.0/lib/pvpython" "/opt/data/pv/pv-5.6.0/lib/python2.7/site-packages/wslink/launcher.py" "/opt/data/pvw/conf/launcher.json": Permission denied

I have given the permission and also used sudo to run..Still the same issue..!!

Regards, Sunag R A.

rasunag27 commented 3 years ago

Hi scott,

I tried removing the :8080 from sessionURL and checked. But, I am still getting the same as server disconnected. Also, what should I do related to websocket forwarding??

Regards, Sunag R A.

rasunag27 commented 3 years ago

I changed python version to 5.7.0.!! Now, When I run ./start.sh file, I am getting this error:

DeprecationWarning: Path segment must be bytes; passing <class 'str'> has never worked, and will raise an exception in the future.

Also, in the server when I run "http://localhost/paraview", it throws an error as presented in this screenshot link: Praview_error

jourdain commented 3 years ago

Remove the upload_dir key in your config.