teamdigitale / dati-semantic-backend

Backend for the NDC semantic repository
GNU Affero General Public License v3.0
4 stars 5 forks source link

[BE] Problem during repos checkout #53

Open nnzJd opened 1 year ago

nnzJd commented 1 year ago

Comportamento atteso

Viene clonato il repo

Comportamento attuale

In alcuni casi, viene lanciata la seguente eccezione :

2022-11-24 16:23:32.326 ERROR 1 --- [tributeWriter-2] org.eclipse.jgit.util.FS                 : 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) ~[org.eclipse.jgit-5.13.0.202109080827-r.jar:5.13.0.202109080827-r]
    at org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:138) ~[org.eclipse.jgit-5.13.0.202109080827-r.jar:5.13.0.202109080827-r]
    at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:219) ~[org.eclipse.jgit-5.13.0.202109080827-r.jar:5.13.0.202109080827-r]
    at org.eclipse.jgit.util.FS$FileStoreAttributes.saveToConfig(FS.java:740) ~[org.eclipse.jgit-5.13.0.202109080827-r.jar:5.13.0.202109080827-r]
    at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$4(FS.java:426) ~[org.eclipse.jgit-5.13.0.202109080827-r.jar:5.13.0.202109080827-r]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

Contesto

Riscontrato in ambiente Dev

ioggstream commented 1 year ago

in dev/ we fixed it setting XDG_CONFIG_HOME to a writable directory of the container. This should be better addressed via a suitable default value in the application.

See https://stackoverflow.com/questions/65731005/jgit-throws-java-io-ioexception-creating-directories-for-config-jgit-failed

ioggstream commented 7 months ago

This issue should be re-titled as:

"The harvester cannot clone a repository because of a read-only workdir" or something like that.

The fixing line is here https://github.com/teamdigitale/dati-semantic-kubernetes/blob/dev/dati-semantic-backend/deploymentConfig.yaml#L71

If everything works, I think we can close.