Cannot login to WebUI


To be clear, it’s FreeBSD so, I believe the path you mean is /usr/local/games/minecraft (The scripts in upstart_conf are also incorrectly pointing to /usr/games/minecraft, just as an FYI. This wasn’t the first version to be missing the reference to /local/, so I picked up on that problem right away).

Yes, I started the service manually, and am able to do all the things the OP was able to do. The service starts, and I can get to the login screen, but the login fails (without an error message), the prompts are cleared, and the login page is re-displayed. In my post above you can see the server log showing that it started, but I was unable to authenticate using ‘mc’ which is meant to be my mineos unpriv’d account, but I also tried with ‘wheel’ user name, both were refused.

Sun Sep 02 2018 03:26:30 GMT-0400 (Eastern Daylight Time) - failure from: user: mc
Sun Sep 02 2018 03:26:44 GMT-0400 (Eastern Daylight Time) - failure from: user: mc
Sun Sep 02 2018 03:27:32 GMT-0400 (Eastern Daylight Time) - failure from: user: hyndmanc
Sun Sep 02 2018 04:13:17 GMT-0400 (Eastern Daylight Time) - failure from: user: mc
Sun Sep 02 2018 04:13:38 GMT-0400 (Eastern Daylight Time) - failure from: user: hyndmanc
Sun Sep 02 2018 04:49:10 GMT-0400 (Eastern Daylight Time) - failure from: user: mc

I tried to start in manually you describe above, but ./webui is not recognized by shell. Shouldn’t I be launching it in the node wrapper?
us/root@FTC_BSD:/usr/local/games/minecraft # ./webui
./webui: Command not found.

So, I tried to launch it directly with the .js extention:
root@FTC_BSD:/usr/local/games/minecraft # ./webui.js
base_directory found in mineos.conf, using: /var/games/minecraft

But it just returned to the shell prompt, and no new pids were created.


Can you verify that there were no errors/failed npm attempts from nodejs?

 cd /usr/local/games/minecraft
 rm -rf node_modules
 npm install

It’s possible that posix or userid have failed to build. If that’s the case, then the solution is the argument --unsafe-perm.

It could even be authenticate-pam. IIRC that’s the module that might be only used by BSD users, and I am not sure the last time I ran my auth test suites against BSD; I will be looking into this.

Also can try:

cd /usr/local/games/minecraft
npm install -g nodeunit
nodeunit test/test-auth.js

All 16 assertions should pass. I’m going to guess due to my inattention to BSD, compat will show elsewise, though…

root@FTC_BSD:/usr/local/games/minecraft # npm install**

> posix@4.1.2 install /usr/local/games/minecraft/node_modules/posix
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT            HON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm            /node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/            node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/whic            h.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/whic            h.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.j            s:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_mo            dules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_mo            dules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System FreeBSD 11.2-RELEASE
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_mod            ules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/games/minecraft/node_modules/posix
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! errno 1
npm ERR! posix@4.1.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the posix@4.1.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log            ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-09-05T11_29_59_457Z-debug.log

So, that error looked python-ish which I assumed meant I’d messed up the pkg install originally, so I re-executed:

root@FTC_BSD:/usr/local/games/minecraft # pkg install -y rdiff-backup rsync gmake screen git sysutils/py-supervisor node www/npm
Updating FreeBSD repository catalogue…
Fetching meta.txz: 100% 944 B 0.9kB/s 00:01
Fetching packagesite.txz: 100% 6 MiB 3.3MB/s 00:02
Processing entries: 100%
FreeBSD repository update completed. 32120 packages processed.
All repositories are up to date.
Checking integrity… done (0 conflicting)
The most recent version of packages are already installed
root@FTC_BSD:/usr/local/games/minecraft # npm install -g nodeunit /usr/local/bin/nodeunit -> /usr/local/lib/node_modules/nodeunit/bin/nodeunit
+ nodeunit@0.11.3
updated 1 package in 10.334s

So, I installed nodeunit and ran your test:
root@FTC_BSD:/usr/local/games/minecraft # nodeunit test/test-auth.js

✖ authenticate_shadow

AssertionError: false == 'weak'
    at Object.equal (/usr/local/lib/node_modules/nodeunit/lib/types.js:83:39)
    at /usr/local/games/minecraft/test/test-auth.js:11:14
    at /usr/local/games/minecraft/auth.js:93:15
    at posix (/usr/local/games/minecraft/auth.js:40:7)
    at /usr/local/games/minecraft/auth.js:89:11
    at /usr/local/games/minecraft/auth.js:14:9
    at /usr/local/games/minecraft/node_modules/graceful-fs/polyfills.js:284:29
    at FSReqWrap.oncomplete (fs.js:152:21)

✖ test_membership

Error: Cannot find module '/usr/local/games/minecraft/node_modules/userid/build/Debug/userid.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/usr/local/games/minecraft/node_modules/userid/lib/userid.js:5:19)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.auth.test_membership (/usr/local/games/minecraft/auth.js:101:16)
    at /usr/local/games/minecraft/test/test-auth.js:57:12
    at /usr/local/games/minecraft/node_modules/async/lib/async.js:718:13
    at iterate (/usr/local/games/minecraft/node_modules/async/lib/async.js:262:13)

✖ verify_ids


FAILURES: 3/3 assertions failed (340ms)


This problem has been solved and the corresponding documentation updated.

Mainly, the following changes were implemented:

  1. pkg install python
    this package was previously implied, but python may not have been added on all FreeBSD installs
  2. echo “CXX=c++ npm install userid” | sh
    for reasons unknown, if this fails during the broader npm install it is not made clear to the user. Separated it as its own step in order to make sure it works as expected.