Bug #26926
openOn Raspberry 5, error getting generic methods metadata - generic_methods.json truncated at 256 Ko
Description
EDIT: solution would be to have a rudderc option to write to the destination file directly.
Opening the Technique editor page displays :
Error Error when getting methods: Could not get generic methods metadata ‣ An Error occurred while extracting data from generic methods ncf API ‣ Inconsistency: Unexpected end of input
It appears that /var/rudder/configuration-repository/ncf/generic_methods.json is incomplete, and truncated at exactly 256 Ko (262144).
Log says :
2025-05-20 08:09:41+0200 ERROR net.liftweb.actor.ActorLogger - Actor threw an exception zio.FiberFailure: Chained(An Error occurred while extracting data from generic methods ncf API,Inconsistency(Unexpected end of input)) at com.normation.errors.EitherToIoResult.toIO(ZioCommons.scala:255) at com.normation.errors.IOChainError.chainError(ZioCommons.scala:235) at com.normation.rudder.ncf.GenericMethodSerialization.decodeGenericMethodLib(EditorTechniqueReader.scala:297) at com.normation.rudder.ncf.EditorTechniqueReaderImpl.readMethodsMetadataFile(EditorTechniqueReader.scala:124) at com.normation.rudder.ncf.EditorTechniqueReaderImpl.readMethodsMetadataFile(EditorTechniqueReader.scala:120) at com.normation.rudder.ncf.EditorTechniqueReaderImpl.getMethodsMetadata(EditorTechniqueReader.scala:108) at com.normation.rudder.ncf.EditorTechniqueReaderImpl.readTechniquesMetadataFile(EditorTechniqueReader.scala:83) at com.normation.rudder.ncf.TechniqueCompilationStatusService.get(TechniqueCompilationCache.scala:168) at com.normation.zio.ZioRuntime.unsafeRun(ZioCommons.scala:497) 2025-05-20 08:09:41+0200 WARN application - Uncaught exception in thread 'pool-2-thread-230' (in threadgroup 'main'): 'zio.FiberFailure': 'Chained(An Error occurred while extracting data from generic methods ncf API,Inconsistency(Unexpected end of input))' (add it in /opt/rudder/etc/rudder-web.properties -> 'rudder.jvm.fatal.exceptions' to make it fatal)
Files
Updated by François ARMAND 3 months ago
- Subject changed from Error getting generic methods metadata - generic_methods.json truncated at 256 Ko to On Raspberry 5, error getting generic methods metadata - generic_methods.json truncated at 256 Ko
- Description updated (diff)
- Assignee set to Alexis Mousset
- Priority changed from To review to 3
For now, I wasn't able to reproduce it. It might be linked with some specific behavior of NuProcess on that plateform. A workaround would be to have rudderc
to directly write the file to the resulting file, because here we are hoping through the JVM for nothing.
Updated by Vincent MEMBRÉ 2 months ago
- Target version changed from 8.3.2 to 8.3.3
Updated by Félix DALLIDET 25 days ago
- Target version changed from 8.3.3 to 8.3.4
Updated by François ARMAND 22 days ago
So, after more assessment:
- the problem is NOT on the write part. The file is already truncated in memery after read
- so the problem is when we read rudderc
stdout, the truncation happens here
- we do read other process the same way in other part of rudder
- so it is likelly that rust/rudderc is either a bit too quick to close it's stdout channel or that the IO dance/sync between rust and NuCommand is not working well.
Next:
- we can focus on a reproducer that read rudderc stdout and iterate more quickly
- the fact that it happens only on rasp5 is strange. Perhaps there is something special on the (default linux/raspian) config of IO that we don't have in other place.
Updated by François ARMAND 22 days ago
- Has duplicate Bug #27283: bootchecks - An error occurred while migrating techniques added
Updated by François ARMAND 22 days ago
- Status changed from New to In progress
- Assignee changed from Alexis Mousset to François ARMAND