apache/beam · error · ValueError

Value for sideinput %s not provided

Error message

Value for sideinput %s not provided

What it means

PerWindowInvoker._get_arg_placeholders computes argument placeholders for the process method. When a SideInputParam is next in positional order but positional args are exhausted and the value isn't in input_kwargs, the side input value is genuinely missing, so ValueError names the missing side input.

Source

Thrown at sdks/python/apache_beam/runners/common.py:752

    if core.DoFn.ElementParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.KeyParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.WindowParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.WindowedValueParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.TimestampParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.PaneInfoParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif core.DoFn.SideInputParam == d:
      # If no more args are present then the value must be passed via kwarg
      try:
        args_with_placeholders.append(next(remaining_args_iter))
      except StopIteration:
        if a not in input_kwargs:
          raise ValueError("Value for sideinput %s not provided" % a)
    elif isinstance(d, core.DoFn.StateParam):
      args_with_placeholders.append(ArgPlaceholder(d))
    elif isinstance(d, core.DoFn.TimerParam):
      args_with_placeholders.append(ArgPlaceholder(d))
    elif isinstance(d, type) and core.DoFn.BundleFinalizerParam == d:
      args_with_placeholders.append(ArgPlaceholder(d))
    elif isinstance(d, core.DoFn.BundleContextParam):
      args_with_placeholders.append(ArgPlaceholder(d))
    elif isinstance(d, core.DoFn.SetupContextParam):
      args_with_placeholders.append(ArgPlaceholder(d))
    else:
      # If no more args are present then the value must be passed via kwarg
      try:
        args_with_placeholders.append(next(remaining_args_iter))
      except StopIteration:
        pass
  args_with_placeholders.extend(list(remaining_args_iter))

View on GitHub (pinned to 12126d8942)

Solutions

  1. Pass the side input value as a keyword argument matching the parameter name
  2. Ensure create_invoker received the side_inputs list aligned with the DoFn's SideInputParam order
  3. Fix the calling harness to supply all positional args the process method expects

Example fix

// before
invoker.invoke_process(window_value, args=[el])  # si param unfilled
// after
invoker.invoke_process(window_value, args=[el], kwargs={'si': side_input_value})
Defensive patterns

Strategy: validation

Validate before calling

import inspect
n_side_inputs = sum(1 for p in inspect.signature(fn.process).values if p.default is DoFn.SideInputParam)
assert len(positional_args) + n_side_inputs >= expected_param_count, 'side input value missing'

Try / catch

try:
    invoker.invoke_process(wv, args=args, kwargs=kwargs)
except ValueError as e:
    if 'sideinput' in str(e): ...  # repair kwargs and retry once

Prevention

When it happens

Trigger: process(self, el, si=DoFn.SideInputParam) invoked where the runner/harness supplies fewer positional args than parameters and no matching kwarg for the side input — e.g. side_inputs list misordered or a side input omitted from the invoker setup.

Common situations: Custom runners/tests invoking DoFns without passing side-input values; mismatch between pcoll | Map(fn, AsSingleton(x)) wiring and the invoker's side_inputs argument.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/7f1cff044c9c3917. Report an issue: GitHub.