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

Benign java.io.IOException from JGit on startup #2028

Closed
seanmmills opened this issue Jan 5, 2022 · 9 comments
Closed

Benign java.io.IOException from JGit on startup #2028

seanmmills opened this issue Jan 5, 2022 · 9 comments
Milestone

Comments

@seanmmills
Copy link

Upgrading our Spring Cloud Config server from Spring Cloud 2020.0.3 to 2021.0.0 caused a seemingly benign error reported in the logs when deploying to kubernetes.

2022-01-03 20:04:02,892 [tributeWriter-2] ERROR org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig - Cannot save config file 'FileBasedConfig[/.config/jgit/config]'
java.io.IOException: Creating directories for /.config/jgit failed
  at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:412)
  at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:138)
  at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:219)
  at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:740)
  at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$4(FS.java:426)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  at java.base/java.lang.Thread.run(Thread.java:829)

I found this stackoverflow describing the problem and solution. I can add the XDG_CONFIG_HOME environment variable, however I think it would be great if a solution was provided in SCC.

@ryanjbaxter
Copy link
Contributor

Interesting, IDK what we can do about it as it appears to be something JGit is doing.

Does everything still work despite the exception?

@mpkorstanje
Copy link

mpkorstanje commented Jan 10, 2022

Having found myself in a similar situation, it would appear that everything is working as expected.

@ryanjbaxter
Copy link
Contributor

Thanks @mpkorstanje. I will try and take a look at it, but it will be low priority since everything is working.

@mpkorstanje
Copy link

mpkorstanje commented Jan 10, 2022

No problem!

I don't think this a problem for Spring to solve. It's up to the OS that runs the application to set XDG_CONFIG_HOME correctly.

In my case this variable was set correctly but the filesystem was mounted as read-only and so the user dir was not writable.

I'll file an issue with JGit to more gracefully handle read-only file systems.

@ryanjbaxter
Copy link
Contributor

Could you post a comment to the JGit issue here?

@mpkorstanje
Copy link

mpkorstanje commented Jan 10, 2022

It already existed:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=560555

Thomas Wolf 2021-02-08 03:14:23 EST
Two possible solutions:

  1. Do provide a user with a writeable home directory inside the Docker container.
  2. Set environment variable XDG_CONFIG_HOME inside the Docker container to point to a directory where the Java process has write permissions.

Sounds like a doc fix to me.

@ryanjbaxter
Copy link
Contributor

Thanks!

@ryanjbaxter
Copy link
Contributor

We probably need to document this

@ryanjbaxter ryanjbaxter added this to the 3.0.7 milestone Jan 11, 2022
@spencergibb spencergibb removed this from the 3.0.7 milestone Feb 17, 2022
@ryanjbaxter
Copy link
Contributor

I just added a note to the docs

@ryanjbaxter ryanjbaxter removed this from 2021.0.9 Sep 5, 2024
@ryanjbaxter ryanjbaxter added this to the 4.1.4 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Status: Done
Development

No branches or pull requests

4 participants