cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11277
Views
0
Helpful
5
Replies
VIP Rising star

FMC 6.3 "unprocessable entity" error when trying to amend access rule

Good afternoon everyone,

 

I'm trying to amend an existing access rule to enable logging on it. I read the policy and the rule fine. I get the rule output in a variable called data. Then I amend 'logFiles' field from 'False' to 'True' and try to execute a put request with it as the data. Then I get unprocessable entity error. Can anyone explain why it is?

 

The FMC version is 6.3, I am using Python 3.

 

Thanks,

Sergey.

Everyone's tags (4)
5 REPLIES 5
Highlighted
Cisco Employee

Re: FMC 6.3 "unprocessable entity" error when trying to amend access rule

I believe "unprocessable entity" errors usually happen when an element in your JSON does contain a valid value, has an non-existent property, or is just improperly formatted. If you have a way to output the JSON you're sending, check for any empty or null values. I have also seen the API be case-sensitive, so play around with True/true/TRUE.
Highlighted
Beginner

Re: FMC 6.3 "unprocessable entity" error when trying to amend access rule

https://www.keycdn.com/support/422-unprocessable-entity

The FMC understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions.  It is not a 400 (Bad Request) which usually happens when a parameter is wrong on you try to post an entry that already exists.  You are doing a put, which is correct.  Conclusion:  This is not an easy syntax fix.  Try to manual make the change on the FMC, and see it you get an error.

Highlighted
Beginner

Re: FMC 6.3 "unprocessable entity" error when trying to amend access rule

This is cool, although it counters the info I gave above which is RFC standard, https://tools.ietf.org/html/rfc4918#section-11.2.  In my experience syntax errors return an HTTP 400.

 

https://www.cisco.com/c/en/us/td/docs/security/firepower/623/api/REST/Firepower_Management_Center_REST_API_Quick_Start_Guide_623/Objects_in_the_REST_API.html

 

 

  • 422 Unprocessable Entity
    – The payload is too large. This will occur when you send a payload greater than 2048000 bytes.

    – The payload contains an unprocessable or unreadable entity such as a invalid attribut name or incorrect JSON syntax.

 

Highlighted
Beginner

Re: FMC 6.3 "unprocessable entity" error when trying to amend access rule

Can you post the JSON that you're sending in the PUT request?  I've done this same process and from experience I can tell you that you can't just send back all the data that you got in the GET request.  Specifically you have to remove the metadata and links attributes from the get result otherwise you will get this message.  

Highlighted
Beginner

Re: FMC 6.3 "unprocessable entity" error when trying to amend access rule

For me, it was an ACP rule action set to BLOCK_WITH_RESET.  I believe I copied that exactly form the API Explorer.  I simply changed that to BLOCK and the error went away.  I haven't re-tested it in a while.

CreatePlease to create content
This widget could not be displayed.