The stack trace indicates that command line git failed and reported the error:
error: cannot open .git/FETCH_HEAD: Invalid argument
The command line git source code didn't show any obvious cases of a direct display of 'Invalid argument'. I assume that message is the result of a call to `perror` for an errno return value of `EINVAL`. Unfortunately, the command line git message doesn't give enough information to easily find the failure case.
The `FETCH_HEAD` file is where command line git stores the SHA-1 that was most recently fetched into the repository. The message 'Invalid argument' hints to me that the '.git/FETCH_HEAD' file may be inaccessible. Some of the possible reasons it might have become inaccessible include:
Permission change on the file system (user performing the fetch unable to write to the file - command line git 2.7.4 reports 'permission denied' in this case, not 'Invalid argument')
File type changed on the file system (what was a plain file previously might have been deleted and replaced with a directory - command line git 2.7.4 reports 'Is a directory' in this case, not 'Invalid argument')
File system related error (seems unlikely, but if the file system is reporting errors it might be worth investigating)
File system unavailable (if the repository is stored on a network file system, that might explain both the 'Invalid argument' message and its intermittent nature)
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.