Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download failed for url https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz #893

Closed
natlibfi-jonollil opened this issue Oct 10, 2024 · 9 comments · Fixed by nodeshift/mern-workshop#251
Labels
bug Module: Version-String Generation This problem is because of the Version-String Generation (MongoBinaryDownloadUrl) released on @old/9.x released Pull Request released | Issue is fixed

Comments

@natlibfi-jonollil
Copy link

natlibfi-jonollil commented Oct 10, 2024

Versions

  • NodeJS: 20.17.0
  • mongodb-memory-server-*: 10.1.0
  • mongodb(the binary version): 0
  • mongodb(the js package): 6.9.0
  • system: fedora 40

package: mongo-memory-server

What is the Problem?

When doing fresh npm install, memory server packet is not available from default download url

Debug Output

Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error:
 DownloadError: Download failed for url "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz", Details:
Status Code is 403 (MongoDB's 404)
This means that the requested version-platform combination doesn't exist
Try to use different version 'new MongoMemoryServer({ binary: { version: 'X.Y.Z' } })'
List of available versions can be found here: https://www.mongodb.com/download-center/community/releases/archive

Do you know why it happenes?

This is only guess, but 403 points that default version is not available.
https://www.mongodb.com/try/download/community-edition/releases/archive
Link on error message points same direction. There is mongo 8 and 7.0.12 but no 7.0.14.
Is it taken out?

Fix im gonna test

export MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-rhel8-8.0.0.tgz
export MONGOMS_VERSION=8.0.0

@natlibfi-jonollil
Copy link
Author

Test results on mongo 8.0.0

Starting the MongoMemoryServer Instance failed, enable debug log for more information. Error:
 UnexpectedCloseError: Instance closed unexpectedly with code "255" and signal "null"

So i swapped to:
MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.12.tgz
MONGOMS_VERSION=7.0.12

And it seems to fix my case.

@hasezoey hasezoey changed the title Download failed for url "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz" Download failed for url https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz Oct 10, 2024
@hasezoey
Copy link
Member

Test results on mongo 8.0.0

for that i would need more debug logs to see what the error is (likely some kind of library problem)

https://www.mongodb.com/try/download/community-edition/releases/archive

7.0.14 is the currently latest on the 7.0 branch, which is not listed in /archive but in / ( https://www.mongodb.com/try/download/community-edition/releases/)


thanks for the report, i will try getting in contact with mongodb as they have seemingly changed, the release this time is not rhel80 but rhel8, this seemingly only applies to rhel 8 not rhel 7 or 9 (seemingly it also applies to all latest mongodb versions across 5, 6, 7 and 8, but seemingly only for the latest versions?)

TL;DR: use export MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-rhel8-7.0.14.tgz

@hasezoey hasezoey added the Module: Version-String Generation This problem is because of the Version-String Generation (MongoBinaryDownloadUrl) label Oct 10, 2024
@hasezoey
Copy link
Member

hasezoey commented Oct 10, 2024

Update: found a existing JIRA issue (SERVER-92375) about this, so it is intentional and we have to change.

will try to put up a fix as 10.1.1

Copy link

🎉 This issue has been resolved in version 10.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Pull Request released | Issue is fixed label Oct 10, 2024
@natlibfi-jonollil
Copy link
Author

natlibfi-jonollil commented Oct 11, 2024

I updated to 10.1.1 and cleaned .cache folder etc. on default it is still generating "rhel80" on local machine, but on CI/CD pipe it seems to get right one. Any ideas why?

MongoMS:DryMongoBinary generateDownloadPath: no existing binary for version "7.0.14" was found +1ms
  MongoMS:DryMongoBinary generateDownloadPath: using resolveConfig (DOWNLOAD_DIR) "/home/user/.cache/mongodb-binaries/mongod-x64-fedora-7.0.14" +0ms
  MongoMS:DryMongoBinary getBinaryName +0ms
  MongoMS:DryMongoBinary combineBinaryName +0ms
  MongoMS:MongoBinaryDownload startDownload +1ms
  MongoMS:MongoBinaryDownloadUrl Using "mongodb-linux-x86_64-rhel80-7.0.14.tgz" as the Archive String +0ms
  MongoMS:MongoBinaryDownloadUrl Using "https://fastdl.mongodb.org" as the mirror +0ms
  MongoMS:MongoBinaryDownload download +1ms
  MongoMS:MongoBinaryDownload download: Downloading: "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz" +1ms
  MongoMS:MongoBinaryDownload httpDownload +0ms
  MongoMS:MongoBinaryDownload httpDownload: trying to download "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz" +0ms
  MongoMS:MongoBinary download: Removing Download lock +567ms
  MongoMS:LockFile unlock: Unlocking file "/home/user/.cache/mongodb-binaries/7.0.14.lock" +567ms
  MongoMS:LockFile checkLock: for file "/home/user/.cache/mongodb-binaries/7.0.14.lock" with uuid: "670fea52-3a78-4e1d-b734-4af3b9ef5c8a" +0ms
  MongoMS:LockFile checkLock: Lock File Already exists, and is for *this* process, with uuid: "670fea52-3a78-4e1d-b734-4af3b9ef5c8a" +1ms
  MongoMS:LockFile unlock: Lock Status was "availableInstance" for file "/home/user/.cache/mongodb-binaries/7.0.14.lock" +0ms
  MongoMS:LockFile unlockCleanup: for file "/home/user/.cache/mongodb-binaries/7.0.14.lock" +0ms
  MongoMS:MongoBinary download: Download lock removed +2ms
  MongoMS:MongoMemoryServer Mongo[unknown]: _startUpInstance threw a Error:  DownloadError: Download failed for url "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz", Details:
Status Code is 403 (MongoDB's 404)
This means that the requested version-platform combination doesn't exist
Try to use different version 'new MongoMemoryServer({ binary: { version: 'X.Y.Z' } })'
List of available versions can be found here: https://www.mongodb.com/download-center/community/releases/archive
    at RedirectableRequest.<anonymous> (/home/user/github/project-to-work-on/node_modules/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts:383:17)
    at RedirectableRequest.emit (node:events:519:28)
    at RedirectableRequest._processResponse (/home/user/github/project-to-work-on/node_modules/follow-redirects/index.js:409:10)
    at ClientRequest.RedirectableRequest._onNativeResponse (/home/user/github/project-to-work-on/node_modules/follow-redirects/index.js:102:12)
    at Object.onceWrapper (node:events:634:26)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:709:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:551:22)
    at TLSSocket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at TLSSocket.Readable.push (node:internal/streams/readable:390:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23) {
  url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-7.0.14.tgz',
  msg: "Status Code is 403 (MongoDB's 404)\n" +
    "This means that the requested version-platform combination doesn't exist\n" +
    "Try to use different version 'new MongoMemoryServer({ binary: { version: 'X.Y.Z' } })'\n" +
    'List of available versions can be found here: https://www.mongodb.com/download-center/community/releases/archive'
} +574ms

@hasezoey
Copy link
Member

on default it is still generating "rhel80" on local machine, but on CI/CD pipe it seems to get right one. Any ideas why?

sorry, the change only applied to rhel, not fedora (currently fedora handling is completely separate), will fix shortly

hasezoey added a commit that referenced this issue Oct 11, 2024
… to rhel

but set the mapping to rhel version first, like linux mint to ubuntu.

fixes #893
Copy link

🎉 This issue has been resolved in version 10.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@natlibfi-jonollil
Copy link
Author

Seems to work now! Thanks a lot!

hasezoey added a commit that referenced this issue Nov 1, 2024
… to rhel

but set the mapping to rhel version first, like linux mint to ubuntu.

fixes #893
Copy link

github-actions bot commented Nov 1, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Module: Version-String Generation This problem is because of the Version-String Generation (MongoBinaryDownloadUrl) released on @old/9.x released Pull Request released | Issue is fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants