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.

Cannot execute a gradlew task that eventually starts an embedded Mongo twice on Windows

See original GitHub issue

Reproduction steps:

  1. Install Java 8
  2. Clone the repository at https://github.com/hiddenswitch/Spellsource-Server
  3. In Windows Powershell, run & ".\gradlew.bat net:local.
  4. Observe de.flapdoodle.embed.mongo correctly downloads and executes a mongod.
  5. SIGINT the process with Shift+Ctrl+C
  6. In Windows Powershell, run & ".\gradlew.bat net:local.
  7. Observe the following exception:
10:15:37.426 [main] ERROR d.f.e.p.runtime.AbstractProcess - failed to call onAfterProcessStart()
java.io.IOException: Could not start process: <EOF>
        at de.flapdoodle.embed.mongo.AbstractMongoProcess.onAfterProcessStart(AbstractMongoProcess.java:79) [de.flapdoodle.embed.mongo-e5232204c2.jar:na]
        at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:114) ~[de.flapdoodle.embed.process-2.0.1.jar:na]
        at de.flapdoodle.embed.mongo.AbstractMongoProcess.<init>(AbstractMongoProcess.java:53) [de.flapdoodle.embed.mongo-e5232204c2.jar:na]
        at de.flapdoodle.embed.mongo.MongodProcess.<init>(MongodProcess.java:50) [de.flapdoodle.embed.mongo-e5232204c2.jar:na]
        at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:44) [de.flapdoodle.embed.mongo-e5232204c2.jar:na]
        at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:34) [de.flapdoodle.embed.mongo-e5232204c2.jar:na]
        at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:101) [de.flapdoodle.embed.process-2.0.1.jar:na]
        at com.hiddenswitch.spellsource.util.LocalMongo.start(LocalMongo.java:66) [main/:na]
        at com.hiddenswitch.spellsource.util.Mongo.startEmbedded(Mongo.java:47) [main/:na]
        at com.hiddenswitch.spellsource.util.Mongo.connectWithEnvironment(Mongo.java:102) [main/:na]
        at com.hiddenswitch.spellsource.applications.Embedded.main(Embedded.java:22) [main/:na]
Mongo failed to start.
java.io.IOException: Could not start process: <EOF>
        at de.flapdoodle.embed.mongo.AbstractMongoProcess.onAfterProcessStart(AbstractMongoProcess.java:79)
        at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:114)
        at de.flapdoodle.embed.mongo.AbstractMongoProcess.<init>(AbstractMongoProcess.java:53)
        at de.flapdoodle.embed.mongo.MongodProcess.<init>(MongodProcess.java:50)
        at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:44)
        at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:34)
        at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:101)
        at com.hiddenswitch.spellsource.util.LocalMongo.start(LocalMongo.java:66)
        at com.hiddenswitch.spellsource.util.Mongo.startEmbedded(Mongo.java:47)
        at com.hiddenswitch.spellsource.util.Mongo.connectWithEnvironment(Mongo.java:102)
        at com.hiddenswitch.spellsource.applications.Embedded.main(Embedded.java:22)
  1. Delete the net\.mongo directory.
  2. Observe running & ".\gradlew.bat" net:local despite even deleting the directory does not resolve the issue.
  3. Observe restarting the computer does not resolve the issue.
  4. Observe that an equivalent sequence of steps produces no issues on Mac or Linux.

Thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bertramncommented, Jan 18, 2018

I am able to reproduce the issue on Windows 7 with flapdoodle mongo version 2.0.1 which defaults to mongo version 3.6.0. From what I can tell is that MongoDB 3.6.x needs libeay32.dll and ssleay32.dll. Unless both are available on the PATH the error above matches what I can see.

The flapdoodle process extracts the mongod.exe from the zip and copies it to %TEMP%. From mongo 3.6.0, it will also have to copy the 2 dlls to that location or probably less prone to interference, create a sub directory in %TEMP% and extract all 3 files to it.

So to fix it temporarily just download the win zip distro from mongo website and extract the above dlls to %TEMP% folder which is something like C:\Users\fred\AppData\Local\Temp.

0reactions
michaelmosmanncommented, Oct 17, 2022

… if this is still an issue, please reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flapdoodle Embedded Mongo process won't start
I am using the flapdoodle embedded mongo package to achieve this, but getting an error while attempting to start the tests. My build.gradle...
Read more >
Learning the Basics - Gradle User Manual
Gradle represents the scope of a dependency with the help of a Configuration. Every configuration can be identified by a unique name. Many...
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
Realm: Create reactive mobile apps in a fraction of the time
Install Realm as a Gradle plugin. Step 1: Add the class path dependency to the project level build.gradle file. Copy to clipboard buildscript...
Read more >
WhatsNew 2.0 | Ktor Framework
Maven: ktor-server-test-host-jvm causes dependency error starting from Ktor ... Can't run Ktor Gradle Plugin tasks using IDEA Gradle menu.
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