Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » getXDGConfigHome fails with user.home resolved to ?(JGit XDG issue by user.home when running in openShift)
getXDGConfigHome fails with user.home resolved to ? [message #1823809] Thu, 02 April 2020 11:29 Go to next message
Torsten Reinhard is currently offline Torsten ReinhardFriend
Messages: 1
Registered: April 2020
Junior Member
Hi

my Jenkins Slaves are running in openShift (3.9), the setup is using the jenkins/jnlp-slave:alpine image and Git-client-plugin (3.2.1)

Since one of the last updates of JGit dependency in the Git-client-plugin (>3.0.0-rc) I´m seeing this exception in the logs, which I guess is related to openShift´s "ramdom" user being used for resolving "user.home", but resulting in "?".

What´s the workaround or solution to this? Do I have to set XDG_CONFIG_HOME somewhere to workaround the $(user.home) access ?

Mar 09, 2020 5:36:03 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Mar 09, 2020 5:38:30 PM org.eclipse.jgit.util.SystemReader$Default getXDGConfigHome
SEVERE: Creating XDG_CONFIG_HOME directory /home/jenkins/?/.config failed
java.nio.file.AccessDeniedException: /home/jenkins/?
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
	at java.nio.file.Files.createDirectory(Files.java:674)
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
	at java.nio.file.Files.createDirectories(Files.java:767)
	at org.eclipse.jgit.util.SystemReader$Default.getXDGConfigHome(SystemReader.java:153)
	at org.eclipse.jgit.util.SystemReader$Default.openJGitConfig(SystemReader.java:164)
	at org.eclipse.jgit.util.SystemReader.getJGitConfig(SystemReader.java:381)
	at org.eclipse.jgit.util.SystemReader.getSystemConfig(SystemReader.java:406)
	at org.eclipse.jgit.util.SystemReader.getUserConfig(SystemReader.java:354)
	at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:191)
	at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:616)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRepository(CliGitAPIImpl.java:3122)
	at hudson.plugins.git.GitAPI.getRepository(GitAPI.java:277)
	at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:81)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:931)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:905)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:857)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:117)
	at java.lang.Thread.run(Thread.java:748)

Mar 09, 2020 5:38:33 PM org.eclipse.jgit.util.FS$FileStoreAttributes saveToConfig
SEVERE: Cannot save config file 'FileBasedConfig[/home/jenkins/?/.jgitconfig]'
java.io.IOException: Creating directories for /home/jenkins/? failed
	at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:428)
	at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:163)
	at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:252)
	at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:586)
	at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$0(FS.java:367)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)


Thanx and best regards,

Torsten
Re: getXDGConfigHome fails with user.home resolved to ? [message #1823915 is a reply to message #1823809] Fri, 03 April 2020 19:01 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Why random user? Any anyway, even if it's a random user: apparently that image gives that user a home directory (/home/jenkins/?), but that directory doesn't exist. IMO that image needs to be fixed to give that user an existing home directory, and possibly also a better name than "?".

As a work-around you could indeed try setting XDG_CONFIG_HOME to some existing directory where this user has write permission.
Previous Topic:Git clone produces a non-wildcard fetch refspec since 2019-12
Next Topic:Dirty resource - icon by default
Goto Forum:
  


Current Time: Thu Oct 21 06:10:57 GMT 2021

Powered by FUDForum. Page generated in 0.01679 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top