Layer7 API Management

Expand all | Collapse all

POLICY MANAGER ERROR:Failing because expression was not matched

Jump to Best Answer
  • 1.  POLICY MANAGER ERROR:Failing because expression was not matched

    Posted 05-25-2018 02:30 AM

    Hi All,

     

    I am working on CA API Gateway 9.3, I am trying to publish rest we service.

     

    I followed below steps: 

     

    1)Tasks - Services and APIs - Publish RESTful Service Proxy with WADL. 

    2)I tried both manual and add WADL option

    3)Access control default option(Anonymous)

    4)Enable policy debugging policy trace 

    5)Test service with localhost url (Policy Manager and Application server are on same machine(Windows 2012), Gateway server is on CentOS, Telnet to 8080 from app server to gateway server works fine)

    6)While testing service via SoapUI, I get the expected results

    7)Once I switch the URL with Gateway server instead of localhost, I start getting error

    http://localhost:8080/UserManagement/rest/UserService/users

    http://VAGATEWAY1.----.---:8080/UserManagement/rest/UserService/users

    <faultcode>soapenv:Server</faultcode>
    <faultstring>Policy Falsified</faultstring>
    <faultactor>http://VAGATEWAY1.---.---:8080/UserManagement/rest/UserService/users</faultactor>
    <detail>
    <l7:policyResult status="Assertion Falsified" xmlns:l7="http://www.layer7tech.com/ws/policy/fault"/>
    </detail>

     

    8) Below are the logs from view log:

               -com.l7tech.server.message: Processing request for service: http://localhost:8080/UserManagement/rest/ [/UserManagement/rest/*]

              -com.l7tech.server.policy.assertion.ServerRegex: 6306: Failing because expression was not matched \Q/UserManagement%2Frest%2F\E(.*)

             -http://localhost:8080/UserManagement/rest/ [9920b4df0dfe4f89a320c50fe6cef434] resulted in status 600 (Assertion Falsified)

     

    9)I am unable to understand regex part(\Q/UserManagement%2Frest%2F\E(.*)) because it was something tool picked it by itself

     

    Kindly let me know if I have skipped something.

     

    Thanks,

    Amit



  • 2.  Re: POLICY MANAGER ERROR:Failing because expression was not matched
    Best Answer

    Posted 05-27-2018 08:23 AM

    Hi All,

     

    I changed the default regular expression and default Route via HTTP.

     

    It is working fine now, I can see same results going directly via appserver or via Gateway

     

    But still do not understand why default values were not working

     

    Thanks,

    Amit



  • 3.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Broadcom Employee
    Posted 07-14-2018 05:06 PM

    Hi Amit, i face exactly the same behaviour for a similar use case but i cannot seem to resolve it. 

    can you please share with me your changes for the reg ex  and the route via http ? 

    to which values did you change them ? i also don't know how to generate a regex from my requested URI.

     

     

    Thanks, 



  • 4.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Posted 07-26-2018 04:04 AM

    Hi,,

     

    This was the default regex \Q/UserManagement%2Frest%2F\E(.*) which I modified to UserManagement

     

    modified Routevia http URLto http://PROVISIONING.amit.com:8080/${request.http.uri} 

     

    I first print {request.http.uri} value to audit logs, And few other variables , Then modifie  Routevia http url in a way it matches the web service URL.

     

    I also have recently started working on API gateway, I don't know if it is the best way to do it. But it works for me.

     

    Thanks,

    Amit

     



  • 5.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Broadcom Employee
    Posted 07-26-2018 08:22 PM

    The regex is just to validate the uri, you can even disable it if you don't need to.



  • 6.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Posted 07-27-2018 11:39 AM

    Yeah correct, I want to validate if URI has UserManagement.

    But what I observers is the default Regex was not working \Q/UserManagement%2Frest%2F\E(.*)

    SO modifies it with UserManagement



  • 7.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Broadcom Employee
    Posted 07-30-2018 07:14 PM

    I believe the problem is %2F, it should be slash '/',ie, \Q/UserManagement/rest/\E(.*) should work.

    some kind of url encoding problem.



  • 8.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Broadcom Employee
    Posted 12-13-2018 03:16 PM

    Good afternoon,

     

    Were you able to resolve the issue? What was the final result?

     

    Sincerely,


    Stephen Hughes
    Broadcom Support



  • 9.  Re: POLICY MANAGER ERROR:Failing because expression was not matched

    Posted 01-07-2019 04:29 AM

    HI Stephen,

     

    Yes it did worked for me, I changed the default REGEX.

     

    Thanks,

    Amit