# Error running the solution for source routing

**URL:** <https://forum.p4.org/t/error-running-the-solution-for-source-routing/348>\
**Category:** Getting Started with P4\
**Created:** [May 25, 2022, 10:29pm UTC](https://forum.p4.org/t/error-running-the-solution-for-source-routing/348 "2022-05-25T22:29:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggowdra](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@ggowdra](https://forum.p4.org/u/ggowdra)\
**Post date:** [May 25, 2022, 10:29pm UTC](https://forum.p4.org/t/error-running-the-solution-for-source-routing/348/1 "2022-05-25T22:29:51Z")

</div>

Hi,  
I am trying out the solution provided for source routing exercise in the P4 Lang Tutorials here - [tutorials/source\_routing.p4 at master · p4lang/tutorials · GitHub](https://github.com/p4lang/tutorials/tree/master/exercises/source_routing/solution/source_routing.p4).  
When I execute “make run”, I get below error.

```auto
mkdir -p build pcaps logs
p4c-bm2-ss --p4v 16 --p4runtime-files build/source_routing.p4.p4info.txt -o build/source_routing.json source_routing.p4
source_routing.p4(76): [--Werror=type-error] error: hdr.srcRoutes: argument must be a header
        packet.extract(hdr.srcRoutes);
                       ^^^^^^^^^^^^^
make: *** [../../utils/Makefile:43: source_routing.json] Error 1

```

It is not obvious to me on what the issue is analyzing the code. I am mostly sure there is no issue in my environment as I have been able to execute all the previous exercises successfully. This is Vagrant environment setup from the Vagrant file at [tutorials/vm-ubuntu-20.04 at master · p4lang/tutorials · GitHub](https://github.com/p4lang/tutorials/tree/master/vm-ubuntu-20.04) .

- girish

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [May 26, 2022, 4:21am UTC](https://forum.p4.org/t/error-running-the-solution-for-source-routing/348/2 "2022-05-26T04:21:06Z")

</div>

In the latest p4lang/tutorials repository code that I see, there is no line of code in the solutions/source\_routing.p4 source file that is exactly this line from your error message: `packet.extract(hdr.srcRoutes);`. The closest to that I see is this line, but it is slightly different: [tutorials/source\_routing.p4 at master · p4lang/tutorials · GitHub](https://github.com/p4lang/tutorials/blob/master/exercises/source_routing/solution/source_routing.p4#L76)

Are you using an older version of the file than the latest? Or perhaps you have edited your copy to be slightly different than the file solutions/source\_routing.p4 ?

---

<div class="post-metadata">

**Author:** ![ggowdra](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@ggowdra](https://forum.p4.org/u/ggowdra)\
**Post date:** [May 26, 2022, 3:55pm UTC](https://forum.p4.org/t/error-running-the-solution-for-source-routing/348/3 "2022-05-26T15:55:01Z")

</div>

Thank Andy for the response.  
It was definitely an error on my part. The original solution was accidentally modified and I did not realize until you pointed out. All good now. Thanks.
