# Strange error using pangeo-forge-recipes/apache beam in parallel

**URL:** <https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540>\
**Category:** HPC\
**Created:** [September 24, 2024, 10:44am UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540 "2024-09-24T10:44:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![matbro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/matbro/32/2375_2.png) [@matbro](https://discourse.pangeo.io/u/matbro)\
**Post date:** [September 24, 2024, 10:44am UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/1 "2024-09-24T10:44:30Z")

</div>

I’m encountering an error I’m not really sure what to do with when running apache-beam (via pangeo-forge-recipes) with the direct runner with multi process enabled:

```auto
terminate called after throwing an instance of 'std::out_of_range'
  what(): basic_string::erase: __pos (which is 16) > this->size() (which is 15)

```

which as far as I can tell occurs just before the actual data processing through the pipeline.

I’m just curious if anyone has seen this before, a trawl through github and stackoverflow etc. hasn’t been wonderfully helpful so far.

Some more detail available here: [Create example for the UKCEH GEAR-1hrly dataset · Issue #3 · NERC-CEH/object\_store\_tutorial · GitHub](https://github.com/NERC-CEH/object_store_tutorial/issues/3#issuecomment-2318155285)

and the recipe I’m trying to run here: [object\_store\_tutorial/scripts/convert\_GEAR\_beam.py at GEAR · NERC-CEH/object\_store\_tutorial · GitHub](https://github.com/NERC-CEH/object_store_tutorial/blob/GEAR/scripts/convert_GEAR_beam.py)

---

<div class="post-metadata">

**Author:** ![jbusecke](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/jbusecke/32/118_2.png) [@jbusecke](https://discourse.pangeo.io/u/jbusecke)\
**Post date:** [September 24, 2024, 4:36pm UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/2 "2024-09-24T16:36:28Z")

</div>

Hey @matbro. I do not have a concrete clue about this error, but in my experience with beam debugging (which is just gnarly in general) it might be helpful to look at what step the pipeline was at before this occurs.

---

<div class="post-metadata">

**Author:** ![norlandrhagen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/norlandrhagen/32/1966_2.png) [@norlandrhagen](https://discourse.pangeo.io/u/norlandrhagen)\
**Post date:** [September 24, 2024, 5:19pm UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/3 "2024-09-24T17:19:31Z")

</div>

Adding on to what @jbusecke said. Debugging beam pipelines can be a real PITA. One tool I found is helpful is adding a ` | beam.Map(print)` Ptransform to stages in your pipeline to see what the previous PTransform is outputting. ex:

```auto
recipe = (
    beam.Create(pattern.items())
    | OpenWithXarray(file_type=pattern.file_type)
    | beam.Map(print)
)

```

---

<div class="post-metadata">

**Author:** ![matbro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/matbro/32/2375_2.png) [@matbro](https://discourse.pangeo.io/u/matbro)\
**Post date:** [September 25, 2024, 2:23pm UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/4 "2024-09-25T14:23:50Z")

</div>

Thanks both!  
I’ve narrowed it down to being something to do with newer versions of pyarrow (\>8.0.1) and/or it’s dependencies, but other than that who knows xD  
I’ve parked it for now, given I’ve managed to assemble a working environment with older versions of pyarrow, but will be something I’m likely to revisit in future when it comes to deploying this workflow/recipe in anger!!

---

<div class="post-metadata">

**Author:** ![jbusecke](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/jbusecke/32/118_2.png) [@jbusecke](https://discourse.pangeo.io/u/jbusecke)\
**Post date:** [October 9, 2024, 5:06pm UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/5 "2024-10-09T17:06:07Z")

</div>

Sounds good @matbro. I also wanted to flag that we have reorganized bi-weekly [working group meetings for PGF](https://www.pangeo.io/meetings). That might be a good spot to talk in more detail!

---

<div class="post-metadata">

**Author:** ![matbro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/matbro/32/2375_2.png) [@matbro](https://discourse.pangeo.io/u/matbro)\
**Post date:** [October 22, 2024, 7:26am UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/6 "2024-10-22T07:26:57Z")

</div>

Amazing, thanks @jbusecke that definitely sounds like something I should be a part of!  
I can’t tell which weeks it is happening as the [https://pangeo.io/meeting-notes.html#meetings-calendar](https://pangeo.io/meeting-notes.html#meetings-calendar) page seems to be 404ing at the moment - is there another place I can find it?

---

<div class="post-metadata">

**Author:** ![keewis](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/keewis/32/1106_2.png) [@keewis](https://discourse.pangeo.io/u/keewis)\
**Post date:** [October 22, 2024, 9:15am UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/7 "2024-10-22T09:15:44Z")

</div>

the meetings will start this week, see the [calendar](https://calendar.google.com/calendar/u/0/embed?src=ucar.edu_c23ln4014khs3f65o93vqv5kqc@group.calendar.google.com&ctz=America/Los_Angeles&pli=1).

The website has been changed, and the meetings page has been moved to [Meetings | Pangeo](https://pangeo.io/meetings) (the calendar is missing, though, I pulled the link out of the [old website’s sources](https://github.com/pangeo-data/pangeo/blob/master/docs/meeting-notes.rst) – see [link to the meetings calendar? · Issue #40 · pangeo-data/pangeo.io · GitHub](https://github.com/pangeo-data/pangeo.io/issues/40)).

---

<div class="post-metadata">

**Author:** ![matbro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/matbro/32/2375_2.png) [@matbro](https://discourse.pangeo.io/u/matbro)\
**Post date:** [October 22, 2024, 9:54am UTC](https://discourse.pangeo.io/t/strange-error-using-pangeo-forge-recipes-apache-beam-in-parallel/4540/8 "2024-10-22T09:54:01Z")

</div>

thanks @keewis  
Can’t make this week but should be able to going forward
