Node-sqlite3: Access Denied: Linux precompiled binaries

Created on 16 Oct 2020  路  7Comments  路  Source: mapbox/node-sqlite3

The URL https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz is returning an Access Denied error. (The v3 URL, https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v3-linux-x64.tar.gz, is fine.)

$ git clone https://github.com/mapbox/node-sqlite3.git
...
$ cd node-sqlite3/
$ npm install node-pre-gyp
...
$ ./node_modules/.bin/node-pre-gyp reveal
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
{
  "name": "sqlite3",
  "configuration": "Release",
  "module_name": "node_sqlite3",
  "version": "5.0.1",
  "prerelease": "",
  "build": "",
  "major": 5,
  "minor": 0,
  "patch": 1,
  "runtime": "node",
  "node_abi": "node-v72",
  "node_abi_napi": "napi",
  "napi_version": "6",
  "napi_build_version": 3,
  "node_napi_label": "napi-v3",
  "target": "",
  "platform": "linux",
  "target_platform": "linux",
  "arch": "x64",
  "target_arch": "x64",
  "libc": "glibc",
  "module_main": "./lib/sqlite3",
  "toolset": "",
  "host": "https://mapbox-node-binary.s3.amazonaws.com/",
  "module_path": "/usr/app/node-sqlite3/lib/binding/napi-v3-linux-x64",
  "module": "/usr/app/node-sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node",
  "remote_path": "./sqlite3/v5.0.1/",
  "package_name": "napi-v3-linux-x64.tar.gz",
  "staged_tarball": "build/stage/sqlite3/v5.0.1/napi-v3-linux-x64.tar.gz",
  "hosted_path": "https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/",
  "hosted_tarball": "https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v3-linux-x64.tar.gz"
}
{
  "name": "sqlite3",
  "configuration": "Release",
  "module_name": "node_sqlite3",
  "version": "5.0.1",
  "prerelease": "",
  "build": "",
  "major": 5,
  "minor": 0,
  "patch": 1,
  "runtime": "node",
  "node_abi": "node-v72",
  "node_abi_napi": "napi",
  "napi_version": "6",
  "napi_build_version": 6,
  "node_napi_label": "napi-v6",
  "target": "",
  "platform": "linux",
  "target_platform": "linux",
  "arch": "x64",
  "target_arch": "x64",
  "libc": "glibc",
  "module_main": "./lib/sqlite3",
  "toolset": "",
  "host": "https://mapbox-node-binary.s3.amazonaws.com/",
  "module_path": "/usr/app/node-sqlite3/lib/binding/napi-v6-linux-x64",
  "module": "/usr/app/node-sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node",
  "remote_path": "./sqlite3/v5.0.1/",
  "package_name": "napi-v6-linux-x64.tar.gz",
  "staged_tarball": "build/stage/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz",
  "hosted_path": "https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/",
  "hosted_tarball": "https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz"
}
node-pre-gyp info ok 
$ ./node_modules/.bin/node-pre-gyp reveal hosted_tarball --silent
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v3-linux-x64.tar.gz
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
$ curl -s -L -o napi-v6-linux-x64.tar.gz https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
$ cat napi-v6-linux-x64.tar.gz 
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>9A62407AA8EC561B</RequestId><HostId>XO6dyy/dS5Xks3WA3/cLZZDnJXRhUwkTeW0sqsyTVGuVAAty0fpJbF8M8U8G3UZAHn4lKmmMN1g=</HostId></Error>

Most helpful comment

Little update:
Pinning sqlite3 to 5.0.0 in my package.json at least let's me work with that version of sqlite3 and doesn't break build any more.
Would still be nice to get this resolved :)

{
  "dependencies": {
    "sqlite3": "5.0.0"
  }
}

All 7 comments

same for me here

EDIT

I found that my errors below were related to my environment setup and not the subject issue. Disregard my comments.

For anyone using WSL, make sure your project is stored on the linux file system (~/project/...) and not on the windows file system (/mnt/c/...). This was my problem.


I am trying to get Strapi up and running with npx create-strapi-app fueld-api --quickstart and I get this error(gist).

Looking into the log I notice an HTTP 403 - Forbidden return on a download for https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp)

No idea if this is an issue with strapi, sqlite3, or gyp. However, because I see the failed download is a sqlite3 package I figured I would report the issue to this repo first.

My Environment:

  • Windows 10 (10.0.19041.685)

    • WSL 1

    • Ubuntu-18.04



      • NPM 6.14.4


      • Node 12.18.0



Edit
This error also occurred when running npm install sqlite3 in an empty project. (See log)

Same over here installing sqlite3.
Package managers: npm, yarn and pnpm
Build envs:

Same 403 on the mapbox link while installing.

Only the relevant part:

node-pre-gyp info it worked if it ends with ok
--
34 | node-pre-gyp info using [email protected]
35 | node-pre-gyp info using [email protected] \| linux \| x64
36 | node-pre-gyp WARN Using request for node-pre-gyp https download
37 | node-pre-gyp info check checked for "/drone/src/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node" (not found)
38 | node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
39 | node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
40 | node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz
41 | node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, musl) (falling back to source compile with node-gyp)
42 | node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz

Little update:
Pinning sqlite3 to 5.0.0 in my package.json at least let's me work with that version of sqlite3 and doesn't break build any more.
Would still be nice to get this resolved :)

{
  "dependencies": {
    "sqlite3": "5.0.0"
  }
}

Same problem here, both on Windows and Linux. Couldn't install 4.2.0. Then tried doing latest, also failed. Specifying to install @5.0.0 worked though.

FWIW the error ultimately went away for me when I resolved npm install not working correctly (by wiping my cloned repository and doing a hard reset), so my guess here is that in at least some cases the real problem is node-pre-gyp generating an invalid URL, not a valid download being missing from the server.

Was this page helpful?
0 / 5 - 0 ratings