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

Haraka 2.8.17 install fails on CentOS 7 with Node v8 #2345

Closed
lnedry opened this issue Feb 18, 2018 · 12 comments
Closed

Haraka 2.8.17 install fails on CentOS 7 with Node v8 #2345

lnedry opened this issue Feb 18, 2018 · 12 comments

Comments

@lnedry
Copy link
Contributor

lnedry commented Feb 18, 2018

system info

Haraka Haraka.js — Version: 2.8.17
Node v8.9.4
OS Linux haraka 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017

Expected behavior

Install without errors.

Observed behavior

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/8.9.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/Haraka/node_modules/dtrace-provider/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/Haraka/node_modules/dtrace-provider/.node-gyp/8.9.4"

The last two lines will repeat endlessly.

Steps to reproduce

  • install on 4GB Digital Ocean slice (CentOS 7.4 x64)
yum -y install gcc gcc-c++ make
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
npm install -g Haraka
@luto
Copy link
Contributor

luto commented Feb 19, 2018

I can confirm this with nodejs 8.9.4 on CentOS 7.4. This issue seems to be not with haraka directly, but with node-dtrace-provider, which is a dependency of bunyan, which is a dependency of ldapjs, which is a dependency of haraka-plugin-auth-ldap, which is an optional dependency of haraka. yay.

@lnedry as described in an issue over there running npm with V=1 prevents it from dropping the permissions during build, which "fixes" this error. At least it does for me.

@luto
Copy link
Contributor

luto commented Feb 20, 2018

Correction: V=1 does not resolve this issue for me, so there is still no way to install Haraka globally on CentOS 7.

@lnedry
Copy link
Contributor Author

lnedry commented Feb 20, 2018

I see a similar issue with Ubuntu 16.04.3.

@luto
Copy link
Contributor

luto commented Feb 20, 2018

@lnedry the same behavior is also shown with the iconv module, which led me to believe we're on the wrong path here. This is a general thing with node-gyp: nodejs/node-gyp#454

@msimerson
Copy link
Member

The general issue is that NPM decided to wade into the file permissions pond with strong opinions and a half-baked implementation. It's caused no end of problems for many many users. I work around the NPM brain damage by globally setting unsafe-perm true and user 0.

@baudehlo
Copy link
Collaborator

baudehlo commented Mar 1, 2018 via email

@msimerson
Copy link
Member

Doubtful, this bug is way older than the file permissions bug/patch that 5.7.1 "fixes."

@msimerson
Copy link
Member

Closing, this is a NPM issue outside the scope of Haraka. Use the workarounds suggested or linked to in this issue.

@timraybould
Copy link

Is it currently possibly to install Haraka globally on a linux machine? I've installed it without the -g flag but that doesn't do much good.

@msimerson, maybe the answer is in your workaround? This is a required step I take it? Mind explaining a bit about how to adjust those settings?

@timraybould
Copy link

Ah never mind, I didn't catch the git clone instructions. That worked.

@timraybould
Copy link

Actually, it did not. Seemed to all install ok. But still getting haraka: command not found

@msimerson
Copy link
Member

@timraybould, show us what you did and what resulted. Without that we can't even try to help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants