jenkins-infra / plugin-health-scoring

This project aims to introduce a metric system to calculate the health score of each plugin within the Jenkins ecosystem and reflect the final scores on the Plugin Site for the plugin maintainers and users.
https://plugin-health.jenkins.io
MIT License
24 stars 46 forks source link

Configuration JGit folder #138

Open alecharp opened 1 year ago

alecharp commented 1 year ago

When cloning the repository of plugins, we have the following error produced:

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:413) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:140) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:184) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:761) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$5(FS.java:443) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

Because of this, probes are not executing properly.

alecharp commented 1 year ago

The exception on this method can be thrown when the folder we want to create already exists. This is potentially the case because the probe which clones a plugin repository can be ran on multiple plugins at a time (probes are run sequentially on each plugins, but plugins are analyzed in parallel).

So, this might not be a problem we need to configured.

However, we could initialize this folder when the application starts so that it is done once.

amangupta679 commented 1 year ago

When cloning the repository of plugins, we have the following error produced:

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:413) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:140) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:184) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:761) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$5(FS.java:443) ~[org.eclipse.jgit-6.3.0.2022009070944-r.jar!/:6.3.0.2022009070944-r]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

Because of this, probes are not executing properly.

This error occurs when the system is unable to create the necessary directories to save the configuration file for JGit. JGit is a Java-based implementation of the Git version control system.

The error message indicates that the directory "/****/.config/jgit" could not be created. This could be due to a permissions issue or a problem with the file system.