apache / openwhisk-wskdeploy

Apache OpenWhisk utility for deploying and managing OpenWhisk projects and packages
https://openwhisk.apache.org/
Apache License 2.0
77 stars 74 forks source link

Wskdeploy sometimes tries to create sequence before action #391

Closed zachschultz closed 7 years ago

zachschultz commented 7 years ago

During testing and trying to deploy this blueprint with this manifest file I noticed that I was getting the error: Got error creating action with error message: Sequence component does not exist. (code 970378) and error code: 144. On the next try, it succeeded.

In the manifest file, you can see that I tell wskdeploy to create an action called process-change, then below that I create a sequence that makes use of the action.

This leads me to believe that there may be an issue with wskdeploy trying to create items out of order, unless there is a flag or keyword I am missing that would tell wskdeploy to wait for the actions to be created before sequences were created.

Here is the result from the first (failed) run: image

Here is the result from the next (successful) run: image

zachschultz commented 7 years ago

@beemarie

daisy-ycguo commented 7 years ago

I think it should be a bug, although I didn't find the root cause yet. Look at printed help message when deploying this package,process-change-cloudant-sequence is displayed as an action, not sequence. It's a very rare error. Thank you for reporting, @zachschultz .

Packages:
Name: cloudant-trigger
    bindings: 
  * dependency: openwhisk-cloudant
    location: /whisk.system/cloudant

  * action: process-change
    bindings: 
    annotations: 
  * action: process-change-cloudant-sequence
    bindings: 
    annotations: 

Triggers:
* trigger: data-inserted-trigger
    bindings: 
        - dbname : ""
    annotations: 
        - name: feed value: openwhisk-cloudant/changes

 Rules
* rule: log-change-rule
    - trigger: data-inserted-trigger
    - action: cloudant-trigger/process-change-cloudant-sequence

Do you really want to deploy this? (y/N): 
pritidesai commented 7 years ago

@daisy-ycguo the error that @zachschultz reported was caused by the missing env. variables, when you run wskdeploy with a manifest file which is using env. variables which are not set yet, wskdeploy throws this kind of cryptic error, refer to #399

zachschultz commented 7 years ago

@pritidesai that error only occurred in the second (successful) run, however, so while that still looks like a bug, I don't think it's directly related to the first and main issue, correct? It seems like wskdeploy was trying to create the action-sequence before the action

pritidesai commented 7 years ago

Its still failing for me with (with wskdeploy from @daisy-ycguo PR #396):

./wskdeploy -m ~/IBM/OpenWhisk/source/zachschultz/owbp-cloudant-trigger/runtimes/node/manifest.yaml 
2017/08/28 12:53:05 Deploying package cloudant-trigger ... 
2017/08/28 12:53:05 Done!
Deploying dependency openwhisk-cloudant ... 
2017/08/28 12:53:05 Deploying package bindingopenwhisk-cloudant ... 
2017/08/28 12:53:05 Done!
2017/08/28 12:53:05 Deploying action cloudant-trigger/process-change ... 
2017/08/28 12:53:05 Done!
2017/08/28 12:53:05 Deploying action cloudant-trigger/process-change-cloudant-sequence ... 
2017/08/28 12:53:06 Done!
2017/08/28 12:53:06 Deploying trigger feed data-inserted-trigger ... 
2017/08/28 12:53:06 Got error creating trigger with error message: A trigger feed is only permitted when the trigger is created (code 32451701) and error code: 144.
Done!
Deploying rule log-change-rule ... Done!
2017/08/28 12:53:06 
Deployment completed successfully.
mrutkows commented 7 years ago

Are we considering Zach's comment " that would tell wskdeploy to wait for the actions to be created before sequences were created."? It seems if this is infrequently found as an error we may need to verify/wait for Actions in a sequence to be created BEFORE we create the actual sequence?

daisy-ycguo commented 7 years ago

@pritidesai Thank you, Priti. I will take a look at it. @mrutkows No, it's not true. According to our source code, ServiceDeployer.deployAssets will deploy sequences after actions. All the wsk client code invocations are synchronized invocation. So the error will not be fixed by waiting for actions in sequence to be created BEFORE we create the actual sequence.

daisy-ycguo commented 7 years ago

@pritidesai Please make sure below environment is set to correct values. Or else, feed cannot be created successfully. It will cause your error. After you set these environment variables, if you still get errors, please let me know.

export CLOUDANT_HOSTNAME=f24a57b7-bluemix.cloudant.com
export CLOUDANT_USERNAME=f24a57b7-bluemix
export CLOUDANT_PASSWORD=24b84123bd42b1d3e4858af72576984
export CLOUDANT_DATABASE=cats
daisy-ycguo commented 7 years ago

Fixed with PR #396.