PGBI / kong-dashboard

Dashboard for managing Kong gateway
MIT License
2.18k stars 390 forks source link

kong-dashboard start failed #150

Closed MarioMei closed 6 years ago

MarioMei commented 6 years ago

Issue summary

Followed the official installation guide. the installation of kong-dashboard succeeded. [root@localhost docker]# npm install -g kong-dashboard /home/mei/Software/node-v5.11.1-linux-x64/bin/kong-dashboard -> /home/mei/Software/node-v5.11.1-linux-x64/lib/nodemodules/kong-dashboard/bin/kong-dashboard.js /home/mei/Software/node-v5.11.1-linux-x64/lib \u2514\u2500\u2500 kong-dashboard@3.1.0

while, kong-dashboard start failed: [root@localhost docker]# kong-dashboard start --port 5800 /home/mei/Software/node-v5.11.1-linux-x64/lib/node_modules/kong-dashboard/node_modules/koa/lib/application.js:61 listen(...args) { ^^^

SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:20:19) at Object. (/home/mei/Software/node-v5.11.1-linux-x64/lib/node_modules/kong-dashboard/lib/server.js:2:11) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10)

Your environment

MarioMei commented 6 years ago

Tried to use npm start (kong-dashboard version 3.1), also failed . [root@localhost kong-dashboard]# git checkout 3.0 Switched to branch '3.0' [root@localhost kong-dashboard]# git pull Already up-to-date. [root@localhost kong-dashboard]# npm install

[root@localhost kong-dashboard]# [root@localhost kong-dashboard]# npm run build

kong-dashboard@3.1.0 build /home/mei/Software/kong-dashboard gulp build

[03:07:45] Using gulpfile /home/mei/Software/kong-dashboard/gulpfile.js [03:07:45] Starting 'build_js'... [03:07:45] Starting 'build_css'... [03:07:45] Finished 'build_css' after 1.63 ms [03:07:45] Starting 'build_html'... [03:07:46] Finished 'build_html' after 1.57 ms [03:07:52] Finished 'build_js' after 6.47 s [03:07:52] Starting 'build'... [03:07:52] Finished 'build' after 8.53 \u03bcs [root@localhost kong-dashboard]# [root@localhost kong-dashboard]# npm start -- -p 5800

kong-dashboard@3.1.0 start /home/mei/Software/kong-dashboard node ./bin/kong-dashboard start "-p" "5800"

/home/mei/Software/kong-dashboard/node_modules/koa/lib/application.js:61 listen(...args) { ^^^

SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:20:19) at Object. (/home/mei/Software/kong-dashboard/lib/server.js:2:11) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10)

npm ERR! Linux 3.10.0-693.17.1.el7.x86_64 npm ERR! argv "/home/mei/Software/node-v5.11.1-linux-x64/bin/node" "/home/mei/Software/node-v5.11.1-linux-x64/bin/npm" "start" "--" "-p" "5800" npm ERR! node v5.11.1 npm ERR! npm v3.8.6 npm ERR! code ELIFECYCLE npm ERR! kong-dashboard@3.1.0 start: node ./bin/kong-dashboard start "-p" "5800" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the kong-dashboard@3.1.0 start script 'node ./bin/kong-dashboard start "-p" "5800"'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the kong-dashboard package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node ./bin/kong-dashboard start "-p" "5800" npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs kong-dashboard npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls kong-dashboard npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/mei/Software/kong-dashboard/npm-debug.log [root@localhost kong-dashboard]# npm bugs kong-dashboard You have new mail in /var/spool/mail/root [root@localhost kong-dashboard]#

MarioMei commented 6 years ago

While, if we use the old dash-board version 1.4, it can be started successfully. But the version is not what we need, also it is not fit Kong 0.12.1

[root@localhost kong-dashboard]# pwd /home/mei/Software/kong-dashboard [root@localhost kong-dashboard]# ls bin docker Dockerfile ISSUE_TEMPLATE.md LICENSE nohup.out package.json public src CONTRIBUTING.md docker-compose.yml gulpfile.js lib node_modules npm-debug.log package-lock.json README.md tests [root@localhost kong-dashboard]# git checkout 1.0 Switched to branch '1.0' [root@localhost kong-dashboard]# git pull Already up-to-date. [root@localhost kong-dashboard]# npm install

PGBI commented 6 years ago

That's because Kong Dashboard v3 isn't compatible with node 5. See the compatibility matrix in the readme file. You need at least node 6.

MarioMei commented 6 years ago

Thanks PGBI for the quick response. I will try node 6. one minor question: seems I didn't find the compatibility martrix for node in readme https://github.com/PGBI/kong-dashboard/blob/3.0/README.md. Did I miss something? appreciate it!

MarioMei commented 6 years ago

Sorry, it is my mistake. the node version is mentioned in the README file, which is required to be >=6.0. thanks!

MarioMei commented 6 years ago

Hi Pierre,

changed node version to 8.9.4 (no changes for all others). the original issue disappears now. But a new issue as below. would you please help on it? Many thanks!

[root@localhost Software]# kong-dashboard start --kong-url http://10.113.88.35:8001 --port 5800 Connecting to Kong on http://10.113.88.35:8001 ... What's on http://10.113.88.35:8001 isn't Kong

MarioMei commented 6 years ago

By the way, i've checked Kong's status, it works well. http://10.113.88.35:8001 could be accessed through IE.

[root@localhost Software]# kong health nginx.......running

Kong is healthy at /usr/local/kong [root@localhost Software]# netstat -anp|grep 8001 tcp 0 0 10.113.88.35:8001 0.0.0.0:* LISTEN 24643/nginx: master

MarioMei commented 6 years ago

After investigation, I figured out that the error was caused by the firewall that blocked the port 8001. I will configure the firewall to allow this port. No far no more questions. Thanks much for the support!