KeonHee opened a new issue #1055: Fails to export the alarm feed trigger
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/1055
 
 
   ## Failure Scenario
   Exporting a project with an alarm feed trigger will fail.
   
   ### 1. yaml file: `deploy.yaml`
   ```yaml
   project:
     name: test
   packages:
     sync-alarm:
       public: false
       version: 1.0
       actions:
         check-sync-alarm-trigger:
           function: sync-alarm-trigger.js
           runtime: nodejs:10
           inputs:
             ONLY_CHECK:
               type: boolean
               default: true
             ALL_NAMESPACE:
               type: boolean
               default: true
         sync-alarm-trigger:
           function: sync-alarm-trigger.js
           runtime: nodejs:10
           inputs:
             ONLY_CHECK:
               type: boolean
               default: false
             ALL_NAMESPACE:
               type: boolean
               default: false
             NAMESPACES:
               type: string
               value:
                 - ""
       triggers:
         Every11Hours:
           feed: /whisk.system/alarms/alarm  # alarm feed trigger
           inputs:
             cron: "00 23 * * *"
       rules:
         syncAlarmOnCron:
           action: check-sync-alarm-trigger
           trigger: Every11Hours
   ```
   
   ### 2. Sync deploy
   ```bash
   $ wskdeploy sync --projectname test -m deploy.yaml
   ```
   
   ### 3. Check project value
   ```bash
   $ wsk package get sync-alarm
   ok: got package sync-alarm
   {
       "namespace": "keonhee",
       "name": "sync-alarm",
       "version": "1.0.0",
       "publish": false,
       "annotations": [
           {
               "key": "whisk-managed",
               "value": {
                   "file": "deploy.yaml",
                   "projectDeps": [],
                   "projectHash": "bf727e20549b99ff393900380e3e74f6b4ccdfcd",
                   "projectName": "test"
               }
           }
       ],
       "parameters": [
          ...
       ],
       "binding": {},
       "actions": [
          ...
       ]
   }
   ```
   
   ### 4. Export project
   ```bash
   $ wskdeploy export --projectname test test/test.yaml -v
   
   ... omit ...
   ## WRONG URL PATH!!
   [GET]        
https://${HOST}/api/v1/namespaces/_/actions//whisk.system/alarms/alarm?code=true
 
   Req Headers
   {
     "Authorization": [
       ""
     ],
     "User-Agent": [
       "OpenWhisk-Go-Client darwin amd64"
     ]
   }
   RESPONSE:Got response with code 404
   Resp Headers
   {
     "Connection": [
       "keep-alive"
     ],
     "Content-Length": [
       "96"
     ],
     "Content-Type": [
       "application/json"
     ],
     "Date": [
       "Fri, 07 Jun 2019 07:05:50 GMT"
     ],
     "Server": [
       "nginx"
     ],
     "X-Request-Id": [
       "f0e2d1bd72f9bb0c2e45a40ab2c6ba7b",
       "f0e2d1bd72f9bb0c2e45a40ab2c6ba7b"
     ]
   }
   Response body size is 96 bytes
   Response body received:
   {"code":"f0e2d1bd72f9bb0c2e45a40ab2c6ba7b","error":"The requested resource 
could not be found."}
   REQUEST:
   ## WRONG URL PATH!!
   [POST]       
https://${HOST}/api/v1/namespaces/_/actions//whisk.system/alarms/alarm?blocking=true&result=true
   Req Headers 
   {
     "Authorization": [
       ""
     ],
     "Content-Type": [
       "application/json"
     ],
     "User-Agent": [
       "OpenWhisk-Go-Client darwin amd64"
     ]
   }
   Req Body
   {"authKey":"","lifecycleEvent":"READ","triggerName":"/_/Every11Hours"}
   
   RESPONSE:Got response with code 404
   Resp Headers
   {
     "Connection": [
       "keep-alive"
     ],
     "Content-Length": [
       "96"
     ],
     "Content-Type": [
       "application/json"
     ],
     "Date": [
       "Fri, 07 Jun 2019 07:05:50 GMT"
     ],
     "Server": [
       "nginx"
     ],
     "X-Request-Id": [
       "447e2f72eb5c0d83dad00360fef78b03",
       "447e2f72eb5c0d83dad00360fef78b03"
     ]
   }
   Response body size is 96 bytes
   Response body received:
   {"code":"447e2f72eb5c0d83dad00360fef78b03","error":"The requested resource 
could not be found."}
   Error: The requested resource could not be found. (code 
447e2f72eb5c0d83dad00360fef78b03)%
   ```
   
   ## Cause of failure
   The URL of the API that validates the alarm feed trigger is invalid.
   
   As is:
   ```
   
https://${HOST}/api/v1/namespaces/_/actions//whisk.system/alarms/alarm?blocking=true&result=true
   ```
   
   To be:
   ```
   
https://${HOST}/api/v1/namespaces/whisk.system/actions/alarms/alarm?blocking=true&result=true
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to