Skip to content

Regression when file already exists when exploding archive#720

Merged
jonesbusy merged 1 commit into
oras-project:mainfrom
jonesbusy:fix/regression-when-file-already-exists
May 28, 2026
Merged

Regression when file already exists when exploding archive#720
jonesbusy merged 1 commit into
oras-project:mainfrom
jonesbusy:fix/regression-when-file-already-exists

Conversation

@jonesbusy
Copy link
Copy Markdown
Collaborator

Last security fix cause a regression when exploding archive. Previous any existing files where replaced, which is not the case now.

Fix it and add a test to prevent future regression

This cause issue on Jenkins (for example getting library artifacty)

26-05-28T05:14:24.330Z] 	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
[2026-05-28T05:14:24.330Z] 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
[2026-05-28T05:14:24.330Z] 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[2026-05-28T05:14:24.330Z] 	at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:213)
[2026-05-28T05:14:24.330Z] 	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:244)
[2026-05-28T05:14:24.330Z] 	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:426)
[2026-05-28T05:14:24.330Z] 	at java.base/java.nio.file.Files.newOutputStream(Files.java:215)
[2026-05-28T05:14:24.330Z] 	at PluginClassLoader for oras-java-api//land.oras.utils.ArchiveUtils.untar(ArchiveUtils.java:459)
[2026-05-28T05:14:24.330Z] Caused: land.oras.exception.OrasException: Failed to extract tar.gz file
[2026-05-28T05:14:24.330Z] 	at PluginClassLoader for oras-java-api//land.oras.utils.ArchiveUtils.untar(ArchiveUtils.java:474)
[2026-05-28T05:14:24.330Z] 	at PluginClassLoader for oras-java-api//land.oras.Registry.pullLayer(Registry.java:1109)
[2026-05-28T05:14:24.330Z] 	at PluginClassLoader for oras-java-api//land.oras.Registry.lambda$pullArtifact$4(Registry.java:550)
[2026-05-28T05:14:24.330Z] 	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1825)
[2026-05-28T05:14:24.330Z] Caused: java.util.concurrent.CompletionException

Description

Testing done

Submitter checklist

  • I have read and understood the CONTRIBUTING guide
  • I have run mvn license:update-file-header, mvn spotless:apply, pre-commit run -a, mvn clean install before opening the PR

Signed-off-by: Valentin Delaye <jonesbusy@users.noreply.github.com>
@jonesbusy jonesbusy added the bug Something isn't working label May 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.15%. Comparing base (083fe12) to head (c6f3ad3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #720      +/-   ##
============================================
+ Coverage     87.05%   87.15%   +0.09%     
+ Complexity      975      968       -7     
============================================
  Files            45       45              
  Lines          3036     3036              
  Branches        381      381              
============================================
+ Hits           2643     2646       +3     
+ Misses          232      231       -1     
+ Partials        161      159       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonesbusy jonesbusy merged commit 90e2199 into oras-project:main May 28, 2026
11 of 14 checks passed
@jonesbusy jonesbusy deleted the fix/regression-when-file-already-exists branch May 28, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant