Skip to content

#2886 Fix to empty zips#2899

Open
hauck-jvsh wants to merge 1 commit into
masterfrom
#2886_fix
Open

#2886 Fix to empty zips#2899
hauck-jvsh wants to merge 1 commit into
masterfrom
#2886_fix

Conversation

@hauck-jvsh

Copy link
Copy Markdown
Member

closes #2886

…200 and a new field warnings with the invalid files. This also accepts the current behavior by checking if the error message is "Nenhuma imagem válida encontrada no arquivo ZIP". If this is the case, IPED should not abort, but only marks all the files with classificationFail.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates RemoteImageClassifierTask to better handle batches where the remote classifier returns partial/empty results (including the “no valid images in ZIP” HTTP 400 scenario from #2886), aiming to avoid aborting case processing and to record clearer failure status per evidence.

Changes:

  • Logs server-side per-file warnings returned in the JSON response and attempts to map them back to local evidences.
  • Marks evidences as failNoResults when the server omits them from the results array (partial/empty result sets).
  • Treats a specific HTTP 400 “no valid images in ZIP” response as non-fatal, marking the batch as failNoResults instead of aborting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +416 to +426
for (JsonNode warning : warnings) {
JsonNode filename = warning.get("filename");
JsonNode error = warning.get("error");
String name = filename.asText();
IItem evidence = getEvidenceByServerFilename(name);
if (evidence != null) {
logger.warn("ClassificationWarn::ServerWarning: filename: {} path: {} - {}", name, evidence.getPath(), error.asText());
} else {
logger.warn("ClassificationWarn::ServerWarning: filename: {} path: <not found> - {}", name, error.asText());
}
}
Comment on lines +429 to +435
private IItem getEvidenceByServerFilename(String name) {
IItem evidence = queue.get(name);
if (evidence == null && name.split("_").length == 2) {
evidence = queue.get(name.split("_")[1]);
}
return evidence;
}
@lfcnassif

lfcnassif commented Jun 23, 2026

Copy link
Copy Markdown
Member

@aberenguel, could you help reviewing and testing this fix?

PS: Since you tried to fix the same issue a while ago and have knowledge about the issue.

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

Successfully merging this pull request may close these issues.

RemoteImageClassifierTask: processing stopped by "HTTP Status Code: 400 - Nenhuma imagem válida encontrada no arquivo ZIP"

3 participants