vcsrepo: Could not create repository (non-repository at path)

1,920 views
Skip to first unread message

bowlby

unread,
Nov 19, 2012, 7:01:49 AM11/19/12
to puppet...@googlegroups.com
Hi,
I'm running into a problem using the puppetlabs provided vcsrepo-module. It keeps giving the same error:

--------------
notice: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: Creating repository from latest
err: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: change from absent to latest failed: Could not create repository (non-repository at path)
--------------

This is in my vcs.pp and when I run, puppet apply ./vcs.pp
I keep getting the error below. When I run git clone as the user it runs fine.
Anybody any suggestions?

--------------
Exec { path => "/bin:/usr/bin:/sbin:/usr/sbin", }

vcsrepo { '/usr/share/test2':
                ensure   => latest,
                provider => git,
                revision => 'master',
                path    => '/usr/share/test2',
                user     => "user",
                source => 'git://github.com/puppetlabs/puppetlabs-vcsrepo.git'
            }
-

Jeff McCune

unread,
Nov 20, 2012, 3:12:02 PM11/20/12
to Puppet User Discussion
On Mon, Nov 19, 2012 at 7:01 AM, bowlby <brame...@gmail.com> wrote:
> Hi,
> I'm running into a problem using the puppetlabs provided vcsrepo-module. It
> keeps giving the same error:
>
> --------------
> notice: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: Creating repository
> from latest
> err: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: change from absent to
> latest failed: Could not create repository (non-repository at path)
> --------------

I suggest running with the --debug flag turned on and then comparing
the git commands that Puppet is executing to the commands you execute
manually. I suspect there's a slight difference that's causing the
wrong directory to be used by Puppet or something.

If you're still stuck, could you please follow up in this thread with
the debug output and the git command you're executing manually? This
information should help us troubleshoot the issue more quickly.

-Jeff

Ryan Coleman

unread,
Nov 20, 2012, 3:26:54 PM11/20/12
to puppet...@googlegroups.com
On Mon, Nov 19, 2012 at 4:01 AM, bowlby <brame...@gmail.com> wrote:
Hi,
I'm running into a problem using the puppetlabs provided vcsrepo-module. It keeps giving the same error:

--------------
notice: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: Creating repository from latest
err: /Stage[main]//Vcsrepo[/usr/share/test2]/ensure: change from absent to latest failed: Could not create repository (non-repository at path)

Does /usr/share/test2 already exist prior to the Vcsrepo resource being enforced on your system?

I can't find the appropriate bug against vcsrepo right now (https://projects.puppetlabs.com/projects/modules/issues?query_id=185) but I suspect that this problem stems from a bug where vcsrepo wants to be the one to create the test2 directory and cannot.

If this turns out to be your problem, I'll find/create a bug report on it and send it your way. Sorry for the inconvenience.

--Ryan

 
--------------

This is in my vcs.pp and when I run, puppet apply ./vcs.pp
I keep getting the error below. When I run git clone as the user it runs fine.
Anybody any suggestions?

--------------
Exec { path => "/bin:/usr/bin:/sbin:/usr/sbin", }

vcsrepo { '/usr/share/test2':
                ensure   => latest,
                provider => git,
                revision => 'master',
                path    => '/usr/share/test2',
                user     => "user",
                source => 'git://github.com/puppetlabs/puppetlabs-vcsrepo.git'
            }
-

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Oa4SscXpWJ0J.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.



--
Ryan Coleman | Modules & Forge | @ryanycoleman | ryancoleman in #puppet
 


Abdul Karim

unread,
Oct 29, 2015, 9:19:41 AM10/29/15
to Puppet Users
Hi, anyone know if this was ever fixed?

today, I installed the latest version of vcsrepo from puppet forge. and still seeing this issue with git clone. I noticed this post is from 3 years ago so bit surprised that this isn't fixed.


I have narrowed it down to def working_copy_exists?

the checks here always returns false. even if the repo clone exists. I made slight modification as below and it seem to work for me. Not entirely sure why File.readlines doesn't work.


diff --git a/PuppetForge/puppetlabs-vcsrepo/lib/puppet/provider/vcsrepo/git.rb b/PuppetForge/puppetlabs-vcsrepo/lib/puppet/provider/vcsrepo/git.rb

index bf11f3d..2e54125 100644

--- a/PuppetForge/puppetlabs-vcsrepo/lib/puppet/provider/vcsrepo/git.rb

+++ b/PuppetForge/puppetlabs-vcsrepo/lib/puppet/provider/vcsrepo/git.rb

@@ -103,7 +103,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)

 

   def working_copy_exists?

     if @resource.value(:source) and File.exists?(File.join(@resource.value(:path), '.git', 'config'))

-      File.readlines(File.join(@resource.value(:path), '.git', 'config')).grep(/#{default_url}/).any?

+      File.open(File.join(@resource.value(:path), '.git', 'config')).any?{|line| line.include?(default_url)}

     else

       File.directory?(File.join(@resource.value(:path), '.git'))

     end



puppet version: 3.6.2
ruby 1.8.7 
rhel 6.5

Any thoughts?
Reply all
Reply to author
Forward
0 new messages