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

Fails to export the alarm feed trigger #1055

Closed
KeonHee opened this issue Jun 7, 2019 · 1 comment
Closed

Fails to export the alarm feed trigger #1055

KeonHee opened this issue Jun 7, 2019 · 1 comment

Comments

@KeonHee
Copy link
Member

KeonHee commented Jun 7, 2019

Failure Scenario

Exporting a project with an alarm feed trigger will fail.

1. yaml file: deploy.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

$ wskdeploy sync --projectname test -m deploy.yaml

3. Check project value

$ 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

$ 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
@KeonHee
Copy link
Member Author

KeonHee commented Jun 7, 2019

Sorry. I tested with an old version wskdeploy.
This issue was fixed #1052

@KeonHee KeonHee closed this as completed Jun 7, 2019
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

1 participant