Kresus update fail (npm / ovh issue ?)

Hello all,

My YunoHost server

Hardware: kimsufi dedicated server
KS-3 Intel Atom N2800 2c/4t 1.86GHz 4GB DDR3 1066 MHz 2TB 100 Mbps /128
YunoHost version: 3.7.1.3
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I try to update Kresus but it fail.
You can see complete log here.
But in logs I found :

2020-05-06 21:20:31,287: DEBUG - + npm install --production --unsafe-perm
2020-05-06 21:20:57,524: WARNING - npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
2020-05-06 21:21:00,442: WARNING - npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2020-05-06 21:21:21,947: WARNING - npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
2020-05-06 21:21:22,249: WARNING - npm WARN deprecated node-uuid@1.4.7: Use uuid module instead
2020-05-06 21:21:22,250: WARNING - npm WARN deprecated simple-bufferstream@1.0.0: no longer maintained
2020-05-06 21:21:22,753: WARNING - npm WARN deprecated hoek@4.2.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).
2020-05-06 21:21:22,855: WARNING - npm WARN deprecated joi@9.2.0: 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).
2020-05-06 21:21:31,683: WARNING - npm WARN deprecated items@2.1.2: This module has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version of hapi 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).
2020-05-06 21:21:31,785: WARNING - npm WARN deprecated topo@2.0.2: 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).
2020-05-06 21:21:34,394: WARNING - npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
2020-05-06 21:21:41,323: WARNING - npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
2020-05-06 21:22:47,312: DEBUG - 
2020-05-06 21:22:47,315: DEBUG - > node-expat@2.3.18 install /var/www/kresus/node_modules/node-expat
2020-05-06 21:22:47,316: DEBUG - > node-gyp rebuild
2020-05-06 21:22:47,318: DEBUG - 
2020-05-06 21:22:47,421: WARNING - sh: BASH_XTRACEFD: 7: invalid value for trace file descriptor
2020-05-06 21:22:47,423: WARNING - sh: BASH_XTRACEFD: 7: invalid value for trace file descriptor
2020-05-06 21:22:50,452: WARNING - /bin/sh: BASH_XTRACEFD: 7: invalid value for trace file descriptor
2020-05-06 21:22:50,454: WARNING - gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
2020-05-06 21:22:50,556: WARNING - gyp ERR! configure error
2020-05-06 21:22:50,558: WARNING - gyp ERR! stack Error: `gyp` failed with exit code: 1
2020-05-06 21:22:50,561: WARNING - gyp ERR! stack     at ChildProcess.onCpExit (/opt/node_n/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
2020-05-06 21:22:50,563: WARNING - gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
2020-05-06 21:22:50,565: WARNING - gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-05-06 21:22:50,568: WARNING - gyp ERR! System Linux 4.9.0-12-amd64
2020-05-06 21:22:50,571: WARNING - gyp ERR! command "/opt/node_n/n/versions/node/12.16.3/bin/node" "/opt/node_n/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-05-06 21:22:50,573: WARNING - gyp ERR! cwd /var/www/kresus/node_modules/node-expat
2020-05-06 21:22:50,576: WARNING - gyp ERR! node -v v12.16.3
2020-05-06 21:22:50,578: WARNING - gyp ERR! node-gyp -v v5.1.0
2020-05-06 21:22:50,580: WARNING - gyp ERR! not ok
2020-05-06 21:22:58,426: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
2020-05-06 21:22:58,428: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2020-05-06 21:22:58,430: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/mocha/node_modules/chokidar/node_modules/fsevents):
2020-05-06 21:22:58,432: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2020-05-06 21:22:58,434: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/onchange/node_modules/chokidar/node_modules/fsevents):
2020-05-06 21:22:58,436: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2020-05-06 21:22:58,438: WARNING - 
2020-05-06 21:22:58,548: WARNING - npm ERR! code ELIFECYCLE
2020-05-06 21:22:58,550: WARNING - npm ERR! errno 1
2020-05-06 21:22:58,552: WARNING - npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`
2020-05-06 21:22:58,553: WARNING - npm ERR! Exit status 1
2020-05-06 21:22:58,555: WARNING - npm ERR!
2020-05-06 21:22:58,557: WARNING - npm ERR! Failed at the node-expat@2.3.18 install script.
2020-05-06 21:22:58,559: WARNING - npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-05-06 21:22:58,866: WARNING - 
2020-05-06 21:22:58,868: WARNING - npm ERR! A complete log of this run can be found in:
2020-05-06 21:22:58,869: WARNING - npm ERR!     /root/.npm/_logs/2020-05-06T21_22_58_732Z-debug.log
2020-05-06 21:22:58,972: DEBUG - + ynh_exit_properly
2020-05-06 21:22:58,974: DEBUG - + local exit_code=1
2020-05-06 21:22:58,975: DEBUG - + '[' 1 -eq 0 ']'
2020-05-06 21:22:58,977: DEBUG - + trap '' EXIT
2020-05-06 21:22:58,981: DEBUG - + set +eu
2020-05-06 21:22:58,986: DEBUG - + sleep 0.5
2020-05-06 21:22:59,490: DEBUG - + type -t ynh_clean_setup
2020-05-06 21:22:59,491: WARNING - e[91me[1m[ERR]e[0m Upgrade failed.

I saw that there was about the same problem with peertube.
( I also use a dedicated OVH / Kimsufi server)

@kanhu
you have created a new ovh-fix branch but I don’t really understand what the changes are between the master branch and this branch.

Can you explain it to me please ?
#ynh_install_nodejs --nodejs_version=10
#sudo -u $app env PATH=$PATH yarn install --production --pure-lockfile°
:thinking:

ping : @homerc @nicofrand @Jibec

Thank you for your help.

PS: I’m almost sure I chose the OS kernel and not the one customized by OVH

@gannonwoto building node fails on OVH/Kimsufi, I don’t know why. For this reason this step has to be done manually.

Hi,

can you give the result of uname -a please?

@kanhu : OK thank you for your answer.

@nicofrand : sure :

Linux myserver:).fr 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 GNU/Linux

My apps:

    label: Calibre-web
    label: Dokuwiki
    label: Gitea
    label: Grafana
    label: Leed
    label: Monitorix
    label: NetData
    label: Nextcloud
    label: Portainer
    label: Rainloop
    label: Shaarli
    label: SPFToolBox
    label: Wallabag
    label: Wiki.js

I can’t install kresus on a kimsuffi box too. I don’t have logs but here is teh result of the command:

root@yunohost:~# uname -a                                                                                                                                           
Linux yunohost 3.14.32-xxxx-grs-ipv6-64 #6 SMP Wed Jan 20 17:52:44 CET 2016 x86_64 GNU/Linux                                                                        
root@yunohost:~#                                                                                                                                                    

There is not update available on my server (apt get update && apt get upgrade)

@Gofannon I suspect your issue to be due to the OVH kernel you are using (with grsec enabled as the -grs- states it). Switching to a regular kernel might fix it (see https://www.wolwx.net/changer-de-kernel-serveur-ovh-soyoustart-kimsufi/).

@gannonwoto You don’t seem to be using the OVH kernel indeed. I don’t know why node-gyp would fail on your server. If you have some feedback on the ovh fix, or @kanhu , I’d appreciate.
Could you also try rm ~/.node-gyp -rf (~ is a shortcut for /home/youruser so if your user is gannonwoto, you can remove /home/gannonwoto/.node-gyp) and retry the installation?

@Gofannon could you run these commands and give me the results please? This won’t modify anything:

  • which paxctl
  • systctl "kernel" | grep "grsecurity"

(Maybe a hint why grsecurity is an issue: https://en.wikibooks.org/wiki/Grsecurity/Application-specific_Settings#Node.js)

root@yunohost:~# which paxctl
root@yunohost:~#    

root@yunohost:~# sysctl “kernel” | grep “grsecurity”
kernel.grsecurity.audit_ptrace = 1
kernel.grsecurity.consistent_setxid = 1
kernel.grsecurity.deny_new_usb = 0
kernel.grsecurity.dmesg = 1
kernel.grsecurity.forkfail_logging = 1
kernel.grsecurity.grsec_lock = 0
kernel.grsecurity.harden_ptrace = 1
kernel.grsecurity.ptrace_readexec = 1
kernel.grsecurity.signal_logging = 1
kernel.grsecurity.timechange_logging = 1
root@yunohost:~#

Thanks! Second one is kind of a good news: we could detect grsecurity.
For the first one, could you also run apt-cache search paxctl please?

root@yunohost:~# apt-cache search paxctl                                                                                                                            
paxctl - new PaX control program for using the PT_PAX_FLAGS marking                                                                                                 
paxctld - Daemon to automatically set appropriate PaX flags       

.

root@yunohost:~# apt install paxctl                                                                                                                                 
Lecture des listes de paquets... Fait                                                                                                                               
Construction de l'arbre des dépendances                                                                                                                             
Lecture des informations d'état... Fait                                                                                                                             
Les NOUVEAUX paquets suivants seront installés :                                                                                                                    
  paxctl                                                                                                                                                            
0 mis à jour, 1 nouvellement installés, 0 à enlever et 0 non mis à jour.                                                                                            
Il est nécessaire de prendre 11,4 ko dans les archives.                                                                                                             
Après cette opération, 32,8 ko d'espace disque supplémentaires seront utilisés.                                                                                     
Réception de:1 http://debian.mirrors.ovh.net/debian stretch/main amd64 paxctl amd64 0.9-1+b1 [11,4 kB]
11,4 ko réceptionnés en 0s (105 ko/s)
Sélection du paquet paxctl précédemment désélectionné.                                                                                                              
(Lecture de la base de données... 76822 fichiers et répertoires déjà installés.)                                                                                    
Préparation du dépaquetage de .../paxctl_0.9-1+b1_amd64.deb ...                                                                                                     
Dépaquetage de paxctl (0.9-1+b1) ...                                                                                                                                
Paramétrage de paxctl (0.9-1+b1) ...                                                                                                                                
Traitement des actions différées (« triggers ») pour man-db (2.7.6.1-2) ...                                                                                         

.

root@yunohost:~# paxctl                                                                                                                                             
PaX control v0.9
Copyright 2004,2005,2006,2007,2009,2010,2011,2012,2014 PaX Team <pageexec@freemail.hu>
                                                                                                                                                                    
usage: paxctl <options> <files>                                                                                                                                     
                                                                                                                                                                    
options:                                                                                                                                                            
        -p: disable PAGEEXEC            -P: enable PAGEEXEC                                                                                                         
        -e: disable EMUTRAMP            -E: enable EMUTRAMP                                                                                                         
        -m: disable MPROTECT            -M: enable MPROTECT                                                                                                         
        -r: disable RANDMMAP            -R: enable RANDMMAP                                                                                                         
        -x: disable RANDEXEC            -X: enable RANDEXEC                                                                                                         
        -s: disable SEGMEXEC            -S: enable SEGMEXEC                                                                                                         
                                                                                                                                                                    
        -v: view flags                  -z: restore default flags                                                                                                   
        -q: suppress error messages     -Q: report flags in short format                                                                                            
        -c: convert PT_GNU_STACK into PT_PAX_FLAGS (see manpage!)                                                                                                   
        -C: create PT_PAX_FLAGS (see manpage!)              

.

root@yunohost:~# which paxctl
/sbin/paxctl
root@yunohost:~#

Merci pour ces infos !
Ce qui serait intéressant maintenant c’est de tester si la commande paxctl -Cm /usr/bin/nodejs permet d’avancer dans l’installation. Sauf que au lieu de /usr/bin/nodejs il faut utiliser $nodejs_path.

Si je fais une branche de test, tu accepterais de vérifier si ça fonctionne ?

Oui. je n’ai pas de kresus ni d’applis nodejs sur mon serveur pour l’instant.

Je ne touche pas au kernel en attendant du coup

Cool, voilà : https://github.com/nicofrand/kresus_ynh/tree/grsec.

Salut,

Je n’ai aucun dossier de ce nom dans /home/*
Par contre un petit find me donne

/root/.cache/node-gyp
/usr/local/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp
/usr/local/n/versions/node/8.17.0/lib/node_modules/npm/node_modules/node-gyp
/usr/local/n/versions/node/10.20.0/lib/node_modules/npm/node_modules/node-gyp
/usr/local/n/versions/node/10.19.0/lib/node_modules/npm/node_modules/node-gyp
/usr/local/n/versions/node/10.20.1/lib/node_modules/npm/node_modules/node-gyp
/usr/local/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.18.0/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.18.1/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/8.17.0/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.17.0/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.19.0/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/8.16.1/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/8.16.2/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.16.3/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/n/versions/node/10.20.1/lib/node_modules/npm/node_modules/node-gyp
/opt/node_n/lib/node_modules/npm/node_modules/node-gyp 

:open_mouth:
C’est quoi toute cette arborecence /opt/node_n/ ?

PS: j’ai aucun paquet paxctl d’installé.
PSS: je suis un train de tester une mise à jour en virant /root/.cache/node-gyp

OK merci. Tu peux aussi me donner le résultat de sysctl "kernel.grsecurity" stp?

meme erreur meme en vidan /root/.cache/node-gyp
https://paste.yunohost.org/raw/otobogibiy

sysctl: cannot stat /proc/sys/kernel/grsecurity: No such file or directory

:astonished:

OK, ça confirme bien que pour toi tu n’as pas grsecurity d’installé (ce qui est normal si tu n’as pas le kernel ovh) !

@gannonwoto Peux-tu essayer depuis https://github.com/nicofrand/kresus_ynh stp ?

:frowning:

https://paste.yunohost.org/raw/osotisanel

Toujours la même erreur

2020-05-09 16:55:06,898: WARNING - gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
2020-05-09 16:55:06,899: WARNING - gyp ERR! configure error
2020-05-09 16:55:06,901: WARNING - gyp ERR! stack Error: `gyp` failed with exit code: 1
2020-05-09 16:55:06,902: WARNING - gyp ERR! stack     at ChildProcess.onCpExit (/opt/node_n/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
2020-05-09 16:55:06,904: WARNING - gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
2020-05-09 16:55:06,906: WARNING - gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-05-09 16:55:06,908: WARNING - gyp ERR! System Linux 4.9.0-12-amd64
2020-05-09 16:55:06,909: WARNING - gyp ERR! command "/opt/node_n/n/versions/node/12.16.3/bin/node" "/opt/node_n/n/versions/node/12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-05-09 16:55:06,911: WARNING - gyp ERR! cwd /var/www/kresus/node_modules/node-expat
2020-05-09 16:55:06,913: WARNING - gyp ERR! node -v v12.16.3
2020-05-09 16:55:06,915: WARNING - gyp ERR! node-gyp -v v5.1.0
2020-05-09 16:55:06,916: WARNING - gyp ERR! not ok
2020-05-09 16:55:14,748: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
2020-05-09 16:55:14,750: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2020-05-09 16:55:14,752: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/mocha/node_modules/chokidar/node_modules/fsevents):
2020-05-09 16:55:14,754: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2020-05-09 16:55:14,756: WARNING - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/onchange/node_modules/chokidar/node_modules/fsevents):
2020-05-09 16:55:14,759: WARNING - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.