Sync failed with error "Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory"

POur l’instant, impossible de remettre mon noeud en fonctionnement.
J’ai relancé 3 fois la commande
sudo su - duniter -c "duniter --home \$HOME sync g1.duniter.org" && sudo systemctl start duniter
et à chaque fois, ça échour tout proche du but, après 95 % en tout cas avec les erreurs suivantes qui s’affichent :

Security context: 0x123d41d9e6c1 <JSObject>conf...
    1: reduce [0x3701d7208599] [/opt/duniter/app/lib/indexer.js:~1746] [pc=0x25efb8a1252b](this=0x3701d720cc51 <Object map = 0x4138ae5c149>,records=0x06bde901a631 <JSArray[1]>)
    2: /* anonymous */(aka /* anonymous */) [0x6bde901b2c1] [/opt/duniter/app/lib/indexer.js:1769] [bytecode=0x85628752df1 offset=21](this=0x2bed802826f1 <undefined>,value=0x06bde901a...
2023-06-05T08:42:12+02:00 - debug: Now open indexers...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryxs.db"...
 1: 0x8fb090 node::Abort() [/opt/duniter//node/bin/node]se "/home/yunohost.app/duniter/duniter_default/peers.db"...
 2: 0x8fb0dc  [/opt/duniter//node/bin/node]database...
 3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 5: 0xef7462  [/opt/duniter//node/bin/node]
 6: 0xef7568 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/duniter//node/bin/node]
 7: 0xf03642 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 8: 0xf03f74 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 9: 0xf06be1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/duniter//node/bin/node]
10: 0xed0064 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/opt/duniter//node/bin/node]
11: 0x11701ee v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/opt/duniter//node/bin/node]
12: 0x25efb7fdbe1d
/usr/bin/duniter : ligne 15 : 4073868 Abandon                 $NODE "$DUNITER_DIR/bin/duniter" "$@"

Du coup, au lieu d’insister encore une fois, j’ai d’abord redémarré mon serveur yunohost et je viens de relancer, en espérant que ce soit la bonne cette fois.
Sinon, j’ai testé avec le noeud de Moul, et ça semble bien fonctionner en effet.

1 Like

Ok, on va voir, là j’en suis à 75% de la synchronisation, j’espère que cela va aller au bout…

Cela reste un bug important car il y a une limite à 200 mais finalement le noeud garde en piscine bien plus de transactions…

Bon, la synchro a foiré à 96%…
Voici ma console =>

Status: GOT chunck #2459/2521 from 614750 to 614999 on peer g1.cloud-libre.eu
<--- Last few GCs --->

[1187731:0x41ac8c0] 10908131 ms: Scavenge 1331.5 (1421.5) -> 1330.8 (1422.0) MB, 3.5 / 0.0 ms  (average mu = 0.274, current mu = 0.234) allocation failure 
[1187731:0x41ac8c0] 10908139 ms: Scavenge 1331.6 (1422.0) -> 1330.8 (1422.5) MB, 3.8 / 0.0 ms  (average mu = 0.274, current mu = 0.234) allocation failure 
[1187731:0x41ac8c0] 10908148 ms: Scavenge 1331.6 (1422.5) -> 1330.8 (1423.0) MB, 3.8 / 0.0 ms  (average mu = 0.274, current mu = 0.234) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x171e7151e6c1 <JSObject>
    0: builtin exit frame: parse(this=0x171e715119f9 <Object map = 0x1881708042a9>,0x283eefd8a201 <Very long string[37792]>,0x171e715119f9 <Object map = 0x1881708042a9>)

    1: /* anonymous */ [0x4a4410e7b69] [/opt/duniter/app/lib/dal/indexDAL/leveldb/LevelDBTable.js:~72] [pc=0x34871d5f9950](this=0x04a4410e7be9 <ReadStream map = 0x3e664bd50071>,data=0x283eefd85469 <Object map = 0x3e664bd4d471>)...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fb090 node::Abort() [/opt/duniter//node/bin/node]
 2: 0x8fb0dc  [/opt/duniter//node/bin/node]
 3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 5: 0xef7462  [/opt/duniter//node/bin/node]
 6: 0xef7568 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/duniter//node/bin/node]
 7: 0xf03642 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 8: 0xf03f74 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 9: 0xf06be1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/duniter//node/bin/node]
10: 0xedbec0  [/opt/duniter//node/bin/node]
11: 0xedbf57 v8::internal::Factory::NewJSObject(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::PretenureFlag) [/opt/duniter//node/bin/node]
12: 0xfc7136 v8::internal::JsonParser<true>::ParseJsonObject() [/opt/duniter//node/bin/node]
13: 0xfc7f90 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
14: 0xfc8425 v8::internal::JsonParser<true>::ParseJsonArray() [/opt/duniter//node/bin/node]
15: 0xfc7fa0 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
16: 0xfc74dc v8::internal::JsonParser<true>::ParseJsonObject() [/opt/duniter//node/bin/node]
17: 0xfc7f90 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
18: 0xfc8004 v8::internal::JsonParser<true>::ParseJson() [/opt/duniter//node/bin/node]
19: 0xbd7ad8 v8::internal::Builtin_JsonParse(int, v8::internal::Object**, v8::internal::Isolate*) [/opt/duniter//node/bin/node]
20: 0x34871675bf7d 
/usr/bin/duniter : ligne 15 : 1187731 Abandon                 $NODE "$DUNITER_DIR/bin/duniter" "$@"

C’est un manque de mémoire. Il faut au moins 4 gigas de mémoire vive pour faire une synchro maintenant.

Salut, dans mon cas j’ai 16 Go de mémoire RAM dont 8 ou 9 de libre quand toutes mes applications sur mon serveur tournent en même temps y compris Duniter.

Avec la branche 1.8 je pense qu’il faut plus que 4Go de RAM maintenant. Peux-tu essayer en ajoutant cette variable d’environnement ?

export NODE_OPTIONS=--max-old-space-size=8192
3 Likes

Salut, je tape cette commande directement avant de synchroniser ? Je l’inclus à duniter sync url… ?
Désolé pour ma question de newbie ! :slight_smile:

Le plus simple est que tu exécutes cette commande juste avant de lancer duniter sync ....
Je ne promets pas que ça marche. Mais ça se tente.

J’essaye également de mon côté car j’ai eu le même problème en synchronisant une version 1.8.6, vers 98%.

EDIT : ma synchro est allée au bout avec cette config.

3 Likes

Moi aussi, grâce à cette config, mon serveur est enfin de retour ! Peut-être faudrait-il ajouter cette option dans les documentations sur la synchro Duniter.

2 Likes

Synchro bloquée à 44% depuis 1h malgré la commande export NODE_OPTIONS=–max-old-space-size=8192 avant de synchroniser…
Je vais re-tenter mais je suis septique… :frowning:

Edit-------------

J’ai laissé tourner cette nuit mais la synchro c’est arrêté à 98% de télécharger et 96% appliqué avec le même message d’erreur qu’au dessus…
Je relance ce matin.

Bon, j’ai réessayé ce matin, mais toujours pareil ! L’erreur se produit à 98% de téléchargement et 96% d’appliqué… :frowning: Je suis dubitatif sur le fait que cela soit un problème de mémoire.

Status: Peers...
<--- Last few GCs --->

[1505237:0x36438c0] 10873010 ms: Mark-sweep 1324.8 (1439.6) -> 1308.9 (1440.1) MB, 697.9 / 0.6 ms  (average mu = 0.202, current mu = 0.144) allocation failure scavenge might not succeed
[1505237:0x36438c0] 10873826 ms: Mark-sweep 1325.8 (1440.6) -> 1308.7 (1440.6) MB, 700.1 / 0.6 ms  (average mu = 0.173, current mu = 0.142) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x26273f0c4b61]
Security context: 0x04a43b19e6c1 <JSObject>
    1: toString [0x2b248aa20651] [buffer.js:~643] [pc=0x2627417f498c](this=0x250e55b97101 <Uint8Array map = 0x429669c9e79>,encoding=0x2c0d8d2826f1 <undefined>,start=0x2c0d8d2826f1 <undefined>,end=0x2c0d8d2826f1 <undefined>)
    2: arguments adaptor frame: 0->3
    3: InternalFrame [pc: 0x26273e90ee75]
    4: EntryFrame [pc: 0x26273e9092c1]
    5: ExitFrame [...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fb090 node::Abort() [/opt/duniter//node/bin/node]
 2: 0x8fb0dc  [/opt/duniter//node/bin/node]
 3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 5: 0xef7462  [/opt/duniter//node/bin/node]
 6: 0xef7568 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/duniter//node/bin/node]
 7: 0xf03642 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 8: 0xf03f74 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 9: 0xf06be1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/duniter//node/bin/node]
10: 0xeceec5  [/opt/duniter//node/bin/node]
11: 0xed673a v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [/opt/duniter//node/bin/node]
12: 0xed6a4b v8::internal::Factory::NewStringFromOneByte(v8::internal::Vector<unsigned char const>, v8::internal::PretenureFlag) [/opt/duniter//node/bin/node]
13: 0xed749d v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const>, v8::internal::PretenureFlag) [/opt/duniter//node/bin/node]
14: 0xb11129 v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [/opt/duniter//node/bin/node]
15: 0x9c37e8 node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [/opt/duniter//node/bin/node]
16: 0x9177a0  [/opt/duniter//node/bin/node]
17: 0x26273f0c4b61 
/usr/bin/duniter : ligne 15 : 1505237 Abandon                 $NODE "$DUNITER_DIR/bin/duniter" "$@"

suite du post : Tentative de synchro vers g1.duniter.org depuis node, ko - #15 by guenoel

J’ai arrêté une autre machine virtuelle pour pouvoir allouer plus de RAM le temps de la synchro. J’ai 10 Go de RAM actuellement, ça devrait suffire ! J’ai relancé la synchro: à suivre…

Si si c’est bien un message d’erreur de manque de mémoire.
Comment as-tu installé Duniter ? Package Debian, Docker ou Yunohost ?

Es-tu sûr que la variable d’environnement NODE_OPTIONS est bien définie dans ton terminal de commandes, après la commande de Pini ? Pour vérifier :

env | grep NODE

doit renvoyer :

NODE_OPTIONS=--max-old-space-size=8192

Tu peux aussi tout taper sur la même ligne pour être bien sûr :

NODE_OPTIONS=--max-old-space-size=8192 duniter sync hostname
1 Like

cela ne me renvoie rien du tout… ça me redonne uniquement la main sur ma console.
Mon noeud est sous Yunohost depuis longtemps, ça tournait très bien ces derniers mois, pas de coupures rien…

Bon je vais réessayer avec la commande complète NODE_OPTIONS=–max-old-space-size=8192 duniter sync hostname on verra bien.

1 Like

Bon, décidément je n’ai pas de chance avec cette synchro, elle est allée au bout mais l’interface webadmin me dit que je suis désynchronisé puisqu’elle m’affiche le bloc 580499 du 30/11/2022 !!!
Voir capture d’écran ci-joint…

J’ai remarqué qu’en CLI, si la première commande échoue (synchronisation incomplète) elle ne retourne pas d’erreur, du coup, Duniter démarre avec une synchronisation incomplète :slight_smile:

duniter sync <endpoint> && systemctl start duniter

Salut, du coup tu me conseilles de recommencer la synchro avec ta commande ?

Non, je n’ai pas dit ça. Pour le paquet YunoHost, il y a la subtilité qu’il faut lancer la synchro avec l’utilisateur duniter.

1 Like

Avec Mes 10 Go de ram ça n’est pas passé mais j’ai pas lancé la commande

export NODE_OPTIONS=--max-old-space-size=8192

donc je relance avec la commande ci dessus…

Résultat de l’échec:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Progress:

Milestones:   [||||||||||||||||||||] 100 %
Download:     [||||||||||||||||||| ] 98 %
Apply:        [||||||||||||||||||| ] 96 %
Sandbox:      [                    ] 0 %
Peers:        [                    ] 0 %

Status: GOT chunck #2478/2523 from 619500 to 619749 on peer duniter.g1.1000i100.fr
<--- Last few GCs --->

[1301:0x3838890] 88009363 ms: Scavenge 1327.0 (1437.6) -> 1311.9 (1437.6) MB, 4.5 / 0.0 ms  (average mu = 0.302, current mu = 0.320) allocation failure
[1301:0x3838890] 88009538 ms: Scavenge 1327.0 (1437.6) -> 1312.2 (1438.1) MB, 4.4 / 0.0 ms  (average mu = 0.302, current mu = 0.320) allocation failure
[1301:0x3838890] 88009822 ms: Scavenge 1327.7 (1438.1) -> 1312.6 (1438.6) MB, 182.0 / 0.0 ms  (average mu = 0.302, current mu = 0.320) allocation failure


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x25686a99e6c1 <JSObject>
    0: builtin exit frame: parse(this=0x25686a9919f9 <Object map = 0xc7bdf0042a9>,0x1a3fc2d22201 <Very long string[23438]>,0x25686a9919f9 <Object map = 0xc7bdf0042a9>)

    1: get [0x1c838637d271] [/opt/duniter/app/lib/dal/indexDAL/leveldb/LevelDBTable.js:~16] [pc=0x1c9f7264bd60](this=0x2d06b919d531 <LevelDBTable map = 0x1c8f57d9d8a1>,k=0x040afdf02801 <the_hole>)
    2: /* anonymous */ [0x1a3fc2...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fb090 node::Abort() [/opt/duniter//node/bin/node]
 2: 0x8fb0dc  [/opt/duniter//node/bin/node]
 3: 0xb031ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 4: 0xb03404 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/duniter//node/bin/node]
 5: 0xef7462  [/opt/duniter//node/bin/node]
 6: 0xef7568 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/opt/duniter//node/bin/node]
 7: 0xf03642 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 8: 0xf03f74 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/duniter//node/bin/node]
 9: 0xf06be1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/opt/duniter//node/bin/node]
10: 0xedbec0  [/opt/duniter//node/bin/node]
11: 0xedbf57 v8::internal::Factory::NewJSObject(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::PretenureFlag) [/opt/duniter//node/bin/node]
12: 0xfc7136 v8::internal::JsonParser<true>::ParseJsonObject() [/opt/duniter//node/bin/node]
13: 0xfc7f90 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
14: 0xfc8425 v8::internal::JsonParser<true>::ParseJsonArray() [/opt/duniter//node/bin/node]
15: 0xfc7fa0 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
16: 0xfc74dc v8::internal::JsonParser<true>::ParseJsonObject() [/opt/duniter//node/bin/node]
17: 0xfc7f90 v8::internal::JsonParser<true>::ParseJsonValue() [/opt/duniter//node/bin/node]
18: 0xfc8004 v8::internal::JsonParser<true>::ParseJson() [/opt/duniter//node/bin/node]
19: 0xbd7ad8 v8::internal::Builtin_JsonParse(int, v8::internal::Object**, v8::internal::Isolate*) [/opt/duniter//node/bin/node]
20: 0x1c9f6bb5bf7d
/usr/bin/duniter : ligne 15 :  1301 Abandon                 $NODE "$DUNITER_DIR/bin/duniter" "$@"

Salut j’ai refait une synchro avec l’utilisateur duniter mais ça ne change rien, le noeud synchronise jusqu’au bout mais toujours avec le retard à novembre 2022…