unrecognised option '--noprealloc' during start of MongoDB
See original GitHub issueHi,
I’m trying to use Embedded MongoDB 4.41 on a SUSE Enterprise 12 server.
With the default configuration, an invalid download URL is generated (https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.4.1.tgz).
For MongoDB 4.4.1, there doesn’t seem to be a generic linux version any more - only distribution-specific versions.
So I changed the version:
starter.prepare(config, Distribution.of(() -> "suse12-4.4.1", Platform.Linux, BitSize.detect()))
Now MongoDB is being successfully downloaded (from https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-suse12-4.4.1.tgz), but starting fails with the following error:
Download com.bmw.qwin.supplierdata.boundary.SupplierDataResourceTest$$Lambda$408/0x0000000100309040@7ecca48:Linux:B64 START
Download com.bmw.qwin.supplierdata.boundary.SupplierDataResourceTest$$Lambda$408/0x0000000100309040@7ecca48:Linux:B64 DownloadSize: 71250531
Download com.bmw.qwin.supplierdata.boundary.SupplierDataResourceTest$$Lambda$408/0x0000000100309040@7ecca48:Linux:B64 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% 100% Download com.bmw.qwin.supplierdata.boundary.SupplierDataResourceTest$$Lambda$408/0x0000000100309040@7ecca48:Linux:B64 downloaded with 34790kb/s
Download com.bmw.qwin.supplierdata.boundary.SupplierDataResourceTest$$Lambda$408/0x0000000100309040@7ecca48:Linux:B64 DONE
Extract /home/qwin/.embedmongo/linux/mongodb-linux-x86_64-suse12-4.4.1.tgz START
Extract /home/qwin/.embedmongo/linux/mongodb-linux-x86_64-suse12-4.4.1.tgz extract mongodb-linux-x86_64-suse12-4.4.1/bin/mongod
Extract /home/qwin/.embedmongo/linux/mongodb-linux-x86_64-suse12-4.4.1.tgz nothing left
Extract /home/qwin/.embedmongo/linux/mongodb-linux-x86_64-suse12-4.4.1.tgz DONE
[mongod error]Error parsing command line: unrecognised option '--noprealloc'
[mongod error] try '/tmp/extract-6a3d4b31-a14e-4523-8d2f-9e699ddf02e5extractmongod --help' for more information
This command line option has apparently been removed (see https://docs.mongodb.com/manual/reference/configuration-options/#removed-mmapv1-options)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (1 by maintainers)
If it can be helpful, here’s a code that overrides
successMessage()
(great catch by the way @shahr) and makes the server start but I guess the library is hard to use anyway in any project at the moment given the issues and the backward-incompatible changes:And then do whatever you want with the executable.
@trailoff @martintheault I think there are 2 issues here (at least in my case):
The download of the mongo 4.4.x fails (as per @woswoasdeni original comment on the issue). I managed to fix that by providing customized download configuration as documented
After disabling the --noprealloc option, the
MongodExecutable#start()
does not return/blocks (despite the server appearing to have started correctly from the logs). This can solved by overriding the line I mentioned above (https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/blob/master/src/main/java/de/flapdoodle/embed/mongo/AbstractMongoProcess.java#L88) because, from what I can tell through digging into the code, the server’s log output is read and checked for that particular string to determine if the process has started correctly. Since mongo has changed the log format and messages in 4.4.x onwards, we need to override thesuccessMessage()
method so that it finds the correct log entry text.Hope that helps!