duckdb / duckdb-node

MIT License
57 stars 27 forks source link

can't install prebuilt binary, server response is 403 Forbidden #95

Open azmy60 opened 5 months ago

azmy60 commented 5 months ago

Hey!

Using this repo, I got 403 forbidden error after running yarn install:

image

I'm not sure if anyone else also experienced this, or my IP region is not allowed for some reason?

carlopi commented 5 months ago

How did you got that? v0.0.2 looks wrong, need to double check.

carlopi commented 5 months ago

Links should be in the form: duckdb-v0.10.2-dev5.0-node-v108-linux-x64.tar.gz

Can you share some more context?

azmy60 commented 5 months ago

I cloned this repo, and I just simply run yarn. Also tried npm install after I realized it uses package-lock.json, but still got the same result.

image

NPM: 9.5.1 Node: 18.16.0

azmy60 commented 5 months ago

So the version in package.json is 0.0.2-dev5.0. Changing it to 0.10.2-dev5.0 fixes it for me.

https://github.com/duckdb/duckdb-node/blob/a5ec8f3f48c0f8a74007f95c06ac8908d0ca382e/package.json#L5

I feel like this could be the reason why when I installed duckdb last time it took 20 minutes or so? https://github.com/duckdb/duckdb-node/issues/70

ryan-williams commented 5 months ago

This Gitlab action just got a 403 from duckdb-node.s3.amazonaws.com/duckdb-v0.10.0-node-v127-linux-x64.tar.gz, output this line:

Pre-built binaries not installable for duckdb@0.10.0 and node@22.2.0 (node-v127 ABI, glibc) (falling back to source compile with node-gyp) 

and has been slowly compiling for 18 mins. This job usually finishes in under a minute.

Update: previous successful run fetched from duckdb-node.s3.amazonaws.com/duckdb-v0.10.0-node-v120-linux-x64.tar.gz, which also 200's for me now.

Seems like maybe my Gitlab runner is using a newer Node today, and there's not a v0.10.0 for that version? Not sure how to interpret node-v120 vs. node-v127, but the error message above implies the latter corresponds to node@22.2.0?

azmy60 commented 5 months ago

So it looks like node-pre-gyp looks for version in package.json and we need a way to match that and the actual pre-built binaries version. If that's the issue, I have two solutions I can think of:

  1. Just update the version in package.json to match with the binaries version.
  2. Or specify the version when building the binaries following the package.json version, like how grpc works on their build script.
azmy60 commented 5 months ago

Ok. It works fine if I install duckdb from npm, but the weird thing is the version in npm is different from this repo.

package.json in npmjs.com

package.json in npmjs.com

package.json in duckdb-node repo

package.json in duckdb-node repo

Pertempto commented 5 months ago

the weird thing is the version in npm is different from this repo.

Yeah, this is really strange to me.

We're blocked from using duckdb because we can't install it on our linux servers without getting an error

npm error command sh -c node-pre-gyp install --fallback-to-build

from what we can tell this is directly connected to this issue

pajarom commented 2 months ago

I am experiencing a similar problem... I am unable to install duckdb with npm in Ubuntu 24.04:

gyp info using node-gyp@9.3.0
gyp info using node@18.19.1 | linux | x64
gyp info spawn make

First I had to run it in a python 2.7 to be able to run node-pre-gyp

Then I get:

ERR! install response status 403 Forbidden on https://npm.duckdb.org/duckdb/duckdb-v0.0.2-dev5.0-node-v109-linux-x64.tar.gz This is triggering a full build but failing at ICU extension compilation:

../src/duckdb/extension/icu/third_party/icu/i18n/region.cpp: In static member function ‘static const icu_66::Region* icu_66::Region::getInstance(int32_t, UErrorCode&)’:
../src/duckdb/extension/icu/third_party/icu/i18n/region.cpp:515:9: error: ‘ICU_Utility’ has not been declared
  515 |         ICU_Utility::appendNumber(id, code, 10, 1);
      |         ^~~~~~~~~~~
In file included from ../src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp:333:
../src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp: In member function ‘icu_66::VTimeZone& icu_66::VTimeZone::operator=(const icu_66::VTimeZone&)’:
../src/duckdb/extension/icu/third_party/icu/i18n/vtzone.cpp:1004:33: warning: implicitly-declared ‘icu_66::BasicTimeZone& icu_66::BasicTimeZone::operator=(const icu_66::BasicTimeZone&)’ is deprecated [-Wdeprecated-copy]
 1004 |         BasicTimeZone::operator=(right);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp:31:1: note: because ‘icu_66::BasicTimeZone’ has user-provided ‘icu_66::BasicTimeZone::BasicTimeZone(const icu_66::BasicTimeZone&)’
   31 | BasicTimeZone::BasicTimeZone(const BasicTimeZone& source)
      | ^~~~~~~~~~~~~
make: *** [duckdb.target.mk:535: Release/obj.target/duckdb/src/duckdb/ub_extension_icu_third_party_icu_i18n.o] Error 1
make: Leaving directory '/home/user/datadev/fullstack/duckdb-node/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
gyp ERR! System Linux 6.8.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/share/nodejs/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/user/datadev/fullstack/duckdb-node/lib/binding/duckdb.node" "--module_name=duckdb" "--module_path=/home/user/datadev/fullstack/duckdb-node/lib/binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v109"
gyp ERR! cwd /home/user/datadev/fullstack/duckdb-node
gyp ERR! node -v v18.19.1
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok 

I have tried to install it from source but I was only able to complete the build by removing all the icu files from binding.gyp. The resulting library does not work due to missing ICU symbols.

I am able to install duckdb with ICU extension in this same system... The problem is only happening with duckdb-node.

Thanks!

ahj3859 commented 1 month ago

Hello. In my case, (Ubuntu 24.04, node version 18.19.1, npm version 9.2.0.)

if the webstorm automatically proceeds with npm installation, it will no longer proceed in the following state. (##################) ⠧ reify:duckdb: timing reifyNode:node_modules/@observablehq/plot Completed in 4911ms

After a long time, the following error occurs. (If I try to install dukdb directly with the npm install duckdb@1.0.0 command, there is an error immediately below without waiting time.)

npm ERR! Failed to execute '/usr/bin/node /usr/share/nodejs/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/webstorm_workspace/node_modules/duckdb/lib/binding/duckdb.node --module_name=duckdb --module_path=/home/webstorm_workspace/node_modules/duckdb/lib/binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v109' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11 npm ERR! node-pre-gyp info using node@18.19.1 | linux | x64 npm ERR! node-pre-gyp info check checked for "/home/webstorm_workspace/node_modules/duckdb/lib/binding/duckdb.node" (not found) npm ERR! node-pre-gyp http GET https://npm.duckdb.org/duckdb/duckdb-v1.0.0-node-v109-linux-x64.tar.gz npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://npm.duckdb.org/duckdb/duckdb-v1.0.0-node-v109-linux-x64.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for duckdb@1.0.0 and node@18.19.1 (node-v109 ABI, glibc) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://npm.duckdb.org/duckdb/duckdb-v1.0.0-node-v109-linux-x64.tar.gz