pathwaycom/pathway · error · ValueError

start_from_timestamp_ms must be a non-negative number of mil

Error message

start_from_timestamp_ms must be a non-negative number of milliseconds since the UNIX epoch; got {start_from_timestamp_ms}

What it means

Error "start_from_timestamp_ms must be a non-negative number of milliseconds since the UNIX epoch; got {start_from_timestamp_ms}" thrown in pathwaycom/pathway.

Source

Thrown at python/pathway/io/_utils.py:686

def resolve_start_from_timestamp_ms(
    start_from: str,
    start_from_timestamp_ms: int | None,
) -> int | None:
    """Validates a (``start_from``, ``start_from_timestamp_ms``) pair and encodes
    it into the single ``start_from_timestamp_ms`` field understood by the engine.

    The engine reserves ``-1`` in this field as an internal sentinel for
    ``start_from="end"``, so an explicit timestamp must be non-negative —
    otherwise a user-provided ``-1`` would silently turn into "start from
    the end of the stream" instead of raising an error.
    """
    if start_from == "timestamp":
        if start_from_timestamp_ms is None:
            raise ValueError(
                "start_from_timestamp_ms is required when start_from='timestamp'"
            )
        if start_from_timestamp_ms < 0:
            raise ValueError(
                "start_from_timestamp_ms must be a non-negative number of"
                f" milliseconds since the UNIX epoch; got {start_from_timestamp_ms}"
            )
        return start_from_timestamp_ms
    if start_from_timestamp_ms is not None:
        raise ValueError(
            f"start_from_timestamp_ms must not be set when start_from='{start_from}'"
        )
    return -1 if start_from == "end" else None


def _get_unique_name(
    name: str | None, kwargs: dict[str, Any], stacklevel: int = 6
) -> str:
    deprecated_name = kwargs.get("persistent_id")
    if name is not None:
        if deprecated_name is not None:
            raise ValueError(

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Pass a non-negative Unix epoch timestamp in milliseconds (>= 0).

Example fix

pw.io.kafka.read(rdkafka_settings, topic='t', start_from='timestamp', start_from_timestamp_ms=1700000000000)

When it happens

Trigger: Thrown at python/pathway/io/_utils.py:686 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/a5abf5141f6d6cf2. Report an issue: GitHub.