question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postinstall disabled, but still runs

See original GitHub issue

Hello!

Thank you for this package!

I have a build environment which uses a docker image to build. Unfortunately I cannot use auto-download, baceuse corporate proxy and http-proxy-agent fails…

However, I can download the mongod binary with wget before installing the mongodb-memory-server package.

I downloded the package, decompressed, set +x, and exported the MONGOMS_SYSTEM_BINARY to the absolute path of the binary (/builds/company/project-core/node_modules/mongodb-binary/bin/mongod)

mongod --version prints the following:

db version v4.0.3
git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
OpenSSL version: OpenSSL 1.1.0k  28 May 2019
allocator: tcmalloc
modules: none
build environment:
    distmod: debian92
    distarch: x86_64
    target_arch: x86_64

However the build fails with:

error /builds/company/project-core/node_modules/mongodb-memory-server: Command failed.
Exit code: 1
Command: node ./postinstall.js
Arguments: 
Directory: /builds/company/project-core/node_modules/mongodb-memory-server
Output:
mongodb-memory-server: checking MongoDB binaries cache...
events.js:186
      throw er; // Unhandled 'error' event
      ^

Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1317:34)
    at TLSSocket.emit (events.js:209:13)
    at TLSSocket._finishInit (_tls_wrap.js:792:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:606:12)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:209:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

Since MONGOMS_SYSTEM_BINARY is set, I would not expect that mongodb-memory-server wants to download in the postinstall step.

Could you help me what am I missing, please?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hasezoeycommented, Oct 31, 2020

@sinashk78

setting MONGOMS_DISABLE_POSTINSTALL to 1 before creating an instance oo the MemoryServer and it didnt work

DISABLE_POSTINSTALL is to disable the npm hook postinstall, not the runtime one, i think for that you search for #355

And then we tried adding the config below and setting the binary “version”: “6.9.2”,

the VERSION config option is to set the mongod version to download, not the package version, for that you have the dependencies / devDependencies section

(and version of mongodb above 4.4 dosnt exist yet)

“systemBinary”: “mongod path”

in 6.9.x the systemBinary is checked if it exists and is an file and then used, otherwise an mongod file will be downloaded according to the other options

and while we’re trying to work things out on his machine everything was working on my end.

when you use the same config options for both systems (yours and your friends), then it is most likely that the SYSTEM_BINARY path just dosnt exists for your friend

0reactions
hasezoeycommented, Nov 2, 2020

until proven otherwise, i will close this as fixed by #405

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm: disable postinstall script for package - Stack Overflow
I wanted to disable postinstall script for my project but wanted all scripts of my project's dependencies to run when I do npm...
Read more >
Disable WSUS postinstall prompt - WSUS up and running but ...
Hello,. We have a problem with a WSUS installation on a 2012 R2 Server. I have moved the SUSDB to a SQL Server...
Read more >
Postinstall scripts are not being run(solved)
I'm trying to get my server up and running, but the process is everything but transparent. My server uses Prisma (an ORM), which...
Read more >
Preventing npm from Executing Arbitrary Scripts - NerdyCode
One solution is to disable running scripts by default, but this doesn't come without its own issues, as we'll see. Ignoring npm Scripts...
Read more >
Change Installation Settings after Installation - Tableau Help
To enable Web Page objects again, run the same command but specify -integer 1 instead of -integer 0 . Disable Dashboard extensions (Tableau...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found