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.

DOWNLOAD_MIRROR behavior has changed

See original GitHub issue

Versions

  • NodeJS: 14.17.3
  • mongodb-memory-server-*: 7.3.1
  • mongodb(the binary version): 0.0.0
  • system:

package: mongo-memory-server-core

What is the Problem?

25c865c0a71e7d682eccb6f0e2895a11f9f092ef changed the behavior of the DOWNLOAD_MIRROR option - it is no longer possible to specify a path prefix.

Code Example

export MONGOMS_DOWNLOAD_MIRROR=https://artifactory.mydomain.com/artifactory/mongo-fastdl
npm install
npm test

The above results in:

     Error: Status Code isnt 200!
      at ClientRequest.<anonymous> (node_modules/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:391:20)
      at HTTPParser.parserOnIncomingClient (_http_client.js:641:27)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
      at TLSSocket.socketOnData (_http_client.js:509:22)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at TLSSocket.Readable.push (internal/streams/readable.js:223:10)
      at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
      at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:14)

Do you know why it happens?

The URL that is being hit is https://artifactory.mydomain.com/linux/mongodb-linux-x86_64-rhel70-4.0.25.tgz (it should be https://artifactory.mydomain.com/artifactory/mongo-fastdl/linux/mongodb-linux-x86_64-rhel70-4.0.25.tgz)

This replaces the path on the download mirror:

https://github.com/nodkz/mongodb-memory-server/blob/25c865c0a71e7d682eccb6f0e2895a11f9f092ef/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts#L55-L56

I think that the code needs to be a bit smarter about how it adds the path suffix - maybe something like this:

 const url = new URL(`${mirror.replace(/\/$/, '')}/${this.platform}/${archive}`); 
 return url.toString()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hasezoeycommented, Jul 24, 2021

this issue should be fixed with ae7ddab79fcbb637cdcd2c193554e9ba2907cf9e for runtime and 6a1636d4e319b27588a62cf66dfb8226b97d2022 for documentation

also there is #513

0reactions
stevenhaircommented, Jul 26, 2021

Thanks for the quick response!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox 98 download behavior change is back in 102 - fix?
Back in Firefox 98, Mozilla made a change to the default download behavior that many of us didn't like . There was a...
Read more >
Intel Ethernet Controller Products
This document provides an overview of the changes introduced in the latest Intel® Ethernet Controller/. Adapter family of products.
Read more >
The history of the Apache mirror system
The ASF system download mirrors evolved organically, and then systematically, over 25 years. It depended on many hours of labor by volunteers and...
Read more >
Plugable usb laptop dock tbt3-udz not recognizing both higher ...
I have a Lenovo T14 Gen 1 (type 20S0, 20S1) Laptop (ThinkPad) ... Interesting that switching out the monitors has changed the behavior....
Read more >
Hot keys in directory favourites not always shown. - Total Commander
This Windows behavior has been discussed a couple of times on this forum alone. It can be changed in Windows' accessibility settings, so...
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