Why am I gettting "findAll.exists extraction crashed: end of input expected when trying to extract values from a returned body"?

I have the following .check on my returned body: (I changed the values for security reasons but the structure is the same)

.exec(http(“Get ids”)
.post(“GetIds”)
.body(ElFileBody(“json/getIds.json”)).asJson

.check(jsonPath("$…Types…[?(@.Id == ‘web’)].id").findAll.saveAs(“IDLlist”))

But the transaction fails with “Gettting findAll.exists extraction crashed: end of input expected when trying to extract values from a returned body”
Gatling prints the body of the failed transaction, when I take the exact body that the transaction failed on to http://jsonpath.com/ and
evaluate the jsonpath that had just failed, I get good results. This means that the returned body is correct and that the jsonpath is also correct.
What is the issue then?

No clue. Please provide a way to reproduce your problem.

Also, please make sure you use latest Gatling version.

Not sure exactly how to go about this as it contains sensitive data.
I using version 3.3.1

You have different options:

  • share access to your application publicly
  • build a sample app that exhibits the same behavior
  • investigate by yourself
  • contract with us under NDA so we can investigate on your actual application
    “end of input” means payload was truncated and JSON is malformed.

Wait, what are these triple dots???

$…Types…[?(@.Id == ‘web’)].id

Ok here is an example of a json body with the above issue.
Note that if you run the jsonpath in http://jsonpath.com/? you get the requested result ($…Files…[?(@.Format == ‘DASH_Web’)].URL)

[
{
“MediaID”: “563484”,
“MediaName”: “Первый Канал”,
“MediaTypeID”: “600”,
“MediaTypeName”: “Linear”,
“Rating”: 0.0,
“ViewCounter”: 0,
“Description”: “”,
“CreationDate”: “2018-02-05T15:32:07”,
“LastWatchDate”: null,
“StartDate”: “2018-02-05T08:00:00”,
“CatalogStartDate”: “2018-02-05T08:00:00”,
“PicURL”: null,
“URL”: null,
“MediaWebLink”: “”,
“Duration”: null,
“FileID”: “0”,
“MediaDynamicData”: null,
“SubDuration”: null,
“SubFileFormat”: null,
“SubFileID”: null,
“SubURL”: null,
“GeoBlock”: null,
“TotalItems”: 1011,
“like_counter”: 0,
“EntryId”: “”,
“Tags”: [
{
“Key”: “region_whitelist”,
“Value”: “77|90”
},
{
“Key”: “default_lcn”,
“Value”: “1”
},
{
“Key”: “genre”,
“Value”: “Эфирные”
},
{
“Key”: “beeline_osd”,
“Value”: “sub_id=20879|sub_id=20880|sub_id=20881|sub_id=20882|sub_id=20883|sub_id=20888|sub_id=20950|sub_id=20951|sub_id=20952”
}
],
“Metas”: [
{
“Key”: “series_id”,
“Value”: “”
},
{
“Key”: “series_name”,
“Value”: “”
},
{
“Key”: “episode_name”,
“Value”: “”
},
{
“Key”: “quality”,
“Value”: “”
},
{
“Key”: “collection_id”,
“Value”: “”
},
{
“Key”: “collection_rank”,
“Value”: “”
},
{
“Key”: “content_reference_id”,
“Value”: “”
},
{
“Key”: “playable_start”,
“Value”: “”
},
{
“Key”: “playable_end”,
“Value”: “”
},
{
“Key”: “presentable_end”,
“Value”: “”
},
{
“Key”: “adult”,
“Value”: “0”
},
{
“Key”: “downloadable”,
“Value”: “0”
}
],
“AdvertisingParameters”: [

],
“Files”: [
{
“FileID”: “1246450”,
“URL”: “https://video.test.com/live/h/test343242.isml/index-ios_mobile.m3u8”,
“Duration”: “0”,
“Format”: “HLS_Tablet”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246451”,
“URL”: “https://video.test.com/live/h/test343242.isml/index-web_hls.m3u8”,
“Duration”: “0”,
“Format”: “HLS_Web”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246452”,
“URL”: “http://video.test.com/live/d/test343242.isml/testers-stb.mpd”,
“Duration”: “0”,
“Format”: “DASH_STB”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “Channel1234”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246453”,
“URL”: “http://video.test.com/live/d/test343242.isml/testers-mobile_android.mpd”,
“Duration”: “0”,
“Format”: “DASH_Tablet”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246454”,
“URL”: “https://video.test.com/live/d/test343242.isml/testers-web_dash.mpd”,
“Duration”: “0”,
“Format”: “DASH_Web”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246455”,
“URL”: “http://video.test.com/live/s/test343242.isml/testers-smart”,
“Duration”: “0”,
“Format”: “SS_TV”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
},
{
“FileID”: “1246456”,
“URL”: “https://video.test.com/live/s/test343242.isml/testers-web_ss”,
“Duration”: “0”,
“Format”: “SS_Web”,
“PreProvider”: null,
“PostProvider”: null,
“BreakProvider”: null,
“OverlayProvider”: null,
“BreakPoints”: null,
“OverlayPoints”: null,
“Language”: “rus”,
“IsDefaultLang”: false,
“CoGuid”: “test343242”,
“CatalogEndDate”: “1/1/2099 12:00:00 AM”
}
],
“Pictures”: [
{
“PicSize”: “”,
“URL”: “http://test.com/Service.svc/image/p/438/etity_id/3e1197b93384458ea15421de76cf50a0_1/version/1”,
“ID”: “3e1197b93384458ea15421de76cf50a0_1”,
“Version”: 1,
“Ratio”: “16:9”,
“IsDefault”: false
},
{
“PicSize”: “”,
“URL”: “http://test.com/Service.svc/image/p/438/etity_id/b0653588a0ec4fc4ab660018e3b34f91_50/version/1”,
“ID”: “b0653588a0ec4fc4ab660018e3b34f91_50”,
“Version”: 1,
“Ratio”: “channel_logo_1_1”,
“IsDefault”: false
},
{
“PicSize”: “”,
“URL”: “http://test.com/Service.svc/image/p/438/etity_id/a427d73ea50947ee85d799cd374ece66_51/version/1”,
“ID”: “a427d73ea50947ee85d799cd374ece66_51”,
“Version”: 1,
“Ratio”: “channel_logo_2_1”,
“IsDefault”: false
},
{
“PicSize”: “”,
“URL”: “http://test.com/Service.svc/image/p/438/etity_id/7a5626babf82445ab44624021d0b055c_55/version/2”,
“ID”: “7a5626babf82445ab44624021d0b055c_55”,
“Version”: 2,
“Ratio”: “channel_img_2_3”,
“IsDefault”: false
}
],
“ExternalIDs”: [
{
“Key”: “test_id”,
“Value”: “4478”
}
]
}
]

Dots are child elements within the current element, I have posted an example of the problematic.
You can test it in http://jsonpath.com/?

… is not valid JsonPath syntax, please read this: https://gatling.io/2019/07/31/introducing-jmespath-support/

$…Files[?(@.Format == ‘DASH_Web’)].URL is correct

Thank you, works like a charm.
I think that the important point to take from this is not to relay on jsonpath.com as it actually parse both variations.

As I wrote in the blog post, results are not consistent across JsonPath implementation. In particular, js implementations like the one used on jsonpath.com tend to be very lax/surprising wrt syntax.

If you want consistent results, give up on JsonPath and go with JmesPath whose syntax is properly specified.