You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running our own initializr in an Openshift namespace, we have default openshift SCC's active that require standard apps to run with a random userId within a given range. However this range is by default higher than the maximum value (=2097151)
When running, the tgz creation through REST endpoint, we're seeing following error:
java.lang.IllegalArgumentException: user id 'replaced' is too big ( > 2097151 ).
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumber(TarArchiveOutputStream.java:406) ~[commons-compress-1.23.0.jar:1.23.0]
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumber(TarArchiveOutputStream.java:400) ~[commons-compress-1.23.0.jar:1.23.0]
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumbers(TarArchiveOutputStream.java:418) ~[commons-compress-1.23.0.jar:1.23.0]
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:592) ~[commons-compress-1.23.0.jar:1.23.0]
at io.spring.initializr.web.controller.ProjectGenerationController.lambda$createArchive$1(ProjectGenerationController.java:168) ~[initializr-web-0.20.1.jar:na]
After adding out.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);, it is working fine.
Unfortunately this is part of a private method in the abstract class, and overridding it requires a lot of the other methods (all private) to be overridden also. Starting from the exposed controller method, all methods need overriding for this adoption.
I think we could either make it protected or add the big filenumberMode by default? Or can we somehow feed it as a property?
The text was updated successfully, but these errors were encountered:
mhalbritter
changed the title
user id 'xxx' is too big ( > 2097151 ) when running with large user id
TAR archive creation fails if user id is too big
Jan 7, 2025
We already enable the POSIX extensions for long filenames (out.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);). I don't think there's harm in also enable that for the big number mode.
Thanks for the quick resolution @mhalbritter!
I do not see in the docs/milestone page what the expected due date would be for this.
Is there any upcoming release?
Or can I use the milestone version?
When running our own initializr in an Openshift namespace, we have default openshift SCC's active that require standard apps to run with a random userId within a given range. However this range is by default higher than the maximum value (=2097151)
When running, the tgz creation through REST endpoint, we're seeing following error:
When searching we discovered similar issues in testcontainers and docker-maven-plugin with both very similar fixes: Setting the posix BigNumberMode (testcontainers and plugin)
Looking at the stacktrace, I found this snippet which does not set it.
initializr/initializr-web/src/main/java/io/spring/initializr/web/controller/ProjectGenerationController.java
Lines 147 to 149 in bac7d31
After adding
out.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
, it is working fine.Unfortunately this is part of a private method in the abstract class, and overridding it requires a lot of the other methods (all private) to be overridden also. Starting from the exposed controller method, all methods need overriding for this adoption.
I think we could either make it protected or add the big filenumberMode by default? Or can we somehow feed it as a property?
The text was updated successfully, but these errors were encountered: