There is a limit on the size of a routing information that belongs to the app. As described in the following resource:
https://github.com/cloudfoundry/bbs/blob/main/docs/031-defining-lrps.md#routes-optional
On some occasions, when trying to map multiple routes to one app, the size limit is reached and it can cause an error such as the following:
{
"description": "Runner invalid request: Invalid field: routes",
"error_code": "CF-RunnerInvalidRequest",
"code": 170014
}
FAILED
Server error, status code: 500, error code: 170014, message: Runner invalid request: Invalid field: routes
cf map-route, cf unmap-route and cf delete-route will error with the message above.
Product Version: 2.8
There is no fix on how to remove the route information at the moment. However it is possible to delete the route mappings for the app completely from the CCDB. The steps to do so are listed below:
1. Get the app guid:
cf app APP_NAME --guid
2. Go to Ops Manager and issue the following commands:
bosh -d <cf-deployment> ssh mysql/0 sudo -I cd /var/vcap/jobs/pxc-mysql/config cat mylogin.cnf --> this contains the login credentials /var/vcap/packages/pxc/bin# ./mysql -h127.0.0.1 -uroot -p20woJe4WDQv2ail4Acph3OsDwOiekt
3. Once you are in the database:
show databases; use ccdb; show tables; select * from route_mappings; select * from route_mappings where app_guid='YOUR_APP_GUID'; delete from route_mappings where app_guid='YOUR_APP_GUID'; select * from route_mappings where app_guid='YOUR_APP_GUID';
4. Now back in cf CLI, run the following command:
cf restart <APP_NAME> cf app APP_NAME --> confirm the routing information is deleted.
Warning: This command will delete all of the routes that are mapped to the application.