Refstack UI configuration

Asked by Malleshi C N on 2015-07-30

Hello Team,

I was installing Refstack Dashboard Ref: https://github.com/stackforge/refstack/tree/master/refstack-ui

I installed nodejs and npm .. but when I was trying to start "npm start " I ended with below error.

malli@localhost:~/refstack/refstack-ui$ sudo npm start
npm ERR! Error: ENOENT, open '/home/malli/refstack/refstack-ui/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.8.0-44-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/malli/refstack/refstack-ui
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /home/malli/refstack/refstack-ui/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/malli/refstack/refstack-ui/npm-debug.log
npm ERR! not ok code 0

There is no file package.json in the path -- > '/home/malli/refstack/refstack-ui/package.json'..

am I missing any step here.. ? Please let me know.

Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
refstack Edit question
Assignee:
No assignee Edit question
Solved by:
Malleshi C N
Solved:
2015-08-05
Last query:
2015-08-05
Last reply:
2015-07-30
Catherine Diep (cdiep) said : #1

Hi, Thanks for reporting the bug ... To fix this, please run the "npm start" command in the refstack directory (not in refstack-ui) . I pushed a patch to fix the README (https://review.openstack.org/#/c/205932/). Please let me know if this works for you.

Malleshi C N (malleshicn) said : #2

Hi Catherine,

Thanks for your update.. Please find the below output when I ran npm start from refstack directory. Please look at these lines

npm ERR! Failed at the refstack-ui@0.0.1 start script 'http-server ./refstack-ui/app -a 0.0.0.0 -p 8080'.
npm ERR! This is most likely a problem with the refstack-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server ./refstack-ui/app -a 0.0.0.0 -p 8080

malli@localhost:~/refstack$ npm start

> refstack-ui@0.0.1 prestart /home/malli/refstack
> npm install

> refstack-ui@0.0.1 postinstall /home/malli/refstack
> bower install --config.interactive=false

> refstack-ui@0.0.1 start /home/malli/refstack
> http-server ./refstack-ui/app -a 0.0.0.0 -p 8080

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:905:11)
    at Server._listen2 (net.js:1043:14)
    at listen (net.js:1065:10)
    at net.js:1147:9
    at dns.js:72:18
    at process._tickCallback (node.js:448:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:935:3

npm ERR! Linux 3.8.0-44-generic
npm ERR! argv "node" "/usr/bin/npm" "start"
npm ERR! node v0.10.40
npm ERR! npm v2.13.2
npm ERR! code ELIFECYCLE
npm ERR! refstack-ui@0.0.1 start: `http-server ./refstack-ui/app -a 0.0.0.0 -p 8080`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the refstack-ui@0.0.1 start script 'http-server ./refstack-ui/app -a 0.0.0.0 -p 8080'.
npm ERR! This is most likely a problem with the refstack-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server ./refstack-ui/app -a 0.0.0.0 -p 8080
npm ERR! You can get their info via:
npm ERR! npm owner ls refstack-ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/malli/refstack/npm-debug.log

Regards,
Malleshi CN

Malleshi C N (malleshicn) said : #3

Adding some more info:

malli@localhost:~/refstack$ npm owner ls refstack-ui
npm ERR! owner ls Couldn't get owner data refstack-ui
npm ERR! Linux 3.8.0-44-generic
npm ERR! argv "node" "/usr/bin/npm" "owner" "ls" "refstack-ui"
npm ERR! node v0.10.40
npm ERR! npm v2.13.2
npm ERR! code E404

npm ERR! 404 Not Found: refstack-ui
npm ERR! 404
npm ERR! 404 'refstack-ui' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /home/malli/refstack/npm-debug.log

Paul Van Eck (pvaneck-z) said : #4

This looks like something is already using the port (8080) refstack-ui is trying to use. Wondering if changing the port in package.json to something like 8081 would work.

Malleshi C N (malleshicn) said : #5

Hi paul,

Thanks for your suggestion.

But I am unable to find package.json file in refstack or refstack-ui directory.

Why it's pointing to " refstack failed in the system , check with author" and pointing to linux kernel version as well.

Do I need to change port in refstack api server config file ?

Thanks,
Malleshi CN

Paul Van Eck (pvaneck-z) said : #6

Odd that you are having trouble finding the package.json. Should be in the root project directory, and the line where you change the port is as follows:
https://github.com/stackforge/refstack/blob/master/package.json#L25

The way the documentation instructs now, refstack-api and refstack-ui are hosted on two separate ports (8000 for api and 8080 for ui).

I'll look into improving documentation and adding alternate ways of hosting the refstack site (like using apache for example which http://refstack.net uses).

Malleshi C N (malleshicn) said : #7

Hi Paul,

Thanks for your solution.. as per your update I chnaged the port and ran npm start.. "npm start" command is working..

as per the document I xecuted #npm test .

malli@localhost:~/refstack$ npm test

> refstack-ui@0.0.1 pretest /home/malli/refstack
> npm install

> refstack-ui@0.0.1 postinstall /home/malli/refstack
> bower install --config.interactive=false

> refstack-ui@0.0.1 test /home/malli/refstack
> karma start ./refstack-ui/tests/karma.conf.js --single-run

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
INFO [launcher]: Starting browser PhantomJS
INFO [launcher]: Starting browser Chrome
ERROR [launcher]: No binary for Chrome browser on your platform.
  Please, set "CHROME_BIN" env variable.
ERROR [launcher]: Cannot start Firefox

INFO [launcher]: Trying to start Firefox again (1/2).
ERROR [launcher]: Cannot start Firefox

INFO [launcher]: Trying to start Firefox again (2/2).
ERROR [launcher]: Cannot start Firefox

ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.
INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket nvfjOOOrsB5YSn0fHg6o with id 59473160
PhantomJS 1.9.8 (Linux 0.0.0): Executed 12 of 12 SUCCESS (0 secs / 0.08 secs)
PhantomJS 1.9.8 (Linux 0.0.0): Executed 12 of 12 SUCCESS (0.01 secs / 0.08 secs)

I installed firefox using 'apt-get'. but still ended with above message

Catherine Diep (cdiep) said : #8

Hello Malleshi,

With successful execution of the "npm start" command, are you able to access your local Refstack site ? Please confirm!

Malleshi C N (malleshicn) said : #9

Hi catherine,
After executing npm start,

I am getting message server started http:// localhost:9876.

But when I try with above url in browser I am getting connection failed . I tried to use curl I can see some logs, but not getting dashboard. Unable to access dashboard

If I try npm test , getting messges mentioned in my previous comment.

Paul Van Eck (pvaneck-z) said : #10

Wouldn't worry too much about the output of npm test unless you are developing.

How is the refstack ui hosted? On an Ubuntu VM? I'm thinking maybe you are using a web browser outside of the VM if that is the case since it seems that curling the address on the server yields you the raw html page. So instead of localhost, you'd have to use the actual IP of the server. Try navigating to to http://<your ip>:9876 and see if something comes up.

Malleshi C N (malleshicn) said : #11

Hi Catherine and Paul.

I am successfully able to get the Refstack dasgboard. it looks simillar to http://refstack.net.

Instaead of http://<your ip>:9876 I checked with Ip from which I started my server ( npm start) .

http://<your ip>:8089.

Need to work on pulling the testcase results from the Refstack dashboard..

Thanks for your continuous support and assistance.

Thanks again!!

Regards,
Malleshi CN