Open jjarokergc opened 1 year ago
There is additional odd behavior that was observed while troubleshooting:
Removing the "safe_directory" directive in the above example (such as by prefixing a #
to make it into a comment) results in VCSREPO giving notices that the directory has been alternatively removed and then added each time puppet agent -t
is run.
...
Notice: Vcsrepo[/var/www/yurevichi.org/htdocs](provider=git): Removing '/var/www/yurevichi.org/htdocs' from safe directory list
...
Notice: Vcsrepo[/var/www/yurevichi.org/htdocs](provider=git): Adding '/var/www/yurevichi.org/htdocs' to safe directory list
...
Notice: Vcsrepo[/var/www/yurevichi.org/htdocs](provider=git): Removing '/var/www/yurevichi.org/htdocs' from safe directory list
...
We have the exact same issue since a couple of weeks.
We are using vcsrepo version v5.0.0 on Debian 11.6, using git version 2.39.2.
The "safe directory" functionality created many problems and I removed it.
The solution to my problem was deleting the git directory and recreating it through puppet. I use the "user" parameter to checkout as a non-root user.
Here is an example that works for me (after deleting the git directory on the host):
I get this issue without using the safe directory functionality at all. I have no idea why this now triggers.
All I know now, after some debugging, is that at this point provider.exists is false: https://github.com/puppetlabs/puppetlabs-vcsrepo/blob/0c7d183ecc807d92d89e41487371609c43d30217/lib/puppet/type/vcsrepo.rb#L133 So the if jumps to provider.create, which returns this error.
Error: Path /srv/installer exists and is not the desired repository.
/opt/puppetlabs/puppet/cache/lib/puppet/provider/vcsrepo.rb:11:in `check_force'
/opt/puppetlabs/puppet/cache/lib/puppet/provider/vcsrepo/git.rb:12:in `create'
/opt/puppetlabs/puppet/cache/lib/puppet/type/vcsrepo.rb:123:in `block (3 levels) in <top (required)>'
I'll try to debug it some more, but I'm not that familiar with the ruby syntax.
Anyone got a fix for this? I'm experiencing this issue with vcsrepo 6.1.0 with and without safe directory parameter.
After some debugging we realized that the issue was comming a wrong syntax in /etc/gitconfig (in case this helps others)
Describe the Bug
The error "Path [...] exists and is not the desired repository" appeared in my puppet logs on a previously-working manifest for the installation of Dokuwiki. That resource is shown here: https://github.com/jjarokergc/puppet-dokuwiki/blob/61c04b113525a3a10ac3b6c1d91eaa37df36531c/manifests/init.pp#L63
This error appeared after updating git to version 2.25.1 on Ubuntu, which backported the CVE-2022-24765 bug fix, introducing this failure. I followed the discussion and suggestions shown in Issue #535 and added the
safe_directory
parameter in the above example. I would appreciate any suggestions on how to get this module working again.Expected Behavior
I was expecting the git update to proceed as before but the "change from 'absent' to 'present' failed" problem persists.
Environment
lsb_release -a
On client: puppet agent --version
7.23.0
On master: puppetserver --version
puppetserver version: 7.9.5
Puppetfile.r10k
mod 'puppetlabs-vcsrepo', '5.4.0'
Additional Context
puppet agent -t --debug