{"record":{"id":"0f777ead0879bdd9","repo":"apache/beam","slug":"unknown-access-pattern-s-bundle-processor","errorCode":null,"errorMessage":"Unknown access pattern: '%s'","messagePattern":"Unknown access pattern: '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/worker/bundle_processor.py","lineNumber":495,"sourceCode":"\n            if key not in cache:\n              keyed_state_key = beam_fn_api_pb2.StateKey()\n              keyed_state_key.CopyFrom(state_key)\n              keyed_state_key.multimap_side_input.key = (\n                  key_coder_impl.encode_nested(key))\n              cache[key] = _StateBackedIterable(\n                  state_handler, keyed_state_key, value_coder)\n\n            return cache[key]\n\n          def __reduce__(self):\n            # TODO(robertwb): Figure out how to support this.\n            raise TypeError(common_urns.side_inputs.MULTIMAP.urn)\n\n        raw_view = MultiMap()\n\n      else:\n        raise ValueError(\"Unknown access pattern: '%s'\" % access_pattern)\n\n      self._cache[target_window] = self._side_input_data.view_fn(raw_view)\n    return self._cache[target_window]\n\n  def is_globally_windowed(self) -> bool:\n    return (\n        self._side_input_data.window_mapping_fn ==\n        sideinputs._global_window_mapping_fn)\n\n  def reset(self) -> None:\n    # TODO(BEAM-5428): Cross-bundle caching respecting cache tokens.\n    self._cache = {}\n\n\nclass ReadModifyWriteRuntimeState(userstate.ReadModifyWriteRuntimeState):\n  def __init__(self, underlying_bag_state):\n    self._underlying_bag_state = underlying_bag_state\n","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/worker/bundle_processor.py#L477-L513","documentation":"When materializing a side input for a given window, the runner maps the declared access pattern (URN) to a view type. If the access pattern is neither ITERABLE, MULTISET, nor the supported MULTIMAP case, it raises 'Unknown access pattern'. The declared side-input view kind is not one this Beam version can build.","triggerScenarios":"A PTransform declares a side input with an access_pattern URN that SideInputData/RemoteSideInputMapImpl.get doesn't recognize (bundle_processor.py:495), e.g. an exotic or newer view URN from a different SDK version.","commonSituations":"Cross-language/portable pipelines where the producing SDK declares view types the Python worker can't materialize; using beam.pvalue.AsDict/AsSingleton variants over unsupported multi-map patterns; version mismatch between harness and pipeline construction.","solutions":["Upgrade apache_beam on both submission and worker sides so the URN is supported","Change the side input to a supported view type (AsIter, AsDict with standard keys)","Avoid cross-language side inputs with unsupported access patterns; materialize via a regular PCollection + join instead","Inspect the access_pattern URN in the pipeline proto to confirm which pattern is declared"],"exampleFix":"// before\nside = beam.pvalue.AsMultiMap(pcoll)  # unsupported pattern in this version\n// after\nside = beam.pvalue.AsDict(pcoll)  # standard supported access pattern","handlingStrategy":"validation","validationCode":"SUPPORTED_VIEW_URNS = {'beam:side_input:iterable', 'beam:side_input:multiset', 'beam:side_input:multimap'}\ndef side_input_supported(pipeline_proto):\n    for t in pipeline_proto.components.transforms.values():\n        for inp in t.inputs.values():\n            # inspect declared access patterns when expanding portable pipelines\n            pass\n    return True  # verify URNs during expansion service output","typeGuard":null,"tryCatchPattern":"try:\n    side = beam.pvalue.AsMultiMap(pcoll)\n    result = (pcoll2 | beam.Map(lambda x, s: x, s=side))\nexcept (ValueError, TypeError) as e:\n    if 'Unknown access pattern' in str(e) or 'MULTIMAP' in str(e):\n        logging.warning('Unsupported side input view; falling back to AsDict')\n        side = beam.pvalue.AsDict(pcoll)\n    else:\n        raise","preventionTips":["Prefer standard view types (AsIter, AsDict, AsSingleton)","Keep worker SDK version in sync with pipeline construction SDK for cross-language pipelines","Inspect expanded pipeline proto access-pattern URNs before running","Avoid exotic/new view types until your Beam version documents support"],"tags":["apache-beam","python","side-input","access-pattern"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}