Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]' #566

Open
bernardpaulus opened this issue Jul 8, 2021 · 11 comments
Open
Labels

Comments

@bernardpaulus
Copy link

Describe the bug

During maven build, we observe the following error message from git-commit-id-maven-plugin 4.0.5:

Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'

The H: drive is a network drive where our home dir is set

Steps to Reproduce

  • mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Users\<redacted>\tools\maven\3.6.3
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: C:\Program Files\Java\JDK8\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
  • Plugin config:
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.0.5</version>
        <configuration>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <offline>true</offline>
        </configuration>
      </plugin>
  • no public build
  • Observed error:
    Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'

This error doesn not prevents the maven build from being executed with success. However, intelliJ Community 2019.3 spots it as an error:
image

Expected behavior

  • no error message printed

Additional context

This might be similar to https://www.eclipse.org/forums/index.php/t/1103395/

@TheSnoozer
Copy link
Collaborator

TheSnoozer commented Jul 8, 2021

Hello,
thank you for reporting this issue here! When I read the linked ticket (https://bugs.eclipse.org/bugs/show_bug.cgi?id=566170) correctly this should be fixed whenever we update the jgit-library to version 5.9?!?

For the time being you could potentially switch to the native git binary via <useNativeGit>true</useNativeGit> which would help avoid that issue since it doesn't rely on jgit.

@TheSnoozer TheSnoozer added the bug label Jul 8, 2021
@TheSnoozer
Copy link
Collaborator

Ah I just realized that this is essentially a duplicate of #518. At least it's the same issue. Perhaps a different context....not sure if I should keep both issues open, but I guess it doesn't hurt either.

@bernardpaulus
Copy link
Author

The difference with #518 is that there the build fails while in this case it does not

thanks for the useNativeGit tip!

@TheSnoozer
Copy link
Collaborator

thanks for pointing out that difference!
Could you perhaps also confirm which version you are using?
If you are on 4.0.5 this should already include jgit 5.12.0.202106070339-r (see https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/v4.0.5/core/pom.xml#L20). Based on the closed bug report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=566170) this should have been fixed in 5.9.X....hence this would make me suspect that it is not fixed properly and would deserve a new ticket, or to have the old to be reopened.

@diceit-git
Copy link

diceit-git commented Sep 17, 2021

Same problem here with 4.9.10:

[INFO] --- git-commit-id-plugin:4.9.10:revision (default) ...
[ERROR] Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'
java.io.IOException: Creating directories for H:\.config\jgit failed

<useNativeGit>false</useNativeGit>

doesn't make a difference

@TheSnoozer
Copy link
Collaborator

Sorry it should have been <useNativeGit>true</useNativeGit> I have updated my initial comment.

@PawelLipski
Copy link

@TheSnoozer we're actually observing the same problem now in VirtusLab/git-machete-intellij-plugin#1239 ... despite using the latest JGit (6.3.0.202209071007-r) ☹️

@TheSnoozer
Copy link
Collaborator

Thanks for raising this! I guess we should then (re-)open a ticket with jgit :-(

@PawelLipski
Copy link

Yes, if you could 🙏🏻 pls mention me on that ticket (if that's on GitHub) or provide the link for the ticket (otherwise) 🎫

@PawelLipski
Copy link

Actually... seems that it can be closed: VirtusLab/git-machete-intellij-plugin#1239 (comment)

@lars06
Copy link

lars06 commented Mar 17, 2023

Hi everyone. I came across the same issue on the gradle plugin for git commit id.

To rule solutions out, I tried to create the .config directory manually and that works correctly. I also tried to manually exclude the jgit dependency and manually include newer versions which still produced the error.

Did anyone find the cause of this that could maybe be applied to the gradle plugin also? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants