voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.32k stars 497 forks source link

Voila Error with pm2 on Ubuntu 22.04 #1409

Open christianp8 opened 8 months ago

christianp8 commented 8 months ago

hello i need help i want to deploy Voila, to fix this error using pm2 on Ubuntu 22.04

0|AnalyticEngine | /var/www/html/Voila_Home/AnalyticEngine.ipynb:2 0|AnalyticEngine | "cells": [ 0|AnalyticEngine | ^ 0|AnalyticEngine | SyntaxError: Unexpected token : 0|AnalyticEngine | at createScript (vm.js:80:10) 0|AnalyticEngine | at Object.runInThisContext (vm.js:139:10) 0|AnalyticEngine | at Module._compile (module.js:616:28) 0|AnalyticEngine | at Object.Module._extensions..js (module.js:663:10) 0|AnalyticEngine | at Module.load (module.js:565:32) 0|AnalyticEngine | at tryModuleLoad (module.js:505:12) 0|AnalyticEngine | at Function.Module._load (module.js:497:3) 0|AnalyticEngine | at Object. (/usr/local/lib/node_modules/pm2/lib/ProcessContainerForkLegacy.js:28:21) 0|AnalyticEngine | at Module._compile (module.js:652:30) 0|AnalyticEngine | at Object.Module._extensions..js (module.js:663:10)

voila.json: { "VoilaConfiguration": {

Activate or deactivate preheat kernel option.

  "preheat_kernel": true

}, "VoilaKernelManager": {

A list of notebook name or regex patterns to exclude notebooks from using preheat kernel.

  "preheat_denylist": [
   ],
     # Setting for `AnalyticEngine.ipynb` notebook
     "AnalyticEngine.ipynb": {
        "pool_size": 5, # Size of pool
      },
  },
  # Delay time in second before filling the kernel pool.
  "fill_delay": 0

} }

pm2 with ecosystem.config.js: module.exports = { apps: [ { name: "voila-app-Home", script: "/opt/miniconda/envs/project3/bin/voila", args: ["--preheat_kernel=True", "--pool_size=5", "--no-browser", "/var/www/html/Voila_Home/AnalyticEngine.ipynb", "--template", "vuetify-default","--Voila.base_url=/Voila/"], interpreter: "/opt/miniconda/envs/project3/bin/python", autorestart: true, watch: true, max_memory_restart: "1G", instances: 1, env: { Voila_config_file_whitelist: "/var/www/html/Voila_Home/" } }, ], };

thanks

ggogate commented 8 months ago

Probably issue with the ipynb itself? 0|AnalyticEngine | "cells": [ 0|AnalyticEngine | ^ 0|AnalyticEngine | SyntaxError: Unexpected token :

  1. Can you create a new simple notebook and see if it works?
  2. Open the /var/www/html/Voila_Home/AnalyticEngine.ipynb notebook using text editor and check if there's an issue with the Json?
  3. Check if you can deploy without the vuetify template to see if the issue maybe with the template?
trungleduc commented 8 months ago

The js error stack is coming from pm2 and not voila.