Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error invoking wsk actions. "The supplied authentication is not authorized to access this resource" #33

Closed
mdcarlson opened this issue Feb 29, 2016 · 7 comments

Comments

@mdcarlson
Copy link

I can successfully run wsk list but am getting an "authentication not authorized" error when invoking the sample action.

 wsk list
 entities in namespace: default
 packages
 actions
 triggers
 rules

Results of wsk action:

 wsk -v action invoke /whisk.system/samples/echo -p message hello --blocking --result
 {'apihost': '192.168.33.13:443', 'namespace': '_', 'clibuild': '2016-02-28T20:51:47-05:00', 'apiversion': 'v1'}
 ========
 REQUEST:
 POST https://192.168.33.13:443/api/v1/namespaces/whisk.system/actions/samples/echo?blocking=true
 Headers sent:
 {
 "Authorization": "Basic Nzg5YzQ2YjEtNzFmNi00ZWQ1LThjNTQtODE2YWE0ZjhjNTAyOmFiY3pPM3haQ0xyTU42djJCS0sxZFhZRnBYbFBrY2NPRnFtMTJDZEFzTWdSVTRWck5aOWx5R1ZDR3VNREdJd1A=",
 "Content-Type": "application/json"
 }
 Body sent:
 {"message": "hello"}
 --------
 RESPONSE:
 Got response with code 403
 Body received:
 {
 "error": "The supplied authentication is not authorized to access this resource",
 "code": 40
 }
 ========
 error: The supplied authentication is not authorized to access this resource (code 40)

I used wsk property set --auth $(cat config/keys/<<keyname>> to test the auth.guest and auth.whisk.system creds. Also tested a subject that I created with wskadmin.

@rabbah
Copy link
Member

rabbah commented Feb 29, 2016

This can happen if the package was not actually installed. Are you running off the deployment with the failed controller from issue #31? If so, that deployment did not run to completion and hence the standard assets are not installed.

@mdcarlson
Copy link
Author

Yes. That's likely the case. I'll retest after creating the build as suggested in #31.

@rabbah
Copy link
Member

rabbah commented Feb 29, 2016

A successful deployment will finish with this:


installCatalog:
     [exec] AUTH is <auth.whisk.system>
     [exec] Installing open catalog
     [exec] Installing package installSystem.sh with pid 4230
     [exec] Installing package installGit.sh with pid 4231
     [exec] Installing package installSlack.sh with pid 4232
     [exec] Installing package installWatson.sh with pid 4233
     [exec] Installing package installWeather.sh with pid 4234
     [exec] Installing whisk.system entities.
     [exec] Creating package system with pid 4276
     [exec] Creating package util with pid 4278
     [exec] Creating package samples with pid 4279
     [exec] Installing Slack package.
     [exec] Installing Weather package.
     [exec] Installing Watson package.
     [exec] Creating package slack with pid 4281
     [exec] Creating package weather with pid 4282
     [exec] Creating package watson with pid 4283
     [exec] Installing Git package.
     [exec] Creating package github with pid 4286
     [exec] ok: updated package github
     [exec] 4286 finished with status 0
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing github/webhook with pid 4327
     [exec] ok: updated package util
     [exec] ok: updated package samples
     [exec] ok: updated package weather
     [exec] 4282 finished with status 0
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing weather/forecast with pid 4328
     [exec] ok: updated package slack
     [exec] 4281 finished with status 0
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing slack/post with pid 4329
     [exec] ok: updated package watson
     [exec] 4283 finished with status 0
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing watson/translate with pid 4330
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing watson/languageId with pid 4331
     [exec] ok: updated package system
     [exec] 4276 finished with status 0
     [exec] 4278 finished with status 0
     [exec] 4279 finished with status 0
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing system/pipe with pid 4332
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing util/cat with pid 4333
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing util/sort with pid 4334
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing util/head with pid 4335
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing util/date with pid 4336
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing samples/helloWorld with pid 4337
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing samples/greeting with pid 4338
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing samples/wordCount with pid 4339
     [exec] AUTH_KEY is <auth.whisk.system>
     [exec] Installing samples/echo with pid 4340
     [exec] ok: updated action webhook
     [exec] 4327 finished with status 0
     [exec] Git package ERRORS = 0
     [exec] ok: updated action forecast
     [exec] 4328 finished with status 0
     [exec] Weather package ERRORS = 0
     [exec] ok: updated action translate
     [exec] 4330 finished with status 0
     [exec] ok: updated action post
     [exec] 4329 finished with status 0
     [exec] Slack package ERRORS = 0
     [exec] ok: updated action languageId
     [exec] 4331 finished with status 0
     [exec] Watson package ERRORS = 0
     [exec] ok: updated action cat
     [exec] ok: updated action pipe
     [exec] 4332 finished with status 0
     [exec] 4333 finished with status 0
     [exec] ok: updated action wordCount
     [exec] ok: updated action echo
     [exec] ok: updated action head
     [exec] ok: updated action date
     [exec] ok: updated action greeting
     [exec] ok: updated action sort
     [exec] ok: updated action helloWorld
     [exec] 4334 finished with status 0
     [exec] 4335 finished with status 0
     [exec] 4336 finished with status 0
     [exec] 4337 finished with status 0
     [exec] 4338 finished with status 0
     [exec] 4339 finished with status 0
     [exec] 4340 finished with status 0
     [exec] whisk.system entities ERRORS = 0
     [exec] 4230 finished with status 0
     [exec] 4231 finished with status 0
     [exec] 4232 finished with status 0
     [exec] 4233 finished with status 0
     [exec] 4234 finished with status 0
     [exec] open catalog ERRORS = 0

BUILD SUCCESSFUL
Total time: 47 seconds

@rabbah rabbah self-assigned this Feb 29, 2016
@mdcarlson
Copy link
Author

Re-running the entire ant clean build deploy with the single thread option specified lead to a successful build and deploy. The sample actions were deployed correctly and the sample action returns expected results both when run from within the VM and from outside the VM.

Thanks!

@rabbah
Copy link
Member

rabbah commented Mar 1, 2016

Great - glad to hear it. I'll add a tip to the docs and tweak base on your experience. Thanks.

@ghost
Copy link

ghost commented Jul 31, 2018

Hi, im still getting this issue where when I run a wsk command in my local terminal I recieve an error like this: The supplied authentication is not authorized to access 'wsk-chatbot-framework_prod/v1' Any suggestions on how this could be fixed? Thanks

@rabbah
Copy link
Member

rabbah commented Aug 6, 2018

can you share more details to help you diagnose this problem?
in particular if you're getting that error (assuming your deploying is configured correctly), it means you're using a key not authorized for the namespace.

steffenrost added a commit to steffenrost/incubator-openwhisk that referenced this issue Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants