dgrove-oss commented on issue #436: Api Gateway not working on Docker Desktop 
Windows/Mac
URL: 
https://github.com/apache/incubator-openwhisk-deploy-kube/issues/436#issuecomment-482657882
 
 
   createApi is using the external apihost (localhost) instead of the internal 
apihost when it registers the API.  
   
   ```
   daves-mbp:incubator-openwhisk-deploy-kube dgrove$ wski --auth 
789c46b1-71f6-4ed5-8c54-816aa4f8c502:abczO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
 activation get 99ba5fc4ed6f42a4ba5fc4ed6f02a4e6
   ok: got activation 99ba5fc4ed6f42a4ba5fc4ed6f02a4e6
   {
       "namespace": "whisk.system",
       "name": "createApi",
       "version": "0.0.1",
       "subject": "whisk.system",
       "activationId": "99ba5fc4ed6f42a4ba5fc4ed6f02a4e6",
       "start": 1555087541209,
       "end": 1555087542225,
       "duration": 1016,
       "statusCode": 0,
       "response": {
           "status": "success",
           "statusCode": 0,
           "success": true,
           "result": {
               "body": {
                   "apidoc": {
                       "basePath": "/",
                       "info": {
                           "title": "/",
                           "version": "1.0.0"
                       },
                       "paths": {
                           "/hello": {
                               "get": {
                                   "operationId": "getHello",
                                   "responses": {
                                       "default": {
                                           "description": "Default response"
                                       }
                                   },
                                   "x-openwhisk": {
                                       "action": "hello",
                                       "namespace": "guest",
                                       "package": "",
                                       "url": 
"https://localhost:31001/api/v1/web/guest/default/hello.json";
                                   }
                               }
                           }
                       },
                       "swagger": "2.0",
                       "x-ibm-configuration": {
                           "assembly": {
                               "execute": [
                                   {
                                       "operation-switch": {
                                           "case": [
                                               {
                                                   "execute": [
                                                       {
                                                           "invoke": {
                                                               "target-url": 
"https://localhost:31001/api/v1/web/guest/default/hello.json";,
                                                               "verb": "keep"
                                                           }
                                                       }
                                                   ],
                                                   "operations": [
                                                       "getHello"
                                                   ]
                                               }
                                           ]
                                       }
                                   }
                               ]
                           },
                           "cors": {
                               "enabled": true
                           }
                       }
                   },
                   "gwApiActivated": true,
                   "gwApiUrl": 
"https://192.168.65.3:31001/api/23bc46b1-71f6-4ed5-8c54-816aa4f8c502";,
                   "namespace": "Not Used",
                   "tenantId": "Not Used"
               },
               "headers": {
                   "Content-Type": "application/json"
               },
               "statusCode": 200
           }
       },
       "logs": [
           "2019-04-12T16:45:42.1390198Z   stdout: replaceNamespaceInUrl: 
namspace=guest url before - 
https://localhost:31001/api/v1/web/_/default/hello.http";,
           "2019-04-12T16:45:42.1391837Z   stdout: replaceNamespaceInUrl: 
replacing namespace '_' with 'guest'",
           "2019-04-12T16:45:42.1392197Z   stdout: replaceNamespaceInUrl: url 
after - https://localhost:31001/api/v1/web/guest/default/hello.http";,
           "2019-04-12T16:45:42.1459268Z   stdout: GW URL        : undefined",
           "2019-04-12T16:45:42.1459675Z   stdout: GW URL V2     : 
http://10.103.236.225:9000/v2";,
           "2019-04-12T16:45:42.1459861Z   stdout: GW Auth       : XXXXXXXXXX",
           "2019-04-12T16:45:42.1460052Z   stdout: __ow_user     : guest",
           "2019-04-12T16:45:42.1460648Z   stdout: namespace     : guest",
           "2019-04-12T16:45:42.1460873Z   stdout: tenantInstance: undefined / 
openwhisk",
           "2019-04-12T16:45:42.1461094Z   stdout: accesstoken   : DUMMY TOKEN",
           "2019-04-12T16:45:42.1461312Z   stdout: spaceguid     : 
23bc46b1-71f6-4ed5-8c54-816aa4f8c502",
           "2019-04-12T16:45:42.1461693Z   stdout: responsetype  : json",
           "2019-04-12T16:45:42.1461897Z   stdout: API name      : undefined",
           "2019-04-12T16:45:42.1462112Z   stdout: basepath      : /",
           "2019-04-12T16:45:42.1462326Z   stdout: relpath       : /hello",
           "2019-04-12T16:45:42.1462551Z   stdout: GW method     : GET",
           "2019-04-12T16:45:42.1462777Z   stdout: action name: hello",
           "2019-04-12T16:45:42.1463286Z   stdout: action namespace: guest",
           "2019-04-12T16:45:42.146351Z    stdout: action backendUrl: 
https://localhost:31001/api/v1/web/guest/default/hello.http";,
           "2019-04-12T16:45:42.1463757Z   stdout: action backendMethod: GET",
           "2019-04-12T16:45:42.1463972Z   stdout: action authkey: XXXXXXXXXX",
           "2019-04-12T16:45:42.1464201Z   stdout: action secureKey: undefined",
           "2019-04-12T16:45:42.1464426Z   stdout: calledAsWebAction: true",
           "2019-04-12T16:45:42.1464647Z   stdout: apidoc        :",
           "2019-04-12T16:45:42.1464949Z   stdout: 
{\"action\":{\"authkey\":\"23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP\",\"backendMethod\":\"GET\",\"backendUrl\":\"https://localhost:31001/api/v1/web/guest/default/hello.http\",\"name\":\"hello\",\"namespace\":\"guest\"},\"gatewayBasePath\":\"/\",\"gatewayMethod\":\"GET\",\"gatewayPath\":\"/hello\",\"id\":\"API:_:/\",\"namespace\":\"guest\"}";,
           "2019-04-12T16:45:42.146519Z    stdout: getApis: querying APIs based 
on basepath",
           "2019-04-12T16:45:42.1465407Z   stdout: getApis: request: 
{\"followAllRedirects\":true,\"url\":\"http://10.103.236.225:9000/v2/23bc46b1-71f6-4ed5-8c54-816aa4f8c502/apis\",\"headers\":{\"Accept\":\"application/json\",\"User-Agent\":\"OpenWhisk-apimgmt/1.0.0
 OpenWhisk-CLI/1.0 (not set) darwin amd64\",\"Authorization\":\"Bearer DUMMY 
TOKEN\"},\"json\":true,\"qs\":{\"basePath\":\"/\"}}",
           "2019-04-12T16:45:42.197624Z    stdout: getApis: response status: 
200",
           "2019-04-12T16:45:42.1979647Z   stdout: getApis: response headers: 
{\"server\":\"openresty/1.13.6.2\",\"date\":\"Fri, 12 Apr 2019 16:45:42 
GMT\",\"content-type\":\"application/json; 
charset=utf-8\",\"transfer-encoding\":\"chunked\",\"connection\":\"close\",\"x-request-id\":\"4y1xjHbJvESlFy6VV6drZFNVA3yfbKON\"}",
           "2019-04-12T16:45:42.1982972Z   stdout: getApis: body type = object",
           "2019-04-12T16:45:42.1985859Z   stdout: getApis: response 
JSON.stringify(body): []",
           "2019-04-12T16:45:42.1990665Z   stdout: Got 0 APIs",
           "2019-04-12T16:45:42.199337Z    stdout: No API found for namespace 
guest with basePath /",
           "2019-04-12T16:45:42.1998713Z   stdout: Add the provided API 
endpoint",
           "2019-04-12T16:45:42.2007152Z   stdout: addEndpointToSwaggerApi: 
operationid = getHello",
           "2019-04-12T16:45:42.2012356Z   stdout: parseActionUrl: parsing 
action url: https://localhost:31001/api/v1/web/guest/default/hello.http";,
           "2019-04-12T16:45:42.2016947Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.2020871Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.2023823Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.2027184Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.202745Z    stdout: addEndpointToSwaggerApi: 
setting api gw extension values",
           "2019-04-12T16:45:42.2051786Z   stdout: parseActionUrl: parsing 
action url: https://localhost:31001/api/v1/web/guest/default/hello.http";,
           "2019-04-12T16:45:42.2057307Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.2061198Z   stdout: parseActionName: parsing 
action: hello",
           "2019-04-12T16:45:42.2068782Z   stdout: Validating Swagger doc 
before sending it to API GW.",
           "2019-04-12T16:45:42.2077856Z   stdout: validateFinalSwagger: 
Validating swapper before posting to API GW.",
           "2019-04-12T16:45:42.2088003Z   stdout: validateFinalSwagger: 
Validation of swagger before posting to API GW was successful.",
           "2019-04-12T16:45:42.2091508Z   stdout: Final swagger API config: 
{\"swagger\":\"2.0\",\"info\":{\"title\":\"/\",\"version\":\"1.0.0\"},\"basePath\":\"/\",\"paths\":{\"/hello\":{\"get\":{\"operationId\":\"getHello\",\"x-openwhisk\":{\"url\":\"https://localhost:31001/api/v1/web/guest/default/hello.json\",\"namespace\":\"guest\",\"package\":\"\",\"action\":\"hello\"},\"responses\":{\"default\":{\"description\":\"Default
 
response\"}}}}},\"x-ibm-configuration\":{\"assembly\":{\"execute\":[{\"operation-switch\":{\"case\":[{\"operations\":[\"getHello\"],\"execute\":[{\"invoke\":{\"target-url\":\"https://localhost:31001/api/v1/web/guest/default/hello.json\",\"verb\":\"keep\"}}]}]}}]},\"cors\":{\"enabled\":true}}}";,
           "2019-04-12T16:45:42.2094677Z   stdout: addApiToGateway:",
           "2019-04-12T16:45:42.2109673Z   stdout: addApiToGateway: request: {",
           "2019-04-12T16:45:42.2109919Z   stdout: \"followAllRedirects\": 
true,",
           "2019-04-12T16:45:42.2110111Z   stdout: \"url\": 
\"http://10.103.236.225:9000/v2/23bc46b1-71f6-4ed5-8c54-816aa4f8c502/apis\",";,
           "2019-04-12T16:45:42.2110356Z   stdout: \"json\": {",
           "2019-04-12T16:45:42.211051Z    stdout: \"swagger\": \"2.0\",",
           "2019-04-12T16:45:42.2110676Z   stdout: \"info\": {",
           "2019-04-12T16:45:42.2110865Z   stdout: \"title\": \"/\",",
           "2019-04-12T16:45:42.2111025Z   stdout: \"version\": \"1.0.0\"",
           "2019-04-12T16:45:42.2111212Z   stdout: },",
           "2019-04-12T16:45:42.211134Z    stdout: \"basePath\": \"/\",",
           "2019-04-12T16:45:42.2111533Z   stdout: \"paths\": {",
           "2019-04-12T16:45:42.2111722Z   stdout: \"/hello\": {",
           "2019-04-12T16:45:42.2111908Z   stdout: \"get\": {",
           "2019-04-12T16:45:42.2112096Z   stdout: \"operationId\": 
\"getHello\",",
           "2019-04-12T16:45:42.2112367Z   stdout: \"x-openwhisk\": {",
           "2019-04-12T16:45:42.2112557Z   stdout: \"url\": 
\"https://localhost:31001/api/v1/web/guest/default/hello.json\",";,
           "2019-04-12T16:45:42.2112746Z   stdout: \"namespace\": \"guest\",",
           "2019-04-12T16:45:42.2112933Z   stdout: \"package\": \"\",",
           "2019-04-12T16:45:42.211312Z    stdout: \"action\": \"hello\"",
           "2019-04-12T16:45:42.2113308Z   stdout: },",
           "2019-04-12T16:45:42.2113494Z   stdout: \"responses\": {",
           "2019-04-12T16:45:42.2113681Z   stdout: \"default\": {",
           "2019-04-12T16:45:42.2113867Z   stdout: \"description\": \"Default 
response\"",
           "2019-04-12T16:45:42.2114053Z   stdout: }",
           "2019-04-12T16:45:42.2114238Z   stdout: }",
           "2019-04-12T16:45:42.2114424Z   stdout: }",
           "2019-04-12T16:45:42.2114615Z   stdout: }",
           "2019-04-12T16:45:42.21148Z     stdout: },",
           "2019-04-12T16:45:42.2114986Z   stdout: \"x-ibm-configuration\": {",
           "2019-04-12T16:45:42.2115172Z   stdout: \"assembly\": {",
           "2019-04-12T16:45:42.2115359Z   stdout: \"execute\": [",
           "2019-04-12T16:45:42.2115545Z   stdout: {",
           "2019-04-12T16:45:42.211573Z    stdout: \"operation-switch\": {",
           "2019-04-12T16:45:42.2115917Z   stdout: \"case\": [",
           "2019-04-12T16:45:42.2116103Z   stdout: {",
           "2019-04-12T16:45:42.2116288Z   stdout: \"operations\": [",
           "2019-04-12T16:45:42.2116475Z   stdout: \"getHello\"",
           "2019-04-12T16:45:42.2116661Z   stdout: ],",
           "2019-04-12T16:45:42.2116847Z   stdout: \"execute\": [",
           "2019-04-12T16:45:42.2117032Z   stdout: {",
           "2019-04-12T16:45:42.2117218Z   stdout: \"invoke\": {",
           "2019-04-12T16:45:42.2117425Z   stdout: \"target-url\": 
\"https://localhost:31001/api/v1/web/guest/default/hello.json\",";,
           "2019-04-12T16:45:42.2117615Z   stdout: \"verb\": \"keep\"",
           "2019-04-12T16:45:42.2117802Z   stdout: }",
           "2019-04-12T16:45:42.2117988Z   stdout: }",
           "2019-04-12T16:45:42.2118174Z   stdout: ]",
           "2019-04-12T16:45:42.2118343Z   stdout: }",
           "2019-04-12T16:45:42.2118532Z   stdout: ]",
           "2019-04-12T16:45:42.2118718Z   stdout: }",
           "2019-04-12T16:45:42.2118905Z   stdout: }",
           "2019-04-12T16:45:42.211905Z    stdout: ]",
           "2019-04-12T16:45:42.2119241Z   stdout: },",
           "2019-04-12T16:45:42.2119377Z   stdout: \"cors\": {",
           "2019-04-12T16:45:42.2119567Z   stdout: \"enabled\": true",
           "2019-04-12T16:45:42.2119757Z   stdout: }",
           "2019-04-12T16:45:42.2120292Z   stdout: }",
           "2019-04-12T16:45:42.212048Z    stdout: },",
           "2019-04-12T16:45:42.2120666Z   stdout: \"headers\": {",
           "2019-04-12T16:45:42.2120896Z   stdout: \"User-Agent\": 
\"OpenWhisk-apimgmt/1.0.0 OpenWhisk-CLI/1.0 (not set) darwin amd64\",",
           "2019-04-12T16:45:42.2121087Z   stdout: \"Authorization\": \"Bearer 
DUMMY TOKEN\"",
           "2019-04-12T16:45:42.2121275Z   stdout: }",
           "2019-04-12T16:45:42.2121462Z   stdout: }",
           "2019-04-12T16:45:42.2243355Z   stdout: addApiToGateway: response 
status:200",
           "2019-04-12T16:45:42.2243783Z   stdout: addApiToGateway: response 
headers: {\"server\":\"openresty/1.13.6.2\",\"date\":\"Fri, 12 Apr 2019 
16:45:42 GMT\",\"content-type\":\"application/json; 
charset=utf-8\",\"transfer-encoding\":\"chunked\",\"connection\":\"close\",\"x-request-id\":\"BIVDguEPSp5TjN6QaDbH7XOKhtEW42r7\"}",
           "2019-04-12T16:45:42.2244052Z   stdout: addApiToGateway: response 
body: 
{\"managed_url\":\"https://192.168.65.3:31001/api/23bc46b1-71f6-4ed5-8c54-816aa4f8c502\",\"open_api_doc\":{\"info\":{\"version\":\"1.0.0\",\"title\":\"/\"},\"paths\":{\"/hello\":{\"get\":{\"responses\":{\"default\":{\"description\":\"Default
 
response\"}},\"operationId\":\"getHello\",\"x-openwhisk\":{\"url\":\"https://localhost:31001/api/v1/web/guest/default/hello.json\",\"namespace\":\"guest\",\"package\":\"\",\"action\":\"hello\"}}}},\"x-ibm-configuration\":{\"assembly\":{\"execute\":[{\"operation-switch\":{\"case\":[{\"execute\":[{\"invoke\":{\"verb\":\"keep\",\"target-url\":\"https://localhost:31001/api/v1/web/guest/default/hello.json\"}}],\"operations\":[\"getHello\"]}]}}]},\"cors\":{\"enabled\":true}},\"basePath\":\"/\",\"swagger\":\"2.0\"},\"artifact_id\":\"fa0233ba-70f3-4011-88b3-9f5b71266e86\"}";,
           "2019-04-12T16:45:42.2244566Z   stdout: API GW configured with API",
           "2019-04-12T16:45:42.2244742Z   stdout: generateCliApiFromGwApi: {",
           "2019-04-12T16:45:42.2244968Z   stdout: \"managed_url\": 
\"https://192.168.65.3:31001/api/23bc46b1-71f6-4ed5-8c54-816aa4f8c502\",";,
           "2019-04-12T16:45:42.2245344Z   stdout: \"open_api_doc\": {",
           "2019-04-12T16:45:42.2245722Z   stdout: \"info\": {",
           "2019-04-12T16:45:42.224602Z    stdout: \"version\": \"1.0.0\",",
           "2019-04-12T16:45:42.2246226Z   stdout: \"title\": \"/\"",
           "2019-04-12T16:45:42.2246399Z   stdout: },",
           "2019-04-12T16:45:42.2246624Z   stdout: \"paths\": {",
           "2019-04-12T16:45:42.224684Z    stdout: \"/hello\": {",
           "2019-04-12T16:45:42.2247061Z   stdout: \"get\": {",
           "2019-04-12T16:45:42.2247262Z   stdout: \"responses\": {",
           "2019-04-12T16:45:42.2247492Z   stdout: \"default\": {",
           "2019-04-12T16:45:42.2247779Z   stdout: \"description\": \"Default 
response\"",
           "2019-04-12T16:45:42.2248002Z   stdout: }",
           "2019-04-12T16:45:42.2248157Z   stdout: },",
           "2019-04-12T16:45:42.2248369Z   stdout: \"operationId\": 
\"getHello\",",
           "2019-04-12T16:45:42.2248582Z   stdout: \"x-openwhisk\": {",
           "2019-04-12T16:45:42.2248879Z   stdout: \"url\": 
\"https://localhost:31001/api/v1/web/guest/default/hello.json\",";,
           "2019-04-12T16:45:42.2249066Z   stdout: \"namespace\": \"guest\",",
           "2019-04-12T16:45:42.2249323Z   stdout: \"package\": \"\",",
           "2019-04-12T16:45:42.2249551Z   stdout: \"action\": \"hello\"",
           "2019-04-12T16:45:42.2249835Z   stdout: }",
           "2019-04-12T16:45:42.2250085Z   stdout: }",
           "2019-04-12T16:45:42.2250308Z   stdout: }",
           "2019-04-12T16:45:42.2250461Z   stdout: },",
           "2019-04-12T16:45:42.2250625Z   stdout: \"x-ibm-configuration\": {",
           "2019-04-12T16:45:42.2250819Z   stdout: \"assembly\": {",
           "2019-04-12T16:45:42.225095Z    stdout: \"execute\": [",
           "2019-04-12T16:45:42.2251106Z   stdout: {",
           "2019-04-12T16:45:42.2251316Z   stdout: \"operation-switch\": {",
           "2019-04-12T16:45:42.2251487Z   stdout: \"case\": [",
           "2019-04-12T16:45:42.2251702Z   stdout: {",
           "2019-04-12T16:45:42.2251924Z   stdout: \"execute\": [",
           "2019-04-12T16:45:42.2252162Z   stdout: {",
           "2019-04-12T16:45:42.2252416Z   stdout: \"invoke\": {",
           "2019-04-12T16:45:42.2252736Z   stdout: \"verb\": \"keep\",",
           "2019-04-12T16:45:42.2252877Z   stdout: \"target-url\": 
\"https://localhost:31001/api/v1/web/guest/default/hello.json\"";,
           "2019-04-12T16:45:42.2253107Z   stdout: }",
           "2019-04-12T16:45:42.2253241Z   stdout: }",
           "2019-04-12T16:45:42.2254163Z   stdout: ],",
           "2019-04-12T16:45:42.2254955Z   stdout: \"operations\": [",
           "2019-04-12T16:45:42.2255182Z   stdout: \"getHello\"",
           "2019-04-12T16:45:42.2255405Z   stdout: ]",
           "2019-04-12T16:45:42.2256542Z   stdout: }",
           "2019-04-12T16:45:42.2256823Z   stdout: ]",
           "2019-04-12T16:45:42.2257058Z   stdout: }",
           "2019-04-12T16:45:42.225746Z    stdout: }",
           "2019-04-12T16:45:42.2258192Z   stdout: ]",
           "2019-04-12T16:45:42.2258413Z   stdout: },",
           "2019-04-12T16:45:42.2258621Z   stdout: \"cors\": {",
           "2019-04-12T16:45:42.2258829Z   stdout: \"enabled\": true",
           "2019-04-12T16:45:42.2259069Z   stdout: }",
           "2019-04-12T16:45:42.2259234Z   stdout: },",
           "2019-04-12T16:45:42.2259538Z   stdout: \"basePath\": \"/\",",
           "2019-04-12T16:45:42.2259768Z   stdout: \"swagger\": \"2.0\"",
           "2019-04-12T16:45:42.225992Z    stdout: },",
           "2019-04-12T16:45:42.2260132Z   stdout: \"artifact_id\": 
\"fa0233ba-70f3-4011-88b3-9f5b71266e86\"",
           "2019-04-12T16:45:42.226036Z    stdout: }",
           "2019-04-12T16:45:42.2260579Z   stdout: createApi success",
           "2019-04-12T16:45:42.2260737Z   stdout: makeResponseObject: 
isWebAction: true"
       ],
       "annotations": [
           {
               "key": "path",
               "value": "whisk.system/apimgmt/createApi"
           },
           {
               "key": "waitTime",
               "value": 185
           },
           {
               "key": "kind",
               "value": "nodejs:6"
           },
           {
               "key": "timeout",
               "value": false
           },
           {
               "key": "limits",
               "value": {
                   "concurrency": 1,
                   "logs": 10,
                   "memory": 256,
                   "timeout": 60000
               }
           },
           {
               "key": "initTime",
               "value": 917
           }
       ],
       "publish": false
   }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to