serverless / serverless-openwhisk

Adds Apache OpenWhisk support to the Serverless Framework!
http://openwhisk.org/
MIT License
143 stars 47 forks source link

Failed to deploy API Gateway route. The requested resource does not exist. #108

Closed darko-stoilevski closed 5 years ago

darko-stoilevski commented 6 years ago

Hi, First of all thank you for the integration plugin, I really appreciate it.

I was testing it out with a local installation of OpenWhisk on an OpenShift cluster (and on a Minishift locally as well) and I get the same error when trying to create an action with an http route.

Serverless Error ---------------------------------------

Failed to deploy API Gateway route (helloworld) due to error: POST https://openwhisk-faas.127.0.0.1.nip.io/api/v1/web/whisk.system/apimgmt/createApi.http?responsetype=json Returned HTTP 404 (Not Found) --> "The requested resource does not exist."

I'm using the latest versions of all tools:

whisk CLI version 2018-03-28T20:40:42.225+0000 serverless@1.26.1 serverless-openwhisk@0.12.0

I confirm that when using the wsk cli I can specify --web=true and get a url for invocation.

Am I missing something in the configuration on serverless plugin side?

jthomas commented 6 years ago

Hello @darko-stoilevski, sorry to hear you've encountered a bug!

Can you post your serverless.yml in here?

Can you also test that you can use the wsk api create ... command from the command-line? Web actions are distinct from the API Gateway service and I wonder if the API Gateway service is configured differently on openshift.

It would also help me if you could run the deploy command again with the following env parameter and paste the ouput here.

$ DEBUG=needle serverless deploy

If this next advice makes sense to you, please follow otherwise ignore! I also could use the logs from the API Gateway container. If you minikube ssh and look for the container using the openwhisk/apigateway image. Use docker logs to retrieve these logs. It should be like this example.

==> /var/log/api-gateway/access.log <==
LOGS
==> /var/log/api-gateway/management.log <==
LOGS
==> /var/log/api-gateway/access.log <==
LOGS

Finally, do you have simple instructions you followed to set up minishift that I can replicate your setup for testing?

dario-rodriguez commented 6 years ago

It seems that you dont have installed the openwhisk packages. Check the packages with: wsk package -i list /whisk.system

The output should be something like:

packages
/whisk.system/watson-translator                                        shared
/whisk.system/samples                                                  shared
/whisk.system/github                                                   shared
/whisk.system/watson-speechToText                                      shared
/whisk.system/utils                                                    shared
/whisk.system/slack                                                    shared
/whisk.system/watson-textToSpeech                                      shared
/whisk.system/websocket                                                shared
/whisk.system/weather                                                  shared
/whisk.system/combinators                                              shared
jthomas commented 6 years ago

As this issue hasn't been updated in a while, I'm going to close it unless you have more details?

jaqmol commented 5 years ago

If it's OK I'd like to follow up on this as the issue is perfectly reproducible. wsk package -i list /whisk.system yields this with our installation of OpenWhisk on OpenShift:

packages
/whisk.system/alarms                                                   shared
/whisk.system/websocket                                                shared
/whisk.system/watson-speechToText                                      shared
/whisk.system/weather                                                  shared
/whisk.system/github                                                   shared
/whisk.system/combinators                                              shared
/whisk.system/samples                                                  shared
/whisk.system/utils                                                    shared
/whisk.system/slack                                                    shared
/whisk.system/watson-translator                                        shared
/whisk.system/watson-textToSpeech                                      shared

We're trying to run a plain hello.js behind an OpenWhisk API gateway. That's the serverless.yml:

service: openwhisk-serverless-test # NOTE: update this with your service name

provider:
  name: openwhisk
  ignore_certs: true

functions:
  hello:
    handler: handler.hello
    events:
      - http: GET /hello

plugins:
  - serverless-openwhisk

Running serverless deploy produces the following error:

Serverless: Deploying API Gateway definitions...

  Serverless Error ---------------------------------------

  Failed to deploy API Gateway route (/hello) due to error: POST https://openwhisk-serverless-openwhisk.app-t01.cmpf.schwarz/api/v1/web/whisk.system/apimgmt/createApi.http Returned HTTP 404 (Not Found) --> "The requested resource does not exist."

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.12.0
     Serverless Version:     1.32.0

Any pointers highly appreciated.

jthomas commented 5 years ago

@jaqmol Thanks for the detailed info. Can you confirm that interacting with the API GW using the wsk CLI works as expected?

Can you run wsk api list and wsk api create successfully?

jthomas commented 5 years ago

I'm closing this as an older issue with no action required at this point.