Vyos 1.5 Git commit archive

Aloha,
I read in the latest January blog, that there’s a bug fix for “Commit archive to git”
Before I even didnt know, that this is even possible.
So I was curious and updated to the latest rolling release and thought I give it a try.

Vyos version is VyOS 1.5-rolling-202502030007

When I configure:

set system config-management commit-archive location git://[email protected]:marcel/configs.git

and then actual commit, I receive the following error:

Archiving config...
  git://git.lab.sprengkraft.ua:marcel/configs.git Unable to upload "git://[email protected]:marcel/configs.git/config.boot-RTR01.lab.sprengkraft.ua.20250210_170314": [Errno 2] No such file or directory: " ['git', 'clone', '[email protected]:marcel/configs.git', '/tmp/git-commit-archive-clxsflfz/repository', '--depth=1']"
run-parts: /etc/commit/post-hooks.d/02vyos-commit-archive exited with return code 1

Unfortunately I really dont understand what that means.
The directory post-hooks.d looks like this:

ls -la /etc/commit/post-hooks.d/
total 13
drwxr-xr-x 1 root root      4096 Feb 10 17:03 .
drwxr-xr-x 1 root root      4096 Feb  3 02:07 ..
-rwxr-xr-x 1 root root       226 Sep 10  2023 00vyos-sync
lrwxrwxrwx 1 root vyattacfg   20 Feb 10 14:00 01vyos-commit-revision -> /usr/bin/config-mgmt
lrwxrwxrwx 1 root vyattacfg   20 Feb 10 17:03 02vyos-commit-archive -> /usr/bin/config-mgmt
lrwxrwxrwx 1 root root        37 Feb  3 02:07 10vyatta-log-commit.pl -> /opt/vyatta/sbin/vyatta-log-commit.pl
lrwxrwxrwx 1 root root        46 Feb  3 02:07 99vyos-user-postcommit-hooks -> /opt/vyatta/sbin/vyos-user-postcommit-hooks.sh

And in the /usr/bin/config-mgmt
I dont see any GIT related config.

Then I rememebered, that for ssh agent to work, in the ssd_config the
‘’’ AllowAgentForwarding yes ‘’’
should be set to yes, right?

Well, in my sshd_config it was set to no
So I enabled this in the sshd_config file, restartet the sshd,
now the commit still fails, but I’ve got different output:

 commit
Archiving config...
  git://git.lab.sprengkraft.ua:marcel/configs.git Unable to upload "git://[email protected]:marcel/configs.git/config.boot-rtr01.home.sprengkraft.ua.20250210_171419": [Errno 2] No such file or directory: " ['git', 'clone', '[email protected]:marcel/configs.git', '/tmp/git-commit-archive-vlxa8cru/repository', '--depth=1']"
run-parts: /etc/commit/post-hooks.d/02vyos-commit-archive exited with return code 1
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_ADDRESS = "de_DE.UTF-8",
	LC_NAME = "de_DE.UTF-8",
	LC_MONETARY = "de_DE.UTF-8",
	LC_PAPER = "de_DE.UTF-8",
	LC_IDENTIFICATION = "de_DE.UTF-8",
	LC_TELEPHONE = "de_DE.UTF-8",
	LC_MEASUREMENT = "de_DE.UTF-8",
	LC_TIME = "en_GB.UTF-8",
	LC_NUMERIC = "de_DE.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
[edit]

Should this work in general?

Thanks
MArcel

fun fact.
Now after each commit I receive that perl locale warning,

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_ADDRESS = "de_DE.UTF-8",
	LC_NAME = "de_DE.UTF-8",
	LC_MONETARY = "de_DE.UTF-8",
	LC_PAPER = "de_DE.UTF-8",
	LC_IDENTIFICATION = "de_DE.UTF-8",
	LC_TELEPHONE = "de_DE.UTF-8",
	LC_MEASUREMENT = "de_DE.UTF-8",
	LC_TIME = "en_GB.UTF-8",
	LC_NUMERIC = "de_DE.UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

I found this blog and script yesterday.
I think it could be very useful for many people,
as it is doing exactly what I was looking for in the first place.
Triggered by commit on router execute post-config script and add, commit and push
router config in both formats setconfig and curly-bracket format into a GIT repo:

And after thinking how git actual works (imho), thats not the solution Im looking for.
Because if you want on the router itself a git (add, commit, push)
the actual git repository needs to be in your router.
And I dont want to have my git repo where all router configs are in, on each router,
neither do I want for each router a separate repository.
So my personal conclusion is:
Using some kind of post-hooks script to trigger a remote Ansible playbook to collect config and push it into the config repo.

Git commit archive works fine for me in the latest rolling release

Version:          VyOS 1.5-rolling-202502131743
Release train:    current
Release flavor:   generic

Built by:         [email protected]
Built on:         Thu 13 Feb 2025 17:43 UTC
Build UUID:       e3724221-ca80-4186-988d-6074e6f8160b
Build commit ID:  51b8dcb4740c18

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest
Secure Boot:      n/a (BIOS)

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     
Hardware UUID:    534a6e1b-abb6-41a6-b7f2-4df55a1411b7

Copyright:        VyOS maintainers and contributors
conf
set system config-management commit-archive location 'git+https://user:[email protected]/user/commit-archive'
commit

i saw the same error and fixed this here: T6058: Fix popen command wrapper handling by HollyGurza · Pull Request #4333 · vyos/vyos-1x · GitHub

Hey Holly!
thanks a lot!.
I upgraded to the latest version.
Now the previous error disappeared.
But.
:slight_smile:
I receive now

fatal: could not read Password for 'https://[email protected]': terminal prompts disabled
run-parts: /etc/commit/post-hooks.d/02vyos-commit-archive exited with return code 1

Did you configure a git password somewhere?
And Im wondering how the PW could be used from ssh-agent?

Cheers
Marcel

set system config-management commit-archive location 'git+https://user:[email protected]/user/commit-archive'
1 Like

Im so damn stupid.
:slight_smile:
Thank you!

But what I actually mean:
How to push config on a commit via ssh+git with such command:

set system config-management commit-archive location git://git@[email protected]:Sprengkraft/router-configs.git

According to this:

That should work with ssh agent.
But how?
I ssh into the vyos box with
ssh -A vyos-hostname
then configure

set system config-management commit-archive location git://git@[email protected]:Sprengkraft/router-configs.git

And now I got a
Permission denied (publickey)

Which looks much better than before,
From my local machine I can clone and push into the same remote repository.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.