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

kdb run-elektrad fails #2469

Open
Piankero opened this Issue Mar 8, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@Piankero
Copy link
Contributor

Piankero commented Mar 8, 2019

Steps to Reproduce the Problem

I installed everything according to https://www.libelektra.org/tools/web but are not able to run the elektra deamon.

kdb run-elektrad                                                                                             ✔  16:23:23 
#> > @elektra-web/elektrad@1.6.0 start:prod /usr/local/share/elektra/tool_data/web/elektrad
#> > cross-env NODE_ENV=production DEBUG=elektrad:*,-*debug,-*log node build/
#> 
#> module.js:550
#>     throw err;
#>     ^
#> 
#> Error: Cannot find module '/usr/local/share/elektra/tool_data/web/elektrad/build'
#>     at Function.Module._resolveFilename (module.js:548:15)
#>     at Function.Module._load (module.js:475:25)
#>     at Function.Module.runMain (module.js:694:10)
#>     at startup (bootstrap_node.js:204:16)
#>     at bootstrap_node.js:625:3
#> npm ERR! code ELIFECYCLE
#> npm ERR! errno 1
#> npm ERR! @elektra-web/elektrad@1.6.0 start:prod: `cross-env NODE_ENV=production DEBUG=elektrad:*,-*debug,-*log node build/`
#> npm ERR! Exit status 1
#> npm ERR! 
#> npm ERR! Failed at the @elektra-web/elektrad@1.6.0 start:prod script.
#> npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#> npm WARN Local package.json exists, but node_modules missing, did you mean to install?
#> 
#> npm ERR! A complete log of this run can be found in:
#> npm ERR!     /home/wespe/.npm/_logs/2019-03-10T07_43_32_629Z-debug.log

In the debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/home/wespe/.nvm/versions/node/v8.12.0/bin/node',
1 verbose cli   '/home/wespe/.nvm/versions/node/v8.12.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'start:prod' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prestart:prod', 'start:prod', 'poststart:prod' ]
5 info lifecycle @elektra-web/elektrad@1.6.0~prestart:prod: @elektra-web/elektrad@1.6.0
6 info lifecycle @elektra-web/elektrad@1.6.0~start:prod: @elektra-web/elektrad@1.6.0
7 verbose lifecycle @elektra-web/elektrad@1.6.0~start:prod: unsafe-perm in lifecycle true
8 verbose lifecycle @elektra-web/elektrad@1.6.0~start:prod: PATH: /home/wespe/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/share/elektra/tool_data/web/elektrad/node_modules/.bin:/home/wespe/.nvm/versions/node/v8.12.0/bin:/home/wespe/.stack/programs/x86_64-linux/ghc-8.2.2/bin:/home/wespe/bin:/home/wespe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/opt/puppetlabs/bin:/home/wespe/.rvm/bin:/home/wespe/extern/misc/cabal_sandbox/.cabal-sandbox/bin:/usr/local/go/bin:/opt/puppetlabs/bin:/home/wespe/.rvm/bin
9 verbose lifecycle @elektra-web/elektrad@1.6.0~start:prod: CWD: /usr/local/share/elektra/tool_data/web/elektrad
10 silly lifecycle @elektra-web/elektrad@1.6.0~start:prod: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=production DEBUG=elektrad:*,-*debug,-*log node build/' ]
11 silly lifecycle @elektra-web/elektrad@1.6.0~start:prod: Returned: code: 1  signal: null
12 info lifecycle @elektra-web/elektrad@1.6.0~start:prod: Failed to exec start:prod script
13 verbose stack Error: @elektra-web/elektrad@1.6.0 start:prod: `cross-env NODE_ENV=production DEBUG=elektrad:*,-*debug,-*log node build/`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/wespe/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/home/wespe/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid @elektra-web/elektrad@1.6.0
15 verbose cwd /usr/local/share/elektra/tool_data/web/elektrad
16 verbose Linux 4.15.0-46-generic
17 verbose argv "/home/wespe/.nvm/versions/node/v8.12.0/bin/node" "/home/wespe/.nvm/versions/node/v8.12.0/bin/npm" "run" "start:prod"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error @elektra-web/elektrad@1.6.0 start:prod: `cross-env NODE_ENV=production DEBUG=elektrad:*,-*debug,-*log node build/`
22 error Exit status 1
23 error Failed at the @elektra-web/elektrad@1.6.0 start:prod script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Maybe the compiled elektra version I use is a problem?
I use the following settings for example:

KDB_DB_SPEC = ~/.config/kdb/spec
KDB_DB_SYSTEM = ~/.config/kdb/system

System Information

  • Elektra Version: master
  • node version: v8.12.0
  • npm version: 6.4.1
@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 9, 2019

Thank you for reporting the problem!

It seems to miss
'/usr/local/share/elektra/tool_data/web/elektrad/build'
are you sure the web-ui is installed?

Please also post the full log (or at least the relevant parts of it).

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

are you sure the web-ui is installed?

cmake ..
#> ...
#> -- Include Tool web
#> ...

The folder /usr/local/share/elektra/tool_data/web/elektrad exists but in beneath no build folder

ls /usr/local/share/elektra/tool_data/web/elektrad
#> package.json  package-lock.json  README.md  src
@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

@omnidan do you have an idea what the problem is here?

@omnidan

This comment has been minimized.

Copy link
Contributor

omnidan commented Mar 10, 2019

@Piankero @markus2330 it seems like elektrad did not get built, you can try manually running npm install from the elektrad directory or running make which should also run npm install (if -DTOOLS="kdb;web" was specified).

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

@omnidan Thank you for looking into it!

@Piankero Can you check the output while building and installing Elektra? Maybe the error already happend there.

@Piankero

This comment has been minimized.

Copy link
Contributor Author

Piankero commented Mar 10, 2019

After some further investigation I fixed it. The reason was that I call make install with sudo and sudo has not npm. Interestingly after switchting to root (sudo su) I have npm again. So I simply called sudo su and make install which then correctly installed elektrad.

Can you check the output while building and installing Elektra? Maybe the error already happend there.

I did not see any problem in the logs with the sudo make install run.

-- Installing: /usr/local/lib/elektra/tool_exec/build-web
-- Installing: elektra-web > elektrad
-- Installing: elektra-web > webd
-- Installing: elektra-web > client

The sudo su run on the other hand gave me some output:

-- Up-to-date: /usr/local/lib/elektra/tool_exec/build-web
-- Installing: elektra-web > elektrad
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
...

I guess it was my lokal npm setup which failed. Thank you for your help

@Piankero Piankero closed this Mar 10, 2019

@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Mar 10, 2019

For me it looks like a bug if the output says

-- Installing: elektra-web > elektrad

and actually nothing was done.

We should check RESULT_VARIABLE in src/tools/web/CMakeLists.txt.

See also https://cmake.org/cmake/help/v3.9/command/execute_process.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.