Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket Error Installing Superset behind Proxy #18615

Closed
3 tasks done
gk1089 opened this issue Feb 8, 2022 · 9 comments
Closed
3 tasks done

Websocket Error Installing Superset behind Proxy #18615

gk1089 opened this issue Feb 8, 2022 · 9 comments
Labels
#bug Bug report

Comments

@gk1089
Copy link

gk1089 commented Feb 8, 2022

A clear and concise description of what the bug is.
I am trying to install Superset for building custom visualization using the guide at: https://superset.apache.org/docs/installation/building-custom-viz-plugins/

Please note that I am attempting it on Ubuntu 20.04 VMs behind a proxy. I am able to install Superset properly in python venv using the guide available at https://superset.apache.org/docs/installation/installing-superset-from-scratch/

However, for tinkering with custom visualizations, I need to go the docker-compose way which is causing me issues as it gives me "superset-websocket Error".

How to reproduce the bug

  1. Clone Superset repository
  2. cd superset
  3. docker-compose up

Expected results

Successful installation of Apache Superset

Actual results

All modules of superset docker get pulled and install other than the error "superset-websocket Error" with the detail:

docker-compose up

WARN[0000] The "CYPRESS_CONFIG" variable is not set. Defaulting to a blank string.
WARN[0000] The "CYPRESS_CONFIG" variable is not set. Defaulting to a blank string.
[+] Running 61/62
⠿ db Pulled 1564.7s
⠿ 1cb79db8a9e7 Pull complete 1455.6s
⠿ f6bae7873dd7 Pull complete 1463.5s
⠿ 8f7722dc50a7 Pull complete 1463.6s
⠿ e8622b8cb6f3 Pull complete 1463.8s
⠿ d6d74bba3a57 Pull complete 1468.9s
⠿ 874d4d2a09fd Pull complete 1469.1s
⠿ 2d87c3a4038c Pull complete 1469.2s
⠿ c63ad59a7dc5 Pull complete 1470.8s
⠿ e552f8007751 Pull complete 1559.6s
⠿ 2ebc2d1bc399 Pull complete 1559.7s
⠿ eed0e00d10e2 Pull complete 1559.8s
⠿ f7e2065268c3 Pull complete 1559.9s
⠿ 42c532a1b382 Pull complete 1560.0s
⠿ 55f90792e411 Pull complete 1560.1s
⠿ superset-worker Pulled 1714.8s
⠿ 0c6b8ff8c37e Pull complete 124.8s
⠿ 808edda3c2e8 Pull complete 482.3s
⠿ 724cfd2dc19b Pull complete 482.9s
⠿ 3ded81a913fd Pull complete 484.3s
⠿ 84cb46b52cd5 Pull complete 504.7s
⠿ 768786b22fa1 Pull complete 510.4s
⠿ superset Pulled 1714.8s
⠿ e10a0947741b Pull complete 496.6s
⠿ bd38be1964e0 Pull complete 504.8s
⠿ 0d207d2e485a Pull complete 510.1s
⠿ 84539793f3e4 Pull complete 510.4s
⠿ 377abe2b4d6b Pull complete 1457.3s
⠿ 362dff1263ee Pull complete 1710.4s
superset-websocket Error 5.7s
⠿ superset-tests-worker Pulled 1714.8s
⠿ 08bbfb2bdff7 Pull complete 483.9s
⠿ 80e4f96446ed Pull complete 484.5s
⠿ superset-init Pulled 1714.8s
⠿ 97883a2e318e Pull complete 483.8s
⠿ 90ceaf45c29a Pull complete 496.5s
⠿ 015510788ab3 Pull complete 510.3s
⠿ superset-node Pulled 2030.5s
⠿ a024302f8a01 Pull complete 1674.8s
⠿ 289773030fdc Pull complete 1675.3s
⠿ 81bb8b3399fe Pull complete 1675.8s
⠿ 9c63da771697 Pull complete 1730.6s
⠿ bcf1b23b1e4b Pull complete 2020.9s
⠿ 53a5e10666cb Pull complete 2022.8s
⠿ 32143206e3f8 Pull complete 2025.0s
⠿ 72ad9aab2e11 Pull complete 2025.2s
⠿ 18175fdf07cd Pull complete 2025.3s
⠿ superset-worker-beat Pulled 1714.8s
⠿ 412caad352a3 Pull complete 125.3s
⠿ e6d3e61f7a50 Pull complete 125.9s
⠿ 461bb1d8c517 Pull complete 136.5s
⠿ c3bc737088c4 Pull complete 500.5s
⠿ 6043aa974c7e Pull complete 504.2s
⠿ 33f3ff63f76d Pull complete 1457.8s
⠿ c5c5abca9443 Pull complete 1709.4s
⠿ redis Pulled 1578.7s
⠿ 5eb5b503b376 Pull complete 1557.6s
⠿ 6530a7ea3479 Pull complete 1559.4s
⠿ 91f5202c6d9b Pull complete 1560.1s
⠿ 9f1ac212e389 Pull complete 1573.8s
⠿ 82c311187b72 Pull complete 1573.8s
⠿ da84aa65ce64 Pull complete 1573.9s
Sending build context to Docker daemon 142.3kB
Step 1/6 : FROM node:16
---> 304de6a23023
Step 2/6 : WORKDIR /home/superset-websocket
---> Running in 420f1795e7e3
Removing intermediate container 420f1795e7e3
---> 2c58f94c2a6d
Step 3/6 : COPY . .
---> e996314e9062
Step 4/6 : RUN npm ci
---> Running in 733781fff8ec
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'superset-websocket@0.0.1',
npm WARN EBADENGINE required: { node: '^16.9.1', npm: '^7.5.4' },
npm WARN EBADENGINE current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
^Ccanceled

I found the issue #16432 and commented out the lines corresponding to websocket in the docker-compose.yml in the hopes of getting it to run, but it did not help.

docker-compose up

WARN[0000] The "CYPRESS_CONFIG" variable is not set. Defaulting to a blank string.
[+] Running 12/12
⠿ Network superset-master_default Created 0.1s
⠿ Volume "superset-master_superset_home" Created 0.0s
⠿ Volume "superset-master_redis" Created 0.0s
⠿ Volume "superset-master_db_home" Created 0.0s
⠿ Container superset_db Created 0.3s
⠿ Container superset_cache Created 0.3s
⠿ Container superset_init Created 1.0s
⠿ Container superset_node Created 1.0s
⠿ Container superset_worker Created 1.0s
⠿ Container superset_worker_beat Created 1.0s
⠿ Container superset_tests_worker Created 1.0s
⠿ Container superset_app Created 1.0s
Attaching to superset_app, superset_cache, superset_db, superset_init, superset_node, superset_tests_worker, superset_worker, superset_worker_beat
superset_cache | 1:C 08 Feb 2022 07:40:29.761 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
superset_cache | 1:C 08 Feb 2022 07:40:29.761 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
superset_cache | 1:C 08 Feb 2022 07:40:29.761 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
superset_cache | 1:M 08 Feb 2022 07:40:29.762 * monotonic clock: POSIX clock_gettime
superset_cache | 1:M 08 Feb 2022 07:40:29.766 * Running mode=standalone, port=6379.
superset_cache | 1:M 08 Feb 2022 07:40:29.767 # Server initialized
superset_cache | 1:M 08 Feb 2022 07:40:29.767 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
superset_cache | 1:M 08 Feb 2022 07:40:29.767 * Ready to accept connections
superset_db | The files belonging to this database system will be owned by user "postgres".
superset_db | This user must also own the server process.
superset_db |
superset_db | The database cluster will be initialized with locale "en_US.utf8".
superset_db | The default database encoding has accordingly been set to "UTF8".
superset_db | The default text search configuration will be set to "english".
superset_db |
superset_db | Data page checksums are disabled.
superset_db |
superset_db | fixing permissions on existing directory /var/lib/postgresql/data ... ok
superset_db | creating subdirectories ... ok
superset_db | selecting default max_connections ... 100
superset_db | selecting default shared_buffers ... 128MB
superset_db | selecting default timezone ... Etc/UTC
superset_db | selecting dynamic shared memory implementation ... posix
superset_db | creating configuration files ... ok
superset_db | running bootstrap script ... ok
superset_db | performing post-bootstrap initialization ... ok
superset_db | syncing data to disk ... ok
superset_db |
superset_db | Success. You can now start the database server using:
superset_db |
superset_db | pg_ctl -D /var/lib/postgresql/data -l logfile start
superset_db |
superset_db |
superset_db | WARNING: enabling "trust" authentication for local connections
superset_db | You can change this by editing pg_hba.conf or using the option -A, or
superset_db | --auth-local and --auth-host, the next time you run initdb.
superset_db | waiting for server to start....2022-02-08 07:40:32.964 UTC [47] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
superset_db | 2022-02-08 07:40:33.016 UTC [48] LOG: database system was shut down at 2022-02-08 07:40:30 UTC
superset_db | 2022-02-08 07:40:33.021 UTC [47] LOG: database system is ready to accept connections
superset_db | done
superset_db | server started
superset_node | /app/docker/docker-frontend.sh:2
superset_node | #
superset_node | ^
superset_node |
superset_node | SyntaxError: Invalid or unexpected token
superset_node | at Object.compileFunction (node:vm:352:18)
superset_node | at wrapSafe (node:internal/modules/cjs/loader:1031:15)
superset_node | at Module._compile (node:internal/modules/cjs/loader:1065:27)
superset_node | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
superset_node | at Module.load (node:internal/modules/cjs/loader:981:32)
superset_node | at Function.Module._load (node:internal/modules/cjs/loader:822:12)
superset_node | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
superset_node | at node:internal/main/run_main_module:17:47
superset_node exited with code 1
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/app/docker/docker-bootstrap.sh": permission denied: unknown

I also tried installing the required versions of node (v16.9.1) and npm (v7.5.4) on the VM but that did not help.

Screenshots

If applicable, add screenshots to help explain your problem.
Error logs mentioned above.

Environment

OS: Ubuntu Server 20.04
Python on VM: 3.8.10
node on VM: 16.9.1
npm on VM: 7.5.4

  • browser type and version: Not required so far.
  • superset version: attempted with both the default cloning of superset as well as the master build.
  • python version: installed on VM 3.8.10
  • node.js version: node -v as installed on VM 16.9.1
  • any feature flags active: Only attempted default install so far

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.
Since I have a working instance of Superset using the instructions at the 'installing from scratch page' that ends up with a installation in python venv, I was wondering if there is a way to tinker with that to create custom visualizations.

Cheers!

@gk1089 gk1089 added the #bug Bug report label Feb 8, 2022
@gk1089
Copy link
Author

gk1089 commented Feb 8, 2022

I began with a fresh Ubuntu 20.04 VM, installed the default node (v10.19.0), npm (6.14.4) that is provided by Ubuntu apt repository as well as the default docker, docker compose. I am still getting the exact same error.

This means there is a mismatch between the requirements and installed versions of node and npm, at least in the websocket section in the current version of superset. However, I do not know how I can go about resolving it.

I shall next be trying to install some old version of Superset by the same method and see if it works.

Waiting for help!

@jasonscalia
Copy link

I ran into this on macOS 12.2.1 and resolved it by setting the file as executable with chmod +x.

@gk1089
Copy link
Author

gk1089 commented Feb 13, 2022

I am still stuck. I realized that most of my issues are due to being behind a proxy since I still don't know how I can change the proxy settings for npm to make npm work inside of a docker container.

So today I am trying to set a dev server in a VM on my laptop directly connected to the internet without the proxy issues. I will still need to figure stuff out to make it work for the office environment behind proxy for long term.

Anyway, even without the proxy, I am getting stuck at the npm run dev-server command while the docker-compose up is merrily running its loop.

10% building 0/1 entries 0/0 dependencies 0/0 modules[webpack-cli] /home/rrscw/superset/superset-frontend/node_module s/webpack-dev-server/lib/servers/WebsocketServer.js:10
static heartbeatInterval = 1000;
^

SyntaxError: Unexpected token =
at new Script (vm.js:83:7)
at NativeCompileCache._moduleCompile (/home/rrscw/superset/superset-frontend/node_modules/v8-compile-cache/v8-com pile-cache.js:240:18)
at Module._compile (/home/rrscw/superset/superset-frontend/node_modules/v8-compile-cache/v8-compile-cache.js:184: 36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (/home/rrscw/superset/superset-frontend/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Server.getServerTransport (/home/rrscw/superset/superset-frontend/node_modules/webpack-dev-server/lib/Server.j s:1009:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! superset@0.0.0-dev dev-server: cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_si ze=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the superset@0.0.0-dev dev-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-13T06_48_45_404Z-debug.log
root@rrscw:/home/rrscw/superset/superset-frontend# node /root/.npm/_logs/2022-02-13T06_48_45_404Z-debug.log

The log file says:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev-server' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ 'predev-server', 'dev-server', 'postdev-server' ]
5 info lifecycle superset@0.0.0-devpredev-server: superset@0.0.0-dev
6 info lifecycle superset@0.0.0-dev
dev-server: superset@0.0.0-dev
7 verbose lifecycle superset@0.0.0-devdev-server: unsafe-perm in lifecycle true
8 verbose lifecycle superset@0.0.0-dev
dev-server: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/rrscw/superset/superset-frontend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/g>
9 verbose lifecycle superset@0.0.0-devdev-server: CWD: /home/rrscw/superset/superset-frontend
10 silly lifecycle superset@0.0.0-dev
dev-server: Args: [ '-c',
10 silly lifecycle 'cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development' ]
11 silly lifecycle superset@0.0.0-devdev-server: Returned: code: 2 signal: null
12 info lifecycle superset@0.0.0-dev
dev-server: Failed to exec dev-server script
13 verbose stack Error: superset@0.0.0-dev dev-server: cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid superset@0.0.0-dev
15 verbose cwd /home/rrscw/superset/superset-frontend
16 verbose Linux 5.4.0-99-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev-server"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 2
22 error superset@0.0.0-dev dev-server: cross-env NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development
22 error Exit status 2
23 error Failed at the superset@0.0.0-dev dev-server script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

I have no clue what is going on at this point.

Help!

@FlyingHavoc
Copy link

Have you been able to resolve this issue?
The docker build command simply is not working... I wonder if this was ever tested with the current version.

@stale
Copy link

stale bot commented Apr 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 30, 2022
@MichaelTiemannOSC
Copy link

I ran into this on macOS 12.2.1 and resolved it by setting the file as executable with chmod +x.

Setting what file executable?

@stale stale bot removed the inactive Inactive for >= 30 days label May 6, 2022
@jasonscalia
Copy link

Setting what file executable?

From what I recall, /app/docker/docker-bootstrap.sh. That being said, I just did a fresh pull and am not running into any issues.

This was in reference to the following line in the initial error report:

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/app/docker/docker-bootstrap.sh": permission denied: unknown

@Lubyam
Copy link

Lubyam commented May 8, 2022

same error

@rusackas
Copy link
Member

rusackas commented Feb 6, 2024

Closing this as stale since it's been silent for so long, and we're trying to steer toward a more actionable Issues backlog. If people are still encountering this in current versions (currently 3.x) please open a new Issue or a PR to address the problem.

@rusackas rusackas closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

6 participants