adamtornhill / code-maat

A command line tool to mine and analyze data from version-control systems
http://www.adamtornhill.com/code/codemaat.htm
2.37k stars 218 forks source link

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

Closed cowley05 closed 3 years ago

cowley05 commented 5 years ago

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 :/

polku commented 4 years ago

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.

DylanSp commented 4 years ago

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

jonathanmv commented 3 years ago

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

adamtornhill commented 3 years ago

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