terra-ops / terra-cli

The Terra Command Line Interface
http://terra.readthedocs.org
GNU General Public License v2.0
48 stars 17 forks source link

terra e:enable: Unable to clone repository. Check app settings and try again. #79

Open jlyon opened 8 years ago

jlyon commented 8 years ago

I have been trying to enable an app with a large repo (1gb) and I am getting this error:

Unable to clone repository. Check app settings and try again.

Oddly enough, it looks like the repo is getting cloned properly (and completely). If I run terra e:enable again the env gets enabled and all is well.

jonpugh commented 8 years ago

might be timing out?

jlyon commented 8 years ago

yeah, i think maybe the php script is timing out or something? the full repo does get cloned. I've had similar issues with other smaller repos on my localhost.

jonpugh commented 8 years ago

Hmm... Since we use https://github.com/cpliakas/git-wrapper it is really in their code...

We call "clone" at https://github.com/terra-ops/terra-cli/blob/master/src/terra/Factory/EnvironmentFactory.php#L85

That error is from our code and is really dumb... we need better exceptions thrown there.

Let's dig in and figure out what is really causing the problem.

Can you post additional error messages right before that one?

We can also look into if the git-wrapper uses symfony Process and setTimeout(null).

asgorobets commented 8 years ago

GitWrapper has a timeout of 60 seconds if not specified otherwise. We might want to modify this timeout for terra, as GitWrapper is configurable to do that.

For example:

$wrapper = new GitWrapper();
$wrapper->setTimeout($this->getTimeout());
kynetiv commented 8 years ago

Just wanted to share I ran into this where cloning was taking too long for whatever reason. I thought I might just clone it myself somewhere and let environment:add know the path to the cloned copy but then ran into the reverse error that:

Git clone already exists at that path, but it is not for this app.

As a workaround I ended up just manually adding the environment to the ~/.terra/terra file and it was fine.