apache/beam · error · RuntimeValueProviderError

not accessible

Error message

%s not accessible

What it means

The @check_accessible decorator guards methods that require all referenced value providers to be readable. If any wrapped value provider is not accessible (its value not yet provided at runtime), it raises RuntimeValueProviderError naming the inaccessible provider.

Solutions

  1. Ensure every option's value is provided at runtime (pass all required flags/template parameters)
  2. Check is_accessible() on each value provider before calling the decorated method
  3. Use default values for options so providers are always accessible
  4. Switch to StaticValueProvider where the value is known at graph construction

Example fix

// before
opts.label.get()  # raises if not provided
// after
vp = opts.label
value = vp.get() if vp.is_accessible() else 'default-label'
Defensive patterns

Strategy: type-guard

Validate before calling

if not all(getattr(holder, name).is_accessible() for name in holder.value_provider_list):
    raise RuntimeError('not all value providers are accessible')

Type guard

def all_accessible(holder):
    return all(getattr(holder, vp).is_accessible() for vp in holder.value_provider_list)

Try / catch

try:
    result = holder.as_dict()
except RuntimeValueProviderError as ex:
    logger.error('missing runtime option: %s', ex)
    raise

Prevention

When it happens

Trigger: Calling a decorated method (e.g. AsDict or similar on a value provider holder) while one of the value_provider_list providers has no runtime value; template-based execution where an option was left unset.

Common situations: Dataflow templates launched without all template parameters filled; dereferencing pipeline options at build time; missing command-line flags for declared options.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at sdks/python/apache_beam/options/value_provider.py:191


def check_accessible(value_provider_list):
  """A decorator that checks accessibility of a list of ValueProvider objects.

  Args:
    value_provider_list: list of ValueProvider objects
  Raises:
    ``RuntimeValueProviderError``: if any of the provided objects are not
      accessible.
  """
  assert isinstance(value_provider_list, list)

  def _check_accessible(fnc):
    @wraps(fnc)
    def _f(self, *args, **kwargs):
      for obj in [getattr(self, vp) for vp in value_provider_list]:
        if not obj.is_accessible():
          raise error.RuntimeValueProviderError('%s not accessible' % obj)
      return fnc(self, *args, **kwargs)

    return _f

  return _check_accessible

View on GitHub (pinned to 12126d8942)