code-maat icon indicating copy to clipboard operation
code-maat copied to clipboard

Invalid argument: git2: Failed to parse the given file - is it a valid logfile? error when running with docker

Open cowley05 opened this issue 7 years ago • 4 comments

Im getting the following error when running this with the docker container:

Invalid argument: git2: Failed to parse the given file - is it a valid logfile?

I built the container with the command below from the latest code on 9th august:

docker build -t code-maat-app .

I then ran

git log --all --numstat --date=short --pretty=format:'--%h--%ad--%aN' --no-renames --after=2018-10-31 > logfile.log

and after that:

docker run -v /PATH-TO-CODEBASE:/data -it code-maat-app -l logfile.log -c git2

my logfile looks just like the ones in your tests folder :/

cowley05 avatar Aug 09 '19 16:08 cowley05

I had the same problem, it was actually not related to code-maat but a problem with the docker volume. The error message was misleading, it's not that the file was invalid but that it was simply not found inside the container. Attach a bash to your container and check if the file is there, if not, using a named volume solved the problem for me.

polku avatar Oct 22 '19 07:10 polku

Had the same issue, @polku put me on the right track.

DylanSp avatar Jul 06 '20 18:07 DylanSp

Same here, the log file was not being found. Would it make sense to close this issue then?

In my case I created a 2020.log file, but when executing code-maat I pointed to /data/logfile.log (because that was the given example). I just changed it to /data/2020.log and I didn't run into that problem

jonathanmv avatar Dec 01 '20 16:12 jonathanmv

Yes, let's close this issue since it's not related to code maat itself. Glad that you sorted it out!

adamtornhill avatar Dec 02 '20 09:12 adamtornhill