apache / helix

Mirror of Apache Helix
Apache License 2.0
466 stars 227 forks source link

start-helix-ui.sh from helix-front-1.0.1 fails in Apache Helix 1.0.1 binary release #1387

Closed brentwritescode closed 8 months ago

brentwritescode commented 4 years ago

Describe the bug

If I download the helix-front-1.0.1.tar binary from a mirror (e.g. http://mirrors.ibiblio.org/apache/helix/1.0.1/binaries/), unpack it and run it, I encounter this error:

~/helix-binary-webui-test/helix-front-1.0.1/bin$ ./start-helix-ui.sh
npm WARN deprecated request@2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@4.2.1: this library is no longer supported
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm notice created a lockfile as package-lock.json. You should commit this file.
added 108 packages from 88 contributors in 4.132s
module.js:549
    throw err;
    ^

Error: Cannot find module 'express-session'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/username/helix-binary-webui-test/helix-front-1.0.1/dist/server/app.js:11:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

To Reproduce

On an Ubuntu 18.04 Linux machine:

%> wget http://mirrors.ibiblio.org/apache/helix/1.0.1/binaries/helix-front-1.0.1-pkg.tar
%> tar xvf helix-front-1.0.1-pkg.tar
%> cd helix-front-1.0.1/bin
%> chmod 755 ./*.sh
%> ./start-helix-ui.sh 

The startup should produce the stack trace described above.

Expected behavior

The script to successfully run and launch the Helix web user interface on port 3000 on the current machine.

Additional context

This is the package.json file contained in the binary distribution:

~/helix-binary-webui-test/helix-front-1.0.1$ cat package.json
{
  "name": "helix-ui",
  "version": "1.0.0",
  "author": "Vivo Xu <vivo@fancyber.com>",
  "description": "Helix Web UI to manage helix clusters",
  "scripts": {
    "start": "node ./dist/server/app.js"
  },
  "private": true,
  "license": "Apache-2.0",
  "dependencies": {
    "body-parser": "^1.17.2",
    "cookie-parser": "^1.3.5",
    "dotenv": "^4.0.0",
    "express": "^4.15.3",
    "morgan": "^1.8.2",
    "request": "2.81.0"
  }
}

It seems to be missing the required express-session and ldapjs modules. If I update the package.json to look like this (note the two new additions), everything seems to work as expected:

{
  "name": "helix-ui",
  "version": "1.0.0",
  "author": "Vivo Xu <vivo@fancyber.com>",
  "description": "Helix Web UI to manage helix clusters",
  "scripts": {
    "start": "node ./dist/server/app.js"
  },
  "private": true,
  "license": "Apache-2.0",
  "dependencies": {
    "body-parser": "^1.17.2",
    "cookie-parser": "^1.3.5",
    "dotenv": "^4.0.0",
    "express": "^4.15.3",
    "express-session": "^1.17.1",
    "ldapjs": "^2.1.1",
    "morgan": "^1.8.2",
    "request": "2.81.0"
  }
}

Interestingly, the package.json on master (https://github.com/apache/helix/blob/master/helix-front/package.json) and on the release-1.0.1 branches (https://github.com/apache/helix/blob/release-1.0.1/helix-front/package.json) don't seem to be missing these entries (in also seem to have a lot of other entries as well).

Is there some inconsistency in how the binary distributions are produced vs. how the repository is structured? I'm hoping to be able to pull binary distributions of the controller, rest api and web ui, so I don't have to build them myself, but currently I run into this issue if I try to only use those.

Thanks for your time and help!

junkaixue commented 4 years ago

Thanks for reporting that. We will take a look.

brentwritescode commented 4 years ago

@dasahcc is the stuff that generates the binary distributions in the Helix repository? If so, I can try to take a look at it too if that would help.