Incorrectly works plugin pre-function

I try to replace openresty on kong, but got the issue. Now I have 8 services (excluding admin-api) and the same number of routes. 3 routes have dynamic location, like here:


For this route I wrote pre-function, that is used for autorization. From time to time during testing we got errors 4xxx. In logs of kong I see 200, but after it I see nginx-log where I see 400 error. The issues appears only during a full testing, if we launch test by one, it doesn’t appear. As a results we can’t find the reason of the issue. Maybe the plugin serverless works incorrectly under load

2018/10/09 12:57:39 [notice] 27#0: *162354 [kong] [string "m = ngx.ctx.router_matches..."]:45 [pre-function] @@ service=path1, url=TEST-7dd1dff0-0c17-43f9-ae9b-89bd728235d1/cancel, method=PUT, status=200, body={"jwtError":null,"valid":true}, client:, server: kong, request: "PUT /path1/TEST-7dd1dff0-0c17-43f9-ae9b-89bd728235d1/cancel HTTP/1.0", host: "" - - [09/Oct/2018:12:57:39 +0000] "PUT /path1/TEST-7dd1dff0-0c17-43f9-ae9b-89bd728235d1/cancel HTTP/1.0" 400 45 "-" "e2e/OperatorController"```