Consider the following scenario.
User pushes “app-a” to Pivotal Web Services.
User deletes “app-a”.
User pushes “app-a” from a different org/space and receives the error message: The route app-a.cfapps.io is already in use.
PWS Cloud Foundry
This is intended functionality and not a bug. The route does not get deleted with application so it’s possible to re-use the route after application deletion within the same org/space. However if an application is in different org/space, a route cannot be transferred and needs to be deleted first and re-created by pushing an app from a different org/space.
The following scenarios will resolve the issue
If a route needs to be reused from the same org/space after the original application is deleted, no further action is required as the app will automatically re-use the route.
If the route needs to be re-used by an application in different org/space, route needs to be deleted first in order to use with an application. Use ‘cf delete-route cfapps.io -n HOSTNAME` from the same org/space where it was originally created.
If the route does not need to be re-used and to free it up, delete the existing route by using `cf delete-route cfapps.io -n HOSTNAME`
Once the route is deleted, there is a possibility that it will be taken by a different user.