Git clone failes when used in recipe


#1

I’ve written a recipe where I’m cloning a git repository using command,

git clone https://user:pwd@bitbucket.org/path/abc.git.

It is giving me out of memory error. Here is the log:

STDOUT: Cloning into ‘C:\ABC’…
STDERR: fatal: Out of memory, malloc failed (tried to allocate 267981487
bytes)
fatal: index-pack failed
fatal: write error: Invalid argument
fatal: write error: Invalid argument

Regards,
Ravindra


#2

Have you tried using the git resource?

http://docs.opscode.com/resource_git.html

On Tue, Nov 19, 2013 at 9:52 AM, Ravindra ravindra.chandrakar@gmail.comwrote:

I’ve written a recipe where I’m cloning a git repository using command,

git clone https://user:pwd@bitbucket.org/path/abc.git.

It is giving me out of memory error. Here is the log:

STDOUT: Cloning into ‘C:\ABC’…
STDERR: fatal: Out of memory, malloc failed (tried to allocate 267981487
bytes)
fatal: index-pack failed
fatal: write error: Invalid argument
fatal: write error: Invalid argument

Regards,
Ravindra


#3

Hello Nic,

As per my understanding git resource does not work for private
repositories. Please correct me if my undestanding is worng.

Regards,
Ravindra

On 11/19/13, Nic Grayson nic.grayson@banno.com wrote:

Have you tried using the git resource?

http://docs.opscode.com/resource_git.html

On Tue, Nov 19, 2013 at 9:52 AM, Ravindra
ravindra.chandrakar@gmail.comwrote:

I’ve written a recipe where I’m cloning a git repository using command,

git clone https://user:pwd@bitbucket.org/path/abc.git.

It is giving me out of memory error. Here is the log:

STDOUT: Cloning into ‘C:\ABC’…
STDERR: fatal: Out of memory, malloc failed (tried to allocate 267981487
bytes)
fatal: index-pack failed
fatal: write error: Invalid argument
fatal: write error: Invalid argument

Regards,
Ravindra


#4

On Tuesday, November 19, 2013 at 9:03 AM, Ravindra Chandrakar wrote:

Hello Nic,

As per my understanding git resource does not work for private
repositories. Please correct me if my undestanding is worng.

Regards,
Ravindra

The git resource works fine with private repos. You need to configure your authentication credentials so that root can login to github.


Daniel DeLeo


#5

Daniel, Thanks for the info. I’m not sure how to achieve this.

In my case, I’m installing git client at run time using recipe and then
cloning the repo.

Regards,
Ravindra

On Tue, Nov 19, 2013 at 11:51 PM, Daniel DeLeo dan@kallistec.com wrote:

On Tuesday, November 19, 2013 at 9:03 AM, Ravindra Chandrakar wrote:

Hello Nic,

As per my understanding git resource does not work for private
repositories. Please correct me if my undestanding is worng.

Regards,
Ravindra

The git resource works fine with private repos. You need to configure your
authentication credentials so that root can login to github.


Daniel DeLeo


#6

On Tuesday, November 19, 2013 at 10:40 AM, Ravindra Chandrakar wrote:

Daniel, Thanks for the info. I’m not sure how to achieve this.

In my case, I’m installing git client at run time using recipe and then cloning the repo.

Regards,
Ravindra

In most cases you want to use SSH authentication, so you need to put a private_key that github accepts in root’s .ssh directory and configure git to use that key.

You probably want to use a deploy key or machine user as described here: https://help.github.com/articles/managing-deploy-keys


Daniel DeLeo


#7

I recommend using https://github.com/fnichol/chef-user to create a
machine user with one or more SSH keys.

-Mathias

On Tue, Nov 19, 2013 at 8:02 PM, Daniel DeLeo dan@kallistec.com wrote:

On Tuesday, November 19, 2013 at 10:40 AM, Ravindra Chandrakar wrote:

Daniel, Thanks for the info. I’m not sure how to achieve this.

In my case, I’m installing git client at run time using recipe and then
cloning the repo.

Regards,
Ravindra

In most cases you want to use SSH authentication, so you need to put a
private_key that github accepts in root’s .ssh directory and configure git
to use that key.

You probably want to use a deploy key or machine user as described here:
https://help.github.com/articles/managing-deploy-keys


Daniel DeLeo


#8

You can also use https://github.com/cassianoleal/cookbook-deploy_key/ to create and register deploy keys on Github and Bitbucket.

–Cassiano Leal
http://cassianoleal.com
http://twitter.com/cassianoleal

On Tuesday, November 19, 2013 at 17:34, Mathias Lafeldt wrote:

I recommend using https://github.com/fnichol/chef-user to create a
machine user with one or more SSH keys.

-Mathias

On Tue, Nov 19, 2013 at 8:02 PM, Daniel DeLeo <dan@kallistec.com (mailto:dan@kallistec.com)> wrote:

On Tuesday, November 19, 2013 at 10:40 AM, Ravindra Chandrakar wrote:

Daniel, Thanks for the info. I’m not sure how to achieve this.

In my case, I’m installing git client at run time using recipe and then
cloning the repo.

Regards,
Ravindra

In most cases you want to use SSH authentication, so you need to put a
private_key that github accepts in root’s .ssh directory and configure git
to use that key.

You probably want to use a deploy key or machine user as described here:
https://help.github.com/articles/managing-deploy-keys


Daniel DeLeo