Closed MichaIng closed 5 years ago
@MichaIng Reach out to the author hexparrot
Will Dizon on the MineOS Forums. He is very approachable and will tweak the source code of MineOS if needed.
Thanks
Retest on VM Jessie:
Switch to Node v8: npm install -g n && n 8
:
root@VM-Jessie:/mnt/dietpi_userdata/mineos/minecraft# npm install --unsafe-perm
npm ERR! path /mnt/dietpi_userdata/mineos/minecraft/node_modules/nyc/node_modules/amdefine
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/dietpi_userdata/mineos/minecraft/node_modules/nyc/node_modules/amdefine' -> '/mnt/dietpi_userdata/mineos/minecraft/node_modules/nyc/node_modules/.amdefine.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-07-17T16_30_52_204Z-debug.log
Using alternative method to install NodeJS via repo:
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get -y install nodejs
/mnt/dietpi_userdata/mineos/minecraft/node_modules/nyc/node_modules/amdefine
just throws a close error btw. 😉.Restart from scratch, using official Node v8 install method directly:
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get -y install nodejs
🈯️ Install succeeds. Above install method creates node binary at expected location, thus ln -s /usr/bin/node /usr/local/bin/node
is needed or sed -i '/^command=/c\command=/usr/local/bin/node webui.js' /etc/supervisor/conf.d/mineos.conf
needs to be removed from configuration script.
@Fourdee Since this is at least the second software title that needs Node 8 (Koel as well), maybe we should either:
With Java we could btw. do the same, as Java 10 is available.
@MichaIng
Since this is at least the second software title that needs Node 8 (Koel as well), maybe we should either: Fully revert to Node 8
Yep I agree 👍 , then offer alternative versions at a later date in the future?
Only issue is we'd need to fully this test with all node pre-req programs, and, somehow patch existing users down to this version (we could probably uninstall then install again I believe for this).
@Fourdee For now maybe it's easier to add Node 8 as new install option and just verify again that it's working (duet to different install method) with Koel. As long as all other software titles work with the current version/install method, we should not change something there.
We could call the new install NodeJS legacy e.g., then it's clear that it should only be seen as a compatibility fallback.
I will create a PR to test: https://github.com/Fourdee/DietPi/pull/1936
Okay, actually the Koel solution works for MineOS as well. Node 8 just needs to be installed directly instead of failed Node 10 install attempt 😄.
Will test on all Distros: 🈯️ Jessie 🈯️ Stretch 🈯️ Buster
€: Okay commit added: https://github.com/Fourdee/DietPi/commit/8289982c50474ed7009a7f53a819e9866556680d This should be it, but test on non x86_64 would be best, just to be sure.
ARMv7 Stretch, MineOS + NetData:
writing new private key to '.tmpkey.pem'
-----
writing RSA key
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
cp: cannot stat '/var/games/minecraft/*': No such file or directory
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
root@DietPi:~# ls -lha /var/games/minecraft
lrwxrwxrwx 1 mineos mineos 38 Jul 18 17:46 /var/games/minecraft -> /mnt/dietpi_userdata/mineos/serverdata
Doesn't support symlinks?
Ah ./generate-sslcert.sh
runs before mkdir
🈴 linux-x86.tar.gz
?
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.12
added 1 package from 4 contributors in 1.739s
install : node-v8.11.3
mkdir : /usr/local/n/versions/node/8.11.3
fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x86.tar.gz
######################################################################## 100.0%
/usr/local/bin/n: line 590: /usr/local/bin/node: cannot execute binary file: Exec format error
installed :
/usr/local/bin/node: 1: /usr/local/bin/node: Syntax error: word unexpected (expecting ")")
🈺 Christ, 2nd test is fine, weird. We have no G_HW_ARCH usage here, so appears the nodejs install script is to blame.
[ OK ] DietPi-Software | G_AGI: python python3 supervisor rdiff-backup screen rsync
Cloning into 'minecraft'...
remote: Counting objects: 5803, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 5803 (delta 1), reused 0 (delta 0), pack-reused 5801
Receiving objects: 100% (5803/5803), 4.95 MiB | 2.65 MiB/s, done.
Resolving deltas: 100% (3407/3407), done.
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.12
added 1 package from 4 contributors in 0.933s
install : node-v8.11.3
mkdir : /usr/local/n/versions/node/8.11.3
fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-armv7l.tar.gz
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228
root@DietPi:~# ls -lha /usr/lib/python2.7/socket.py
-rw-r--r-- 1 root root 21K Nov 24 2017 /usr/lib/python2.7/socket.py
@Fourdee
Ah, I was already wondering why the error about missing dir still occurs after pre-creating it. So we move to in front of ./generate-sslcert.sh
👍.
Strange, but Node 10 is the correct ARMv7 version?
@MichaIng
Strange, but Node 10 is the correct ARMv7 version?
Yep:
root@DietPi:~# ./node_install.sh
Node Linux Installer by www.github.com/taaem
Running as Root User
Get Latest Version Number...
Done
Downloading latest stable Version node-v10.6.0-linux-armv7l.tar.gz...
Okay, retested successfully here. Hmm Node installs/builds stay a bid unreliable, but it's the best we can do?
€: error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 224
stays, but can't see any negative effect.
@MichaIng
Okay, retested successfully here. Hmm Node installs/builds stay a bid unreliable, but it's the best we can do?
Yep, outside our control.
Just trying to run MineOS as non-root, will send commit if successful.
supervisor process reports root
user, however, if we do not set the following:
chown mineos:dietpi /etc/ssl/certs/mineos*
MineOS fails to load:
base_directory found in mineos.conf, using: /var/games/minecraft
Could not locate required SSL files /etc/ssl/certs/mineos.{key,crt}, aborting server start.
So we can assume that under the hood of supervisor, mineOS is running as non-root user. However, web login fails and renders a ERR_EMPTY_RESPONSE
, ~so back to root for this one.~ Same issue now running as root, i may of broke something, or it doesn't work with nodejs v8?
works as root
login for web interface.
Or
useradd mineos
echo -e "$GLOBAL_PW\n$GLOBAL_PW\n" | passwd mineos
is somehow different to useradd -rm mineos -p "$GLOBAL_PW" -G dietpi -s /usr/bin/nologin
?
Nope, must run as root
. And the mineos
user login for web interface no longer works with nodejs v8. root
user required.
🈯️ Test install passed.
Completed.
🈴
linux-x86.tar.gz
?/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n + n@2.1.12 added 1 package from 4 contributors in 1.739s install : node-v8.11.3 mkdir : /usr/local/n/versions/node/8.11.3 fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x86.tar.gz ######################################################################## 100.0% /usr/local/bin/n: line 590: /usr/local/bin/node: cannot execute binary file: Exec format error installed : /usr/local/bin/node: 1: /usr/local/bin/node: Syntax error: word unexpected (expecting ")")
I'm having this same issue when attempting to install MineOS on a RockPro64 (aarch64) with Dietpi v6.21.1, albeit with node v8.15.0 instead of v8.11.3. Could you please expand on how you were able to get n to install the correct architecture here:
🈺 Christ, 2nd test is fine, weird. We have no G_HW_ARCH usage here, so appears the nodejs install script is to blame.
[ OK ] DietPi-Software | G_AGI: python python3 supervisor rdiff-backup screen rsync Cloning into 'minecraft'... remote: Counting objects: 5803, done. remote: Compressing objects: 100% (2/2), done. remote: Total 5803 (delta 1), reused 0 (delta 0), pack-reused 5801 Receiving objects: 100% (5803/5803), 4.95 MiB | 2.65 MiB/s, done. Resolving deltas: 100% (3407/3407), done. /usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n + n@2.1.12 added 1 package from 4 contributors in 0.933s install : node-v8.11.3 mkdir : /usr/local/n/versions/node/8.11.3 fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-armv7l.tar.gz
Update: I was able to get MineOS installed by reinstalling Node via dietpi-software, manually installing n with npm install -g n
, manually specifying the architecture n -a arm64 8
, then reinstalling MineOS. Is this something that can be fixed in DietPi for future installs?
@DeathIsUnknown
Hmm Node install, npm install -g n
and n 8
is done within the install code already. Not sure if n -a arm64 8
so setting the architecture was the required step in your case, e.g. for ARMv8 in general?
@MichaIng
so setting the architecture was the required step in your case, e.g. for ARMv8 in general?
I believe so, yes. Even now, if I try n 11
, I get:
root@dietpi:~# n 11
install : node-v11.10.0
Error: invalid version 11.10.0
According to this issue's comment, this error crops up when n can't find a corresponding pre-built binary from nodejs. However, arm64 binaries are available, and specifying n -a arm64 11
confirms n is requesting the wrong architecture.
root@dietpi:~# n -a arm64 11
install : node-v11.10.0
mkdir : /usr/local/n/versions/node/11.10.0
fetch : https://nodejs.org/dist/v11.10.0/node-v11.10.0-linux-arm64.tar.gz
I am assuming that, as Fourdee found in his test, n is still attempting to target x86 (of which Node has dropped Linux support since v10) on my ARMv8 device - unfortunately I don't have other hardware to confirm if it's a common issue across similar devices.
@DeathIsUnknown
I am assuming that, as Fourdee found in his test, n is still attempting to target x86 (of which Node has dropped Linux support since v10) on my ARMv8 device
Now that you say it I remember this issue, ah lol as of this topic 😄. AFAIK it was indeed only for ARMv8 devices, but perhaps to be failsafe we should simply always add the -a
option.
Looks like a pull request was made to add support for ARMv8 back in 2017, but it still hasn't been approved. https://github.com/tj/n/pull/448
@DeathIsUnknown Thanks for linking this issue. If shows very clearly where the issue relies. A pain that the PR is opened for years and already approved by all two reviewers but still not merged. It is so simple and clear that there is not even any "review" required. ARMv8 has simply been forgotten or not yet added ...
Lets get this fixed for all n
calls in dietpi-software
...
PR up and merged: https://github.com/Fourdee/DietPi/pull/2562/files
Many thanks for reporting and researching this 👍!! I mark the issue as closed again, but feel free to use, if required.
Bit of a follow-up, n
has been updated to support ARM64:
https://github.com/tj/n/pull/448#issuecomment-477898698
https://github.com/tj/n/releases/tag/v3.0.0
@DeathIsUnknown Many thanks for the information. So we can remove the workaround then, although a quick test should be good:
npm i -g n
n 8
@MichaIng My SBC is offline at the moment until I figure out a kernel issue, so I won't be able to test on an ARM64 platform. Sorry!
Creating a bug report/issue:
Required Information:
v6.9
Stretch
4.9.88
Additional Information (if applicable):
Steps to reproduce:
Expected behaviour:
npm --install
runs through without error.Actual behaviour:
npm --install
throws a lot of warnings and finally error messages.Extra details:
npm install log
``` > posix@4.1.2 install /mnt/0e1fef85-e95c-4777-83ea-4339d1d043e5/dietpi_userdata/mineos/minecraft/node_modules/posix > node-gyp rebuild make: Entering directory '/mnt/0e1fef85-e95c-4777-83ea-4339d1d043e5/dietpi_userdata/mineos/minecraft/node_modules/posix/build' CXX(target) Release/obj.target/posix/src/posix.o ../src/posix.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE node_chroot(Nan::NAN_METHOD_ARGS_TYPE)’: ../src/posix.cc:121:51: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Localnpm install -g n && n 8