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 with Failed to recurse into submodule path 'mongo-c-driver' #152

Closed
pgloader opened this issue Aug 24, 2021 · 5 comments
Closed

Comments

@pgloader
Copy link

git clone --recursive https://github.com/EnterpriseDB/mongo_fdw.git
Cloning into 'mongo_fdw'...
remote: Enumerating objects: 1053, done.
remote: Counting objects: 100% (318/318), done.
remote: Compressing objects: 100% (205/205), done.
remote: Total 1053 (delta 230), reused 189 (delta 105), pack-reused 735
Receiving objects: 100% (1053/1053), 619.10 KiB | 0 bytes/s, done.
Resolving deltas: 100% (658/658), done.
Submodule 'mongo-c-driver' (https://github.com/mongodb/mongo-c-driver.git) registered for path 'mongo-c-driver'
Cloning into 'mongo-c-driver'...
remote: Enumerating objects: 162341, done.
remote: Counting objects: 100% (14879/14879), done.
remote: Compressing objects: 100% (961/961), done.
remote: Total 162341 (delta 14227), reused 14435 (delta 13906), pack-reused 147462
Receiving objects: 100% (162341/162341), 78.33 MiB | 3.17 MiB/s, done.
Resolving deltas: 100% (146485/146485), done.
Submodule path 'mongo-c-driver': checked out '2929c2d2c856a57ecdfef4d61f8e479b6ef96463'
Submodule 'src/libbson' (git://github.com/mongodb/libbson.git) registered for path 'src/libbson'
Cloning into 'src/libbson'...
fatal: unable to connect to github.com:
github.com[0: 140.82.112.4]: errno=Connection timed out

Clone of 'git://github.com/mongodb/libbson.git' into submodule path 'src/libbson' failed
Failed to recurse into submodule path 'mongo-c-driver'

@andreasscherbaum
Copy link
Collaborator

The problem is:
github.com[0: 140.82.112.4]: errno=Connection timed out
Please make sure that your system can reach github.com. This is a client-side problem. Given that you are already checking out from GitHub, the problem should be transient.

@pgloader
Copy link
Author

Thanks for your prompt reply. I downloaded mongo_fdw-master.zip instead.
When I ran autogen.sh, I got
"
CMake Error at cmake_install.cmake:46 (file):
file cannot create directory: /usr/local/share/mongo-c-driver. Maybe need
administrative privileges."

How to install in another directory where I can write?

@pgloader
Copy link
Author

"Note: Make sure you have permission to "/usr/local" (default installation location) folder."

What's the option if I don't have permission to /usr/local ?

@jeevanladhe
Copy link

Unfortunately currently autogen.sh does not have a way to direct the mongo-c and json-c to a custom directory.
Meanwhile see if you can make following change in the autogen.sh and get yourself unblocked:

diff --git a/autogen.sh b/autogen.sh
index 6ba463e..2f43b37 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -71,7 +71,7 @@ function checkout_json_lib
 function install_json_lib
 {
        cd json-c &&
-       $CMAKE_COMMAND $JSONC_CFLAGS . &&
+       $CMAKE_COMMAND -DCMAKE_INSTALL_PREFIX=$PWD/json-c-install $JSONC_CFLAGS . &&
        make install &&
        cd ..
 }
@@ -82,7 +82,7 @@ function install_json_lib
 function install_mongoc_driver
 {
        cd mongo-c-driver &&
-       $CMAKE_COMMAND -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_SSL=AUTO . &&
+       $CMAKE_COMMAND -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DCMAKE_INSTALL_PREFIX=$PWD/mongo-c-install -DENABLE_SSL=AUTO . &&
        make install &&
        cd ..
 }

This will need you to probably set C_INCLUDE_PATH and LD_LIBRARY_PATH per your install location to get the mongo-fdw compiled and linked successfully.

e.g.
export C_INCLUDE_PATH=$PWD/mongo-c-driver/mongo-c-install/include:$PWD/mongo-c-driver/mongo-c-install/include/libmongoc-1.0:$PWD/mongo-c-driver/mongo-c-install/include/libbson-1.0

Regards,
Jeevan Ladhe

@pgloader
Copy link
Author

The build was successful after set C_INCLUDE_PATH and PKG_CONFIG_PATH to json_lib_install/lib64/pkgconfig:mongo-c-driver_install/lib64/pkgconfig

Thanks !

jeevanladhe added a commit that referenced this issue Sep 10, 2021
autogen.sh helps in avoiding manual installation and automates the
download and installation of the appropriate drivers and libraries
including mongo-c and json-c driver. But, these drivers get
installed at the default locations e.g. /usr/lib/, and user might
not have permission to write in this directory. This results in
autogen.sh failure. Use environment variables MONGOC_INSTALL_DIR
and JSONC_INSTALL_DIR in autogen.sh to set CMAKE_INSTALL_PREFIX to
allow custom directory installation for these drivers where the user
might have permission.

Reported on GitHub through issue #152 by user pgloader.

FDW-406, Vaibhav Dalvi, reviewed by Jeevan Ladhe,
tested by Rajkumar Raghuwanshi.
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

No branches or pull requests

3 participants