Skip to content

fix: keep document content out of the failed-file warning and record a rejection once - #34

Merged
marevol merged 1 commit into
mainfrom
fix/no-datamap-in-warn
Dec 4, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/no-datamap-in-warn

Conversation

@marevol

@marevol marevol commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

  • When processing a file failed, the data store logged the whole data map at WARN, so the content of the document and every other mapped field went into the crawler log.
  • fix(indexing): record a rejected document of a data store crawl as its own failure URL fess#4037 makes a data store crawl record each document that the search engine rejects, and marks the thrown exception so that nothing else is stored for it. The Git data store removes credentials from exception messages by copying the exception into a plain RuntimeException, which loses the mark. The file that happened to fill the batch then gets one more failure URL. This happens whenever the redaction changes the message, for example:
    • a rejected document URL with ? or # right after the host and an @ later, such as https://viewer.example.com?file=logo@2x.png (the batch is shared by the data configurations of a job, so it need not be a Git document);
    • a rejection reason that quotes a URL with userinfo, such as the value of a date field that could not be parsed. The latest revision of fix(indexing): record a rejected document of a data store crawl as its own failure URL fess#4037 no longer puts such values into the reason, so this applies only to its earlier revisions.

Change

  • Both warnings of a failed file now name the repository (credentials removed) and the path, as the failure URL does, with the redacted exception. DEBUG output is unchanged.
  • Before storing a failure URL for any other failure, the data store asks the original exception isRecorded(), and stores nothing if it says yes. The redaction itself, and everything that is logged or stored, is as before. The method is looked up by name, so there is no compile-time dependency on fix(indexing): record a rejected document of a data store crawl as its own failure URL fess#4037; with a Fess that does not have it, failure URLs are stored as before.

Tests

  • New unit test for the warning, covering both catch blocks; each failed before its line was changed.
  • New unit test for a recorded and an unrecorded rejection, using a stand-in exception; it failed before the change.
  • mvn formatter:format license:format package: 68 tests pass.
  • Checked locally against a build of an earlier revision of fix(indexing): record a rejected document of a data store crawl as its own failure URL fess#4037, with its IndexUpdateCallbackImpl, IndexingHelper and FailureUrlService (the storage of the records stubbed) and documents rejected by OpenSearch 3.10.1: both examples above gave two failure URLs before and one after, and an ordinary URL gave one both times. This check is not part of the pull request.
  • Live crawl of a local repository with Fess 15.10.0-SNAPSHOT and OpenSearch 3.10.1, with a file that cannot be stored: the warning held the file content before, and names the repository and path after; the content appears nowhere in the Fess logs. Only the warning for general failures was exercised live; the one for CrawlingAccessException and the recorded rejection are covered as described above.

…a rejection once

The warning for a file that failed logged the whole data map. It now names the
repository and path, as the failure URL does, with the exception.

An exception that reports with isRecorded() that its failure URLs are already
stored loses that when it is copied to remove credentials from its message. The
data store now asks the original and stores no further failure URL for it.
@marevol marevol added this to the 15.10.0 milestone Dec 4, 2026
@marevol marevol self-assigned this Dec 4, 2026
@marevol
marevol merged commit fd71962 into main Dec 4, 2026
1 check passed
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.

1 participant