[FAIL] Failed to fetch version from local git: fatal: unrecognized argument: -q

Hi,

When executing validate.sh, it returns an error:

-bash-4.2$ ./validate.php

Component Version
LibreNMS 22.6.0-1-g110ceee
DB Schema 2022_05_30_084932_update-app-status-length (242)
PHP 7.3.11
Python 3.6.12
MySQL 10.4.14-MariaDB
RRDTool 1.4.9
SNMP 5.7.2

====================================

[OK] Composer Version: 2.3.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] rrd_dir is writable
[OK] rrdtool version ok
[FAIL] Failed to fetch version from local git: fatal: unrecognized argument: -q

How could I fix it?

Regards

The same happen to me. Saw it yesterday…

====================================

Component Version
LibreNMS 22.6.0-2-g1056f28
DB Schema 2022_05_30_084932_update-app-status-length (242)
PHP 7.3.28
Python 3.6.8
MySQL 10.5.10-MariaDB
RRDTool 1.4.8
SNMP 5.7.2

====================================

[OK] Composer Version: 2.3.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] rrdtool version ok
[OK] Connected to rrdcached
[FAIL] Failed to fetch version from local git: fatal: unrecognized argument: -q

I would need help too to get it fix.

Thanks in advance !

were you able to solve it? I have the same problem

Please paste the result of running:

$ cd /opt/librenms/
$ git version
$ git show -q --pretty="%H|%ct"
$ git show -s --pretty="%H|%ct"

[[email protected] librenms]# git version
git version 1.8.3.1

[[email protected] librenms]# git show -q --pretty="%H|%ct"
fatal: unrecognized argument: -q

[[email protected] librenms]# git show -s --pretty="%H|%ct"
1056f28de7b32713903f412084a78deb80d6b381|1655353797

I see, we didn’t except people running 9 year old git clients, but centos7 strikes again I suppose :slight_smile:

does git show --no-patch --pretty="%H|%ct" work?

this is how i fixed it:
i had the following:
git --version 1.8.3.1

yum -y remove git
yum -y remove git-*

in my case it is a CentOS Linux release 7.9.2009 (Core)

yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm

yum install git -y

git --version
git version 2.36.0

now if if i run those commands there is no more the issue of : fatal: unrecognized argument: -q

as following:

git version 2.36.0
bash-4.2$ git show -q --pretty="%H|%ct"
1056f28de7b32713903f412084a78deb80d6b381|1655353797
bash-4.2$ git show -s --pretty="%H|%ct"
1056f28de7b32713903f412084a78deb80d6b381|1655353797
3 Likes

Fixed in https://github.com/librenms/librenms/pull/14047

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