Failed with "414 Request-URI Too Large" error when executing the "cf network-policies" command
search cancel

Failed with "414 Request-URI Too Large" error when executing the "cf network-policies" command

book

Article ID: 298089

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

If you create many network policies by enabling Container-to-Container Networking (such as more than 1,000 network policies in one Space) and you try to list all the network policies in your specific space by executing the "cf network-policies" command, then it may fail with the following error:
414 Request-URI Too Large


Environment

Product Version: 2.9

Resolution

This issue happens because all the network policy names are added with the Request URI for REST API call from the "cf network-policies" command in the current CF CLI implementation as of today (November, 2020). As a result, the length of Request-URI may exceed the default maximum value of NGINX web server and you will see the 414 error.

The current workaround is to list the network policies of only the specific sources as shown below in order to reduce the length of Request URI:
$ cf network-policies --source example-app