Open wohali opened 4 years ago
This is a weird one.
Using the couchdbdev/ppc64le-debian-stretch-erlang-20.3.8.22-1
image, I tried different things and got errors from different packages that referenced this same 5.104235503814077e+38
value.
After more digging, I figure out that parseInt()
and similar functions are returning this value when it should be returning NaN
for non-integer inputs. Since NaN
is a falsy in JS, you can imagine this can cause a ton of issues. Unfortunately I couldn't find out why this is happening nor any solutions. Maybe it's Docker related?
On couchdbdev/ppc64le-debian-stretch-erlang-20.3.8.22-1
:
> root@b7f5e29e134c:/usr/src/couchdb-fauxton# node -v
v10.16.3
root@b7f5e29e134c:/usr/src/couchdb-fauxton# node
> parseInt('', 10)
5.104235503814077e+38
> parseFloat('')
5.104235503814077e+38
>
On my Mac:
β node -v
v10.16.3
β node
> parseInt('', 10)
NaN
> parseFloat('')
NaN
>
Were you running this on an Intel CPU or on a POWER platform?
My guess is it's a bug in qemu. I have on my plate to try a newer qemu (build from source) but I can't confirm.
It seems upgrading to node 12 is one workaround. I tested with the following Dockerfile:
FROM node:12-stretch-slim
RUN apt-get update && apt-get install -y git; \
git clone https://github.com/apache/couchdb-fauxton.git; \
cd couchdb-fauxton; \
npm install --production && ./node_modules/grunt-cli/bin/grunt couchdb
Using base image node:10-stretch-slim
results in the ERR_OUT_OF_RANGE
error.
Also confirmed the workaround using our CI image created by NODEVERSION=12 ./build.sh platform debian-stretch
and the following Dockerfile:
FROM couchdbdev/debian-stretch-erlang-20.3.8.22-1:latest
WORKDIR /usr/src
USER root
RUN apt-get update && apt-get install -y git; \
git clone https://github.com/apache/couchdb-fauxton.git; \
cd couchdb-fauxton; \
npm install --production && ./node_modules/grunt-cli/bin/grunt couchdb
Logfile output after applying the patch in #1233 π
Logfile attached, not much to see there.
2019-10-10T20_54_24_219Z-debug.log
Split from #1229