Skip to content

Upgrade fails when chunking is enabled: file docids like '123_c1' aren't plain numbers #168

Description

@tsmilan

The upgrade step for version 2026051404 adds a fileid column to search_elastic_errors and fills it in for old rows with this SQL:

UPDATE search_elastic_errors SET fileid = CAST(docid AS int)
WHERE docid NOT LIKE '%-%'

The idea is: if the docid has no dash, it's a file, so just read it as a number. But when chunking is turned on, a file's docid looks like 123_c1
instead of 123. That still has no dash, so it matches the filter, but it's not a plain number.

There's a second copy of the same bug that is a problem too: error_service::save_error() decides the fileid with is_numeric($documentid) ? (int)$documentid : null. Since '123_c1' isn't numeric, any new error logged for a chunked file gets fileid = null from then on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions