Unable to create server and NO_PROFILES_DOWNLOADED

OS: Ubuntu 16.04 on and old Gateway 32 bit box
Followed the install steps from here, installing MineOS atop and existing Ubuntu server.
Each install step seemed to install successfully, no errors.
No mc user though… so not sure if that is related to this problem.
Login to the WebUI with my user.
Any attempt to CREATE_NEW_SERVER fails to create a server, no error it just loads the server list page and no server is listed.
It does populate the SERVER_SETTINGS navigation panel but does not seem to help.
Then I navigate to the PROFILES page and it says NO_PROFILES_DOWNLOADED.
I tried downloading the minecraft vanilla server.jar to the /var/games/minecraft/profiles/ directory and the /var/games/minecraft/servers/ directory but the WebUI still does not see it.
Also, I used ping to test connectivity to the outside internet successfully.
mineos.log shows:

{"date":"Sun Aug 19 2018 10:34:03 GMT-0600(MDT)","process":{"pid":1170,"uid":0,"gid":0,"cwd":"/usr/games/minecraft","execPath":"/usr/bin/node","version":"v8.11.4","argv":["/usr/bin/node","/usr/games/minecraft/webui.js"],"memoryUsage":{"rss ":42893312,"heapTotal":16920576,"heapUsed":11020428,"external":1203682}},"os":{"loadavg":[1.3623046875,0.466796875,0.16552734375],"uptime":75},"trace":[{"column":15,"file":"module.js","function":"Module._resolveFilename","line":547,"method":"_resolveFilename","native":false},{"column":25,"file":"module.js","function":"Module._load","line":474,"method":"_load","native":false},{"column":17,"file":"module.js","function":"Module.require","line":596,"method":"require","native":false},{"column":18,"file":"internal/module.js","function":"require","line":11,"method":null,"native":false},{"column":19,"file":"/usr/games/minecraft/node_modules /userid/lib/userid.js","function":null,"line":5,"method":null,"native":false},{"column":30,"file":"module.js","function":"Module._compile","line":652,"method":"_compile","native":false},{"column":10,"file":"module.js","function":"Module._extensions..js","line":663,"method":".js","native":false},{"column":32,"file":"module.js","function":"Module.load","line":565,"method":"load","native":false},{"column":12,"file":"module.js","function":"tryModuleLoad","line":505,"method":null,"native":false},{"column":3,"file":"module.js","function":"Module._load","line":497,"method":"_load","native":false}],"stack":["Error: Cannot find module'/usr/games/minecraft/node_modules/userid/build/Debug/userid.node'","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>(/usr/games/minecraft/node_modules/userid/lib/userid.js:5:19)","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)"],"level":"error","message":"uncaughtException: Cannot find module'/usr/games/minecraft/node_modules/userid/build/Debug/userid.node'","timestamp":"2018-08-19T16:34:03.271Z"}
{"level":"info","message":"Starting up server, using commit: fd17bbc Fix download for Minecraft versions (1.13) not hosted on Amazon AWS (#286)\n","timestamp":"2018-08-19T16:34:05.471Z"}
{"level":"info","message":"Starting up server, using commit: fd17bbc Fix download for Minecraft versions (1.13) not hosted on Amazon AWS(#286)\n","timestamp":"2018-08-19T16:34:55.563Z"}
{"level":"info","message":"Starting up server, using commit: fd17bbc Fix download for Minecraft versions (1.13) not hosted on Amazon AWS(#286)\n","timestamp":"2018-08-19T16:42:31.191Z"}
{"level":"info","message":"Starting up server, using commit: fd17bbc Fix download for Minecraft versions (1.13) not hosted on Amazon AWS(#286)\n","timestamp":"2018-08-19T16:44:17.169Z"}

Reading other posts I am guessing I might be missing a module somewhere but can’t figure out what. I reinstalled all that I could but still getting the same error. Is there a compatibility problem with this old machine (32 bit) I’m using? Thanks for the help!
This seems to be the applicable error:
"message":"uncaughtException: Cannot find module'/usr/games/minecraft/node_modules/userid/build/Debug/userid.node'"

ls -l looks like this:

drwxr-xr-x  11 root root  4096 Aug 18 21:15 usr
drwxr-xr-x  14 root root  4096 Aug 15 21:02 var

Still unable to make any progress on this so any help would be appreciated. Thanks!

I think it may have something to do with nodejs v8 as I had encountered something similar where the install gets stuck in an infinite loop until you manually break it and then when you redo it over again it won’t get stuck and seemingly completes without issue, except you have these “CREATE_NEW_SERVER” and “SERVER_SETTINGS” which you aren’t supposed to see once the web ui is fully loaded. I’ve been meaning to create a post on the subject but wanted to redo testing first to see whether or not that’s the issue but just haven’t gotten around to it due to lack of space and some other things I had happening, I should be able to test in the next few days though unless someone beats me to it. I updated the instructions on my site since mine are specific to Oracle Java 8 rather than OpenJDK 8, then had done a fail steam on how to do it since that loop problem occurred and I ended up just deleting the stream and doing something else in it’s place for the time being.

Anyways, try resetting the web ui (I’m on mobile currently, I’ll add the link to that when I can but for now the wiki you got the instructions from is where you’ll find it), and if things still do not work or get stuck in a loop then that confirms it wasn’t just me or a coincidence. The thing to try after if it doesn’t work would be replacing nodejs 8 with nodejs 4 (I recalled it being nodejs 5 before 4 though but try 4) and then trying it again.

@robertkohl125 did you ever encounter this when/while installing and/or resetting the MineOS web ui?

I’m currently doing some testing now and is what I was referring to previously

Edit 1: nodejs 4 does not have this looping problem, though I did catch a portion of it asking for nodejs version greater than or equal to 5, which is the version that my site had previously shown before I updated it to match the version 8 that the official wiki uses/shows. Nodejs 4’s installer though now says to use nodejs 8 or nodejs 10, though nodejs 8 has that looping problem (I’ve not tried changing permissions or anything and am using snapshots currently to make life easier for testing).

Edit 2: Nodejs 10 also does not have that looping issue however it does fail:

After rebooting the system (after the failure) the web ui does launch and all however is not functional;

@robertkohl125 I imagine this is probably what your web ui looks like in it’s current state:

Simple solution for now for the time being would be reverting back to using nodejs 4 or maybe nodejs 5; I’ll try nodejs 5 and report back on whether it works or not. @hexparrot

Edit 3: Nodejs 5 also works just fine, don’t really know what the differences between nodejs 4 vs nodejs 5 are so I can’t really recommend one over the other, that should be @hexparrot’s call. Nodejs4 I believe was the previous “LTS” release and I think it had at one point or at some point recommended v5 users move/switch to v4 when it came to new installations, but other than that can’t really tell without looking more into nodejs itself.

Edit 4: Alright, I’m officially done here testing and all, I also just did a little more research into the NodeJS versioning and all and would have to say that I’d recommend going with NodeJS 4 over NodeJS 5 based on my findings. Using the official installation wiki here for Ubuntu 16.04 LTS you can follow those steps, replacing/substituting the setup_8.x entry for nodejs v8 back again instead to setup_4.x for nodejs v4 though you may have to completely remove any/all traces of ever having nodejs installed first, and then once you’re done and you’ve got nodejs v4 installed you can follow the wiki here for resetting the web ui in order to fully fix/resolve this altogether.

1 Like

@JayMontana36 thanks so much for your digging into this issue–this gave me plenty of knowledge and saved me tons of time.

@all: Alright, so the posix module is notorious for this issue, and it evidently crops up constantly in the Github issues page.

That said, I have been able to easily reproduce this issue, repeatedly, and have found a way past it.

root@mineos:/usr/games/minecraft# node --version
root@mineos:/usr/games/minecraft# npm --version
root@mineos:/usr/games/minecraft# npm install

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

sh: 1: node-gyp: Permission denied
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! posix@4.1.2 install: `node-gyp rebuild`
npm ERR! spawn ENOENT
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 logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-08-27T15_51_38_691Z-debug.log
root@mineos:/usr/games/minecraft# npm install posix --unsafe-perm

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

make: Entering directory '/usr/games/minecraft/node_modules/posix/build'
  CXX(target) Release/obj.target/posix/src/posix.o
  SOLINK_MODULE(target) Release/obj.target/posix.node
  COPY Release/posix.node
make: Leaving directory '/usr/games/minecraft/node_modules/posix/build'
+ posix@4.1.2
added 2 packages from 9 contributors and audited 1408 packages in 3.688s
found 69 vulnerabilities (37 low, 20 moderate, 12 high)
  run `npm audit fix` to fix them, or `npm audit` for details

For the most part, I think this works because “–unsafe-perm” is actually applied to all non-root users by default (because evidently they can be reckless and still be protected by the unprivileged user linux model). Such “unsafe” perms are default off for when running as root (which also makes sense), but exists because some modules just are too finicky to work without this little tweak.

Default: false if running as root, true otherwise
Type: Boolean
Set to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.

At any rate, the best explanation I can come up with is: posix, which actually has to compile (not all npm modules do) does so by spawn-ing multiple processes, some of which aren’t root, but need the permissions of root, because the place it’s doing to install to requires it.

--unsafe-perm thus says “hey, don’t switch to the other user. we’re root now, so stay that way”

And then it builds. So, bring it all together:

rm -rf /usr/games/minecraft/node_modules
npm install posix --unsafe-perm
npm install
1 Like

Rereading the original post seems to indicate this was an issue with userid, not posix.

Can you provide the output of you attempting to build the npm module? Your error basically just says userid didn’t compile, so you can attack it directly with:

npm install userid

Provide me the the error output and … uh, I’m gonna just hope that the error type is the same (and the solution stands for both cases)!

Update: I have used npm install userid --unsafe-perm successfully to solve the userid issue!

1 Like

Maybe the module just didn’t get built during the installation; I’ll test in a few if breaking the loop and attempting to redo npm install results in another error, since breaking and redoing won’t cause it to loop again but still won’t be successful (based on what I saw had happened when I was doing it on stream).

So I’ve just now tried simply substituting the “npm install” with just “npm install --unsafe-perm” alone and it worked perfectly with nodejs v8 without specifying any individual modules; is/are there any downsides to just simply doing that alone or is it better/more beneficial to do it selectively for specific modules, like posix?

Edit 1:

Well, it did exactly that:
Once you break and redo the command it won’t throw any errors or warnings and will seemingly complete successfully, however you will end up with the same thing as before with it not working as intended:
Attempting to reset the web ui will result in the loop again which would then likely put you in a loop of breaking it again and trying it again. However just using npm install --unsafe-perm in place of npm install works.

Also, no problem; I’ve managed to catch a really great deal on a board and CPU so I’m a lot less hesitant when it comes to testing and experimenting, and also free’d up a ton of space (approximately a terabyte if not more) so I’ve got plenty. Not sure how I missed/overlooked the thanks when it was right there at the very beginning but also thanks for putting all this work into MineOS time and time again over the years; I’ve actually come a very long way because of it when it comes to Linux.

FIXED! Thanks so much. I ran these commands from the /usr/games/minecraft directory

npm install userid --unsafe-perm
npm install posix --unsafe-perm
npm install --unsafe-perm

Not sure exactly what this did but it worked!