Actions
Bug #26088
openNPE in archive generation
Status:
Pending release
Priority:
1 (highest)
Assignee:
Category:
Web - Compliance & node report
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
No
Description
2024-12-18 09:59:17+0000 INFO net.liftweb.http.LiftServlet - Request for /rudder/lift/ajax/F819842088788PLFPXD-20/ failed Cannot invoke "String.endsWith(String)" because the return value of "com.normation.rudder.git.ZipUtils$Zippable.path()" is null zio.FiberFailure: Cannot invoke "String.endsWith(String)" because the return value of "com.normation.rudder.git.ZipUtils$Zippable.path()" is null at com.normation.rudder.git.ZipUtils$.$anonfun$zip$11(ZipUtils.scala:149) at zio.ZIO$.$anonfun$foreachDiscard$3(ZIO.scala:3411) at com.normation.rudder.git.ZipUtils.zip(ZipUtils.scala:146) at com.normation.rudder.git.ZipUtils.zip(ZipUtils.scala:143) at com.normation.rudder.git.GitFindUtils.getZip(GitFindUtils.scala:201) at com.normation.rudder.git.GitFindUtils.getZip(GitFindUtils.scala:200) at com.normation.rudder.rest.lift.SystemApiService11.getZip(SystemApi.scala:847) at com.normation.rudder.rest.lift.SystemApiService11.getZip(SystemApi.scala:840) at com.normation.rudder.rest.lift.SystemApiService11.getZip(SystemApi.scala:853) at com.normation.rudder.rest.lift.SystemApiService11.getZip(SystemApi.scala:854) at com.normation.zio.ZioRuntime.unsafeRun(ZioCommons.scala:445) Caused by: java.lang.NullPointerException: Cannot invoke "String.endsWith(String)" because the return value of "com.normation.rudder.git.ZipUtils$Zippable.path()" is null
Zippable.path can be null, because java. It must be checked for or encapsulated in an IOResult.attempt
ZIO.foreachDiscard(unique) { x => val name = x.useContent match { case None => if (x.path.endsWith("/")) { x.path } else { x.path + "/" } case Some(is) => if (x.path.endsWith("/")) { x.path.substring(0, x.path.size - 1) } else { x.path } } IOResult.attempt(zout.putNextEntry(new ZipEntry(name))) *> ( x.useContent match { case None => ().succeed case Some(x) => x(addToZout) } ) }
Files
Updated by Elaad FURREEDAN 22 days ago
Can be reproduced by downloading global archive zip from the UI
Updated by François ARMAND 21 days ago
- Priority changed from To review to 1 (highest)
Updated by François ARMAND 21 days ago
So, the culprit is:
2024-12-19 15:31:00+0000 INFO net.liftweb.http.LiftServlet - Request for /rudder/lift/ajax/F16475049919103KXMAV-00/ failed A zippable can not be created with an 'null' path (useContent is empty) zio.FiberFailure: A zippable can not be created with an 'null' path (useContent is empty) at com.normation.rudder.git.ZipUtils$Zippable.<init>(ZipUtils.scala:66) at com.normation.rudder.git.ZipUtils$Zippable$.make(ZipUtils.scala:76) at com.normation.rudder.git.GitFindUtils$.$anonfun$getZip$2(GitFindUtils.scala:199) at scala.collection.immutable.List.map(List.scala:246) at scala.collection.immutable.List.map(List.scala:79) at com.normation.rudder.git.GitFindUtils$.$anonfun$getZip$1(GitFindUtils.scala:199) at zio.ZIO.$anonfun$map$2(ZIO.scala:960) at com.normation.rudder.git.GitFindUtils.getZip(GitFindUtils.scala:198) at com.normation.rudder.rest.lift.SystemApiService11.getZip(SystemApi.scala:847)
Updated by François ARMAND 21 days ago
We have a `file.getParent` that can be null and we don't check for it.
Updated by François ARMAND 21 days ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Clark ANDRIANASOLO
- Pull Request set to https://github.com/Normation/rudder/pull/6098
Updated by Anonymous 20 days ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|e13b97edfc29ef18a2b7ee6f5f668bc658e3d3cb.
Updated by François ARMAND 7 days ago
- Fix check changed from To do to Checked
Checked on snapshot 8.1 with a build from 2025-01-02T00:52:19Z
Actions