sjudson / paseto.js

PASETO: Platform-Agnostic Security Tokens
MIT License
269 stars 16 forks source link

Invalid encoding detected #25

Closed gaurav-narra closed 4 years ago

gaurav-narra commented 4 years ago

Checked from my production logs that I get Invalid encoding detected the first time and then the all the requests crash with the following error, even though the token is valid.

Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 83886080, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error: 

There was enough memory on the instance. Once we restart the instance the issue disappears, does not show any sign of memory being increased.

Exception here is condensed probably can remove the catch for better debugging.

PCouaillier commented 4 years ago

Are you using something like "--max-old-space-size" ? The v8 has a default limit which might be less than your RAM.

An other possible answer is that you're not giving a valid utf8 string. Is your data compressed ?

(I'm not the owner of this lib so I can't help you deeply...)

sjudson commented 4 years ago

I'm not going to remove the catch in the library for your local debugging, especially as Node allows you to remove it within node_modules in e.g. your dev env to try and replicate it. Can't really say much else without replication steps.

sjudson commented 4 years ago

I'm going to close this. Feel free to reopen if you get reproduction steps.