serverless / serverless-openwhisk

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

Namespace deployment fails #182

Open benoj opened 5 years ago

benoj commented 5 years ago

Whenever I try to deploy my functions to a namespace i get an error saying my account is not authorized. However my account is the administrator account. Works fine when using default environment.

serverless.yml

service: asset-registry

provider:
  name: openwhisk
  namespace: 'environment_dev'

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

plugins:
  - serverless-openwhisk
Failed to deploy function (asset-registry-dev-hello) due to error: PUT https://eu-gb.functions.cloud.ibm.com/api/v1/namespaces/environment_dev/actions/asset-registry-dev-hello?ov
erwrite=true Returned HTTP 403 (Forbidden) --> "The supplied authentication is not authorized to access 'environment_dev/asset-registry-dev-hello'."
jthomas commented 5 years ago

@benoj 👋 - quick check - is the namespace you are trying to deploy to a (classic) CF-style org and space or a newer-style IAM-enabled namespace?

The IAM namespaces are new and I'm still finalising support for them. You can follow along with progress on this here: https://github.com/serverless/serverless-openwhisk/issues/169

Until then - the temporary work-around is to use an older-style CF based namespace.

benoj commented 5 years ago

Thanks for coming back.

I switched to CF based namespaces and now I'm getting another issue. It seems that when I deploy my functions with serverless I get a 502 error - if I manually create another endpoint in the console pointing to the same action it works however.

I am deploying my functions like so:

OW_AUTH=$CF_AUTH serverless deploy

Where CF_TOKEN is the Namespace Auth creds from https://cloud.ibm.com/openwhisk/namespace-settings

Any idea why this is causing a 502 from the API -> Action? (Invoking the action manually seems to work fine)

benoj commented 5 years ago

Any clues on this? No logs anywhere that I can see? Seems rather confusing...

jthomas commented 5 years ago

Can you paste the full error logs?

bn326160 commented 4 years ago

After creating an IAM API key in IBM Cloud and setting the OW_IAM_NAMESPACE_API_KEY env variable, I still get the same error above. Something else I need to perform?

aaka3207 commented 4 years ago

Bump, I've been having this issue. I've tried just about everything from granting permissions, changing env variables but nothing has worked.

bn326160 commented 4 years ago

@aaka3207 https://github.com/serverless/serverless-openwhisk/issues/169#issuecomment-647821605 may help

aaka3207 commented 4 years ago

@bn326160 I was on a tight deadline so I ended up using whisk deploy