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

Could not set executable bit for mongod #5

Closed
fjmorel opened this issue Aug 3, 2022 · 4 comments · Fixed by #6
Closed

Could not set executable bit for mongod #5

fjmorel opened this issue Aug 3, 2022 · 4 comments · Fixed by #6

Comments

@fjmorel
Copy link

fjmorel commented Aug 3, 2022

One of my coworkers is encountering this exception when trying to use this library. It's probably something in their environment, but am flagging it just in case.

System.IO.IOException
Could not set executable bit for '{test project path}/bin/Debug/net6.0/runtimes/osx-x64/native/mongodb/bin/mongod'
   at EphemeralMongo.Core.FileSystem.MakeFileExecutable(String path)
   at EphemeralMongo.Core.MongoRunner.RunInternal()
   at EphemeralMongo.Core.MongoRunner.Run(MongoRunnerOptions options)
   at BaseMongoCollectionFixture..ctor() in {project path}/BaseMongoCollectionFixture.cs:line 49

This machine worked fine with the latest Mongo2Go. We're all using .NET 6. They upgraded to the latest version of the SDK just in case. This library is working fine for other developers and in GitHub Actions.

P.S. thanks for putting this out there! MongoDB 6 support in our tests helps us feel confident about code using newer aggregation features.

@asimmon
Copy link
Owner

asimmon commented Aug 3, 2022

Thanks for reporting the issue! I'll try to reproduce it on my macbook. For an unknown reason yet, chmod +x is failing.
It might be an option to swallow the error and continue the code execution, I keep you updated.

FYI, Mongo2Go does the same thing (chmod +x, see here and here). The only difference is that Mongo2Go targets mongod from the NuGet package cache directory, whereas EphemeralMongo targets mongod in the build output.

@fjmorel
Copy link
Author

fjmorel commented Aug 3, 2022

It works now. Here's what we tried:

  1. Delete bin/obj folders and rebuild
  2. Updated Rider
  3. Updated .NET SDK
  4. Updated macOS
  5. Cloning the repo to new a folder

None of those worked.

However, cloning to a new folder inside ~/Documents/ instead of ~/other folder worked!

I'll close this since it seems to have just been a weird file system permission issue.

@fjmorel fjmorel closed this as completed Aug 3, 2022
@asimmon
Copy link
Owner

asimmon commented Aug 5, 2022

Hi @fjmorel the issue is in EphemeralMongo's code. Your coworker used a path with a space, and it was not properly escaped. It does not happen often with Mongo2Go because it usually locates mongod in the nuget package directory - its path does not contain spaces. I'll escape the paths and publish a new version very soon.

@asimmon
Copy link
Owner

asimmon commented Aug 5, 2022

It's fixed in 0.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants