pathwaycom/pathway · error · RuntimeError

Failed to install dependencies

Error message

Failed to install dependencies

What it means

Pathway IO connectors that support replay positions (e.g. Kafka-style 'start_from') validate the pair (start_from, start_from_timestamp_ms) before passing them to the engine. When start_from='timestamp', the timestamp must be explicitly supplied because the internal encoding cannot distinguish 'unset' from 'not provided' in that mode.

Source

Thrown at python/pathway/cli.py:245

        requirements_path = repository_path / "requirements.txt"
        if program.startswith("python"):
            program = venv_path / "bin" / program
        if requirements_path.exists():
            pip_path = venv_path / "bin" / "pip"
            command = [
                os.fspath(pip_path),
                "install",
                "-r",
                os.fspath(requirements_path),
            ]
            pip_handle = subprocess.run(
                command,
                stderr=subprocess.STDOUT,
            )
            if pip_handle.returncode != 0:
                process_stdout = pip_handle.stdout.decode("utf-8")
                logging.error(f"Failed to install requirements:\n{process_stdout}")
                raise RuntimeError("Failed to install dependencies")
        os.chdir(repository_path)

    run_id = str(uuid.uuid4())
    process_handles = []
    try:
        process_handles = create_process_handles(
            processes=processes,
            threads=threads,
            first_port=first_port,
            addresses=addresses,
            process_id=process_id,
            run_id=run_id,
            program=program,
            arguments=arguments,
            env_base=env_base,
        )
        handles_state = ProcessHandlesState()
        while not handles_state.has_process_with_error:

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Pass start_from_timestamp_ms as a non-negative integer of milliseconds since the UNIX epoch, e.g. start_from_timestamp_ms=1700000000000.
  2. If you actually want to start at the latest available message, use start_from="end" instead and remove start_from_timestamp_ms.
  3. If you want to replay everything from the beginning, use start_from="start" (or the connector's equivalent) and remove start_from_timestamp_ms.

Example fix

# before
pw.io.kafka.read(..., start_from="timestamp")

# after
pw.io.kafka.read(..., start_from="timestamp", start_from_timestamp_ms=1700000000000)
Defensive patterns

Strategy: validation

Validate before calling

def check_start_from(start_from: str, ts: int | None) -> None:
    if start_from == "timestamp":
        assert ts is not None, "start_from='timestamp' needs start_from_timestamp_ms"

check_start_from(start_from, start_from_timestamp_ms)
pw.io.kafka.read(..., start_from=start_from, start_from_timestamp_ms=start_from_timestamp_ms)

Type guard

def is_valid_start_from(start_from: str, ts: int | None) -> bool:
    return not (start_from == "timestamp" and ts is None)

Prevention

When it happens

Trigger: Calling a Pathway IO read API with start_from="timestamp" while omitting start_from_timestamp_ms, e.g. pw.io.kafka.read(..., start_from="timestamp") with no timestamp keyword.

Common situations: User copies an example that used start_from="end" or "latest" and switches the string to "timestamp" without adding the timestamp argument; or refactors parameter names and drops the timestamp argument by mistake.

Related errors


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