kirby-git-content icon indicating copy to clipboard operation
kirby-git-content copied to clipboard

error in staging : --max-count=10

Open paubou opened this issue 1 year ago • 2 comments

Getting this error on Kirby 4.2 : Command 'LC_ALL=C git log '--pretty=format:%H|%s|%an|%ae|%cI' '--max-count=10'' failed (exit-code -1).

It's working great locally, but as soon as I deploy to my staging env, it's giving me the error...

paubou avatar Apr 29 '24 18:04 paubou

Can you try to run the command on the server as the webserver’s user? Mostly this is related to an old git version on the server.

thathoff avatar Apr 30 '24 06:04 thathoff

I got the same error message and in fact, it was the reason of a host OS (i.e. linux) user mismatch. The actual output which you only get on the command line invoking this command is then something like

fatal: detected dubious ownership in repository at '/home/foo/bar/baz'
To add an exception for this directory, call:

        git config --global --add safe.directory /home/foo/bar/baz

The solution is, as @thathoff said, to make sure that the .git directory is owned by the same system user who is running the PHP process (for instance www-data on a classical linux php-fpm or LAMP system).

It would be very good if the error message in the panel captured this stderr thrown by git so users get an idea what the actual error is. exit-code 128 is just telling nothing.

svenk avatar Jul 16 '24 10:07 svenk