IBM / ibm-cloud-functions-serverless-blockchain

Cloud functions that allow you to send transactions to your blockchain
Apache License 2.0
1 stars 5 forks source link

The supplied authentication is not authorized to access '_/send-to-blockchain'. (code c19fb86d1bff5bd2ce296e322c6bb89e) #14

Open kareem-adel-1990 opened 4 years ago

kareem-adel-1990 commented 4 years ago

PS E:\04 Development Stage\ibm-cloud-functions-serverless-blockchain-master\cloud-functions\send-to-blockchain> ibmcloud fn action create send-to-blockchain --kind nodejs:10 action.zip

error: Unable to create action 'send-to-blockchain': The supplied authentication is not authorized to access '_/send-to-blockchain'. (code c19fb86d1bff5bd2ce296e322c6bb89e)
Run 'wsk --help' for usage.

ccorley commented 4 years ago

Hi @kareem-adel-1990. Please make sure you are logged into IBM Cloud (Step 2: Install the IBM Cloud CLI). As a part of that step please make sure the command listed (ibmcloud fn action invoke /whisk.system/utils/echo -p message hello --result) runs successfully.

One problem might also be that it appears that node js 8 runtime has been deprecated, which means that the instructions likely need to be updated for node js 10. I could see this by logging into my IBM Cloud account, clicking on the functions symbol on the left nav, then clicking on 'actions', where I saw a notification for some existing node js 8 actions.

When I can, I'll walk through the steps using node js 10 and update them. If you try this out before I can, you can also open a PR to update the readme for the later runtime version.

ccorley commented 4 years ago

My guess is that, in Step 3, 'action-nodejs-v8' needs to be updated to 'action-nodejs-v10' and 'nodejs:8' needs to be updated to 'nodejs:10'.

kareem-adel-1990 commented 4 years ago

hi Corley, I solved all issues expect this one: PS E:\04 Development Stage\ibm-cloud-functions-serverless-blockchain-master\cloud-functions\send-to-blockchain> ibmcloud fn action create send-to-blockchain --kind nodejs:10 action.zip error: Unable to create action 'send-to-blockchain': Resource by this name exists but is not in this collection. (code 4f942769b22361a5ae898daf92a05d55) Run 'wsk --help' for usage.

ccorley commented 4 years ago

Hi @kareem-adel-1990. This post seems to explain the error you are seeing:
https://stackoverflow.com/questions/47021298/unable-to-create-action-due-to-name-clash-but-no-existing-action-has-this-name My guess is that one of the previous attempts still resulted in creation of the action, so now there is a clash. If you find and remove the item with the same name, the command in your above post should work. You can also log into IBM Cloud, click on the functions symbol on the left nav, then click on 'actions', and see if there is indeed an action already there with the same name. If you do that, be sure to select the same space that you've been working in once you get to the cloud functions dashboard, as you may have multiple choices (e.g., mine are in the Dallas datacenter).

kareem-adel-1990 commented 4 years ago

i solved the problem and reached to the POSTMAN step and did every instruction but the transaction didn't record "The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place."

kareem-adel-1990 commented 4 years ago

can you help me to deploy an external app on the ibm cloud to invoke blockchain transaction ?? I already built the app but can not deploy it on the cloud as a cloud function it works well via Visual studio interface

ccorley commented 4 years ago

That's good news that you got to the point where you are sending a transaction and it seems the transaction is at least getting to the blockchain. Please be sure that you've double-checked the blockchain credentials that you stored for this transaction and that they are correct.

I've deployed apps via the Cloud Foundry cli before & it's fairly straightforward: https://cloud.ibm.com/docs/cloud-foundry?topic=cloud-foundry-deploy_apps