2

Below is the error on cf push:

org.cloudfoundry.client.v2.ClientV2Exception: CF-InvalidRelation(1002): The app cannot be mapped to this route because the route is not in this space. Apps must be mapped to routes in the same space.

Below is the manifest file:

applications:
- name: xyz-api
  instances: 1
  memory: 1G
  buildpack: java_buildpack_offline
  path: target/xyz-api-0.1-SNAPSHOT.jar

cf login x.y.z.w.org.cloud ....

cf push xyz-api -p target/xyz-api-0.1-SNAPSHOT.jar

We have two API end points:

a.b.c.d.org.cloud

x.y.z.w.org.cloud

As per investigation, we realised that the route name already exist on a.b.c.d.org.cloud because our source code is hardcoding the same route name for on any API end point.

Can't same route name be used for multiple API end points? why?

overexchange
  • 15,768
  • 30
  • 152
  • 347

3 Answers3

3

By default, cf push assigns a route to every app

I have no idea what the functionality is omitting a route, maybe a default / is assigned to the application in the space which might already be taken by another application in the space.

The Cloud Foundry Gorouter routes requests to apps by associating an app with an address, known as a route. We call this association a mapping. Use the cf CLI cf map-route command to associate an app and route.

You can run the cf routes command to see what routes are in use,

https://cli.cloudfoundry.org/en-US/cf/routes.html

You can run an application without a route, a random route, or provide a route

https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#no-route

---
  ...
  no-route: true

random route,

---
  ...
  random-route: true

defined route,

---
  ...
  routes:
  - route: example.com
  - route: www.example.com/foo
  - route: tcp-example.com:1234

https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#routes

You may want to check the routes documentation for a more detailed explanation of what a route is.

https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html

Darren Forsythe
  • 10,712
  • 4
  • 43
  • 54
  • @overexchange https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html > Routes are globally unique. Developers in one space cannot create a route with the same URL as developers in another space, regardless of which orgs control these spaces. – Darren Forsythe Feb 12 '19 at 10:19
0

For cf8 there is a way to enable route sharing between spaces

https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html#share-route

For me it's not working because I don't have permissions but I've opened a question here

hope it helps.

0

If you want the latest artifact version there is a new functionality to do that. See the last paragraph in https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api However, they forgot to add "&maven.classifier" empty to the path. If you don't it will get the latest version of your artifact--javadoc.jar from Nexus and that is not what you want. At least it did with me.