Skip to content
This repository was archived by the owner on Mar 25, 2023. It is now read-only.
This repository was archived by the owner on Mar 25, 2023. It is now read-only.

Create a service binding for the sample app with microgateway-coresident plan failed #15

Description

@phong2tran

We're in the process of evaluating and adopting Apigee Edge for application API management and I'm tasked with getting Apigee Edge to work apps deployed in Cloud Foundry (CFAR). Currently I'm exploring the Apigee service broker using microgateway-coresident plan.

I got the Apigee service broker (https://github.com/apigee/cloud-foundry-apigee/blob/master/docs/setup-microgateway-coresident.md#step-1-install-the-apigee-service-broker-from-source) and the microgateway buildpack decorator (https://github.com/apigee/cloud-foundry-apigee/blob/master/docs/setup-microgateway-coresident.md#step-2-install-the-decorator) deployed, and now I'm following this guide to deploy the coresident sample app (https://github.com/apigee/cloud-foundry-apigee/tree/master/samples/coresident-sample). However, I ran into this error when binding the service instance to the sample app:

$ cf bind-service apigee-coresident-sample coresident-service -c '{"org":"amer-poc2","env":"test","bearer":"'$(cat ~/.sso-cli/valid_token.dat)'","action":"proxy bind","protocol":"http","target_app_route":"apigee-coresident-sample.bp-paas.otxlab.net","edgemicro_key":"e94ff8e1215dccba78192ad77c719b694e2494afa9105c977f510d19********","edgemicro_secret":"e08c7a4555a8a1a23d6ff31cf107e9c40cf5b97693f27065651fcbd1********","target_app_port":"8081"}'
Binding service coresident-service to app apigee-coresident-sample in org dev / space phongspace as admin...
Service broker error: [E0032] - Error uploading proxy to Apigee
FAILED

When checking the Apigee service broker log, I found this error:

2020-02-07T17:29:40.61-0800 [APP/PROC/WEB/0] OUT {"name":"apigee","hostname":"324e93ac-4b24-45a1-6c89-9502","pid":13,"level":50,"errAt":"at /home/vcap/app/helpers/open_api.js:47:36","errDetails":{"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8081,"name":"Error","message":"Error downloading file "http://localhost:8081/openApi.json\" \nconnect ECONNREFUSED 127.0.0.1:8081","stack":"Error: Error downloading file "http://localhost:8081/openApi.json\" \nconnect ECONNREFUSED 127.0.0.1:8081\n at ono (/home/vcap/app/node_modules/swagger-parser/node_modules/ono/lib/index.js:67:20)\n at ClientRequest. (/home/vcap/app/node_modules/swagger-parser/node_modules/json-schema-ref-parser/lib/read.js:195:16)\n at ClientRequest.emit (events.js:182:13)\n at Socket.socketErrorListener (_http_client.js:391:9)\n at Socket.emit (events.js:182:13)\n at emitErrorNT (internal/streams/destroy.js:82:8)\n at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)\n at process._tickCallback (internal/process/next_tick.js:63:19) \n\nError: connect ECONNREFUSED 127.0.0.1:8081\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)"},"msg":"[E0060] - Error getting OpenAPI interface file","time":"2020-02-08T01:29:40.611Z","v":0}

The Apigee service broker is trying to connect to this URL (http://localhost:8081/openApi.json) to download the Open API document and it failed to make the connection. It looked to me that the service broker is trying to connect to the target application (the sample app) to fetch the Open API document using the localhost.

I have a few questions:

  1. Why the localhost is being for the target application in this case?
  2. How can the Open API document be downloaded from the sample app at the time of service binding if the app is not yet started (cf push --no-start)? The target app will only be started up at the next step (cf v3-push) after the service binding step.

I try with 3.1.0 release (https://github.com/apigee/cloud-foundry-apigee/releases/tag/v3.1.0) and latest from github, but have the same error.

Service Broker Env:

$ cf env apigee-cf-service-broker
Getting env variables for app apigee-cf-service-broker in org dev / space phongspace as admin...
OK

System-Provided:
...
User-Provided:
APIGEE_CONFIGURATIONS: [
{
"org": "amer-poc2",
"env": "test",
"apigee_dashboard_url": "https://enterprise.apigee.com/platform/#/",
"apigee_mgmt_api_url": "https://api.enterprise.apigee.com/v1",
"apigee_proxy_domain": "apigee.net"
}
]
HTTPS_PROXY: http://bp2-prox01-l001.otxlab.net:3128
HTTP_PROXY: http://bp2-prox01-l001.otxlab.net:3128
SECURITY_USER_NAME: apigee
SECURITY_USER_PASSWORD: *****

Coresident Service Instance:

$ cf service coresident-service
Showing info of service coresident-service in org dev / space phongspace as admin...

name: coresident-service
service: apigee-edge
tags:
plan: microgateway-coresident
description: Apigee Edge API Platform
documentation: http://apigee.com/docs/
dashboard: https://enterprise.apigee.com/platform/#/

Showing status of last operation from service coresident-service...

status: update succeeded
message:
started: 2020-02-08T01:16:46Z
updated: 2020-02-08T01:16:46Z

There are no bound apps for this service.

Could you please help to take a look what to see what is the cause of this problem?

Thanks,
Phong

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions