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

0.6.4 Docker [ERROR] java.nio.file.AccessDeniedException: /.m2/repository/org #9

Open
KillerCodeMonkey opened this issue Nov 27, 2024 · 5 comments

Comments

@KillerCodeMonkey
Copy link

KillerCodeMonkey commented Nov 27, 2024

Mit der version 0.6.4 erhalte ich beim docker compose up folgende Fehlermeldung

kob-testsuite  | [ERROR] java.nio.file.AccessDeniedException: /.m2/repository/org

Auch das Löschen eines existierenden ~/.m2 Ordners hat nix gebracht.

Komplettes Log:

kob-testsuite  | [INFO] Scanning for projects...
kob-testsuite  | [INFO] 
kob-testsuite  | [INFO] ----------------------< de.gematik:kob-testsuite >----------------------
kob-testsuite  | [INFO] Building kob-testsuite 0.6.4-SNAPSHOT
kob-testsuite  | [INFO]   from pom.xml
kob-testsuite  | [INFO] --------------------------------[ jar ]---------------------------------
kob-testsuite  | Downloading from central: https://repo.maven.apache.org/maven2/org/jacoco/jacoco-maven-plugin/0.8.12/jacoco-maven-plugin-0.8.12.pom
kob-testsuite  | [WARNING] Failed to create tracking file parent '/.m2/repository/org/jacoco/jacoco-maven-plugin/0.8.12/jacoco-maven-plugin-0.8.12.pom.lastUpdated'
kob-testsuite  | java.nio.file.AccessDeniedException: /.m2/repository/org
kob-testsuite  |     at sun.nio.fs.UnixException.translateToIOException (UnixException.java:90)
kob-testsuite  |     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:106)
kob-testsuite  |     at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
kob-testsuite  |     at sun.nio.fs.UnixFileSystemProvider.createDirectory (UnixFileSystemProvider.java:438)
kob-testsuite  |     at java.nio.file.Files.createDirectory (Files.java:699)
kob-testsuite  |     at java.nio.file.Files.createAndCheckIsDirectory (Files.java:807)
kob-testsuite  |     at java.nio.file.Files.createDirectories (Files.java:793)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultTrackingFileManager.update (DefaultTrackingFileManager.java:77)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.write (DefaultUpdateCheckManager.java:529)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.touchArtifact (DefaultUpdateCheckManager.java:476)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultArtifactResolver.evaluateDownloads (DefaultArtifactResolver.java:636)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:545)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:449)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:261)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:243)
kob-testsuite  |     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:243)
kob-testsuite  |     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:183)
kob-testsuite  |     at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor (DefaultRepositorySystem.java:269)
kob-testsuite  |     at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:109)
kob-testsuite  |     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.lambda$getPluginDescriptor$0 (DefaultMavenPluginManager.java:183)
kob-testsuite  |     at org.apache.maven.plugin.DefaultPluginDescriptorCache.lambda$get$0 (DefaultPluginDescriptorCache.java:72)
kob-testsuite  |     at java.util.concurrent.ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1708)
kob-testsuite  |     at org.apache.maven.plugin.DefaultPluginDescriptorCache.get (DefaultPluginDescriptorCache.java:70)
kob-testsuite  |     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:181)
kob-testsuite  |     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:271)
kob-testsuite  |     at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:214)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:101)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:239)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:197)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:119)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:135)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:93)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:100)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
kob-testsuite  |     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
kob-testsuite  |     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
kob-testsuite  |     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
kob-testsuite  |     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
kob-testsuite  |     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
kob-testsuite  |     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
kob-testsuite  |     at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
kob-testsuite  |     at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
kob-testsuite  |     at java.lang.reflect.Method.invoke (Method.java:580)
kob-testsuite  |     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
kob-testsuite  |     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
kob-testsuite  |     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
kob-testsuite  |     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)

Ubuntu 22.04, Docker version 26.1.1

@KillerCodeMonkey
Copy link
Author

I guess the MAVEN_CONFIG should be set to a non root folder and the m2 folder should not be under root

@KillerCodeMonkey
Copy link
Author

worked around by
creating the kob-testsuite-maven/repository/org folder structure by myself and changing permissions manually + correcting the volumne in the compose.yml to k- ./kob-testsuite-maven:/.m2

@StefanEger
Copy link

StefanEger commented Nov 27, 2024

Das .m2-Verzeichnis wird zweimal definiert, einmal auf dem Host (./.m2) und einmal als benanntes Volume (kob-testsuite-maven).

Hier die angepasste dc-testsuite.yml (danach läuft es bei uns)

name: dc-testsuite-kob
services:
kob-testsuite:
image: gematik1/kob-testsuite:0.6.4
container_name: kob-testsuite
environment:

MAVEN_OPTS=-Dcucumber.filter.tags=${TESTSUITE_TESTS}
KOB_STARTBROWSER=false
KOB_PSURL=http://host.docker.internal:8080/
KOB_ASURL=https://host.docker.internal:8443/
ports:
"9010:9010"
"9011:9011"
"443:443"
volumes:
./tiger.yaml:/app/tiger.yaml
./kob.yaml:/app/kob.yaml
./ca.p12:/app/ca.p12
./.m2:/root/.m2
./settings.xml:/root/.m2/settings.xml
volumes:
kob-testsuite-maven:
name: kob-testsuite-maven

@KillerCodeMonkey
Copy link
Author

@StefanEger das wird schon nur einmal definiert, aber die Berechtigungen stimmen nicht.

Das Verzeichnis kob-testsuite-maven wird schon angelegt und die settings.xml reinkopiert, jedoch passiert das, je nachdem mit welchem Nutzer docker ausgeführt wird mit unterschiedlichen permissions. Dadurch hat mvn dann keine Berechtigung die Unterordner anzulegen und Dateien zu schreiben.

@StefanEger
Copy link

Ich konnte mit den Anpassungen der .yml die Testsuite problemlos starten. Wenn die Lösungswege beide funktioniert, umso besser :).

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

No branches or pull requests

2 participants