Skip to content

aio rt trigger create fails to create a trigger with a feed from /whisk.system/alarms package #269

@dominik-kornas-wttech

Description

@dominik-kornas-wttech

Describe the bug
Creating a trigger that has a feed (any of the alarms package feeds) fails with a Feed name is not valid error.

Example command failing with an error

$ aio rt trigger create my-trigger -f /whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z" -v
2022-10-26T10:25:23.920Z aio-cli-plugin-runtime {
  apiversion: 'v1',
  apihost: 'https://adobeioruntime.net',
  namespace: '******************',
  api_key: ''******************'
}
2022-10-26T10:25:23.920Z @adobe/aio-lib-runtime:RuntimeAPI:debug init options: {
  "apiversion": "v1",
  "apihost": "https://adobeioruntime.net",
  "namespace": "'******************",
  "api_key": "'******************"
}
2022-10-26T10:25:23.922Z @adobe/aio-lib-runtime:RuntimeAPI:debug proxy settings not found
2022-10-26T10:25:25.344Z aio-cli-plugin-runtime OpenWhiskError: PUT https://adobeioruntime.net/api/v1/namespaces/******************/triggers/my-trigger Returned HTTP 400 (Bad Request) --> "Feed name is not valid"
    at (...)
 »   Error: failed to create the trigger: feed name is not valid (400 Bad
 »   Request)
 »    specify --verbose flag for more information

namespace and APi key obfuscated

This looks like related to a leading slash, as the same command executed with wsk cli works:

$ wsk trigger create my-trigger -f whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z"
ok: invoked /whisk.system/alarms/once with id 3de991f748c94834a991f748c9783431
{
    "actionHost": "10.216.0.50",
    "activationId": "3de991f748c94834a991f748c9783431",
    "annotations": [
        {
            "key": "path",
            "value": "whisk.system/alarms/once"
        },
        {
            "key": "waitTime",
            "value": 128
        },
        {
            "key": "kind",
            "value": "nodejs:10"
        },
        {
            "key": "timeout",
            "value": false
        },
        {
            "key": "limits",
            "value": {
                "concurrency": 1,
                "logs": 10,
                "memory": 256,
                "timeout": 60000
            }
        },
        {
            "key": "initTime",
            "value": 158
        }
    ],
    "duration": 2277,
    "end": 1666781688181,
    "invokerInstanceId": {
        "instance": 4,
        "instanceType": "invoker",
        "uniqueName": "rt-invoker-4",
        "userMemory": "1500000000000000 B"
    },
    "logs": [],
    "name": "once",
    "namespace": "******************",
    "podName": "wskrt-invoker-44-370593-prewarm-nodejs10",
    "publish": false,
    "response": {
        "result": {
            "status": "success"
        },
        "size": 20,
        "status": "success",
        "success": true
    },
    "start": 1666781685904,
    "subject": "******************",
    "version": "0.0.245"
}
ok: created trigger my-trigger

Trying to use aio cli trigger create without the leading slash generates another error The requested resource does not exist

$ aio rt trigger create my-trigger -f whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z" -v
(...)
2022-10-26T10:40:22.974Z @adobe/aio-lib-runtime:RuntimeAPI:debug proxy settings not found
2022-10-26T10:40:26.448Z aio-cli-plugin-runtime OpenWhiskError: POST https://adobeioruntime.net/api/v1/namespaces/******************/actions/alarms/once Returned HTTP 404 (Not Found) --> "The requested resource does not exist."
    at (...)
 »   Error: failed to create the trigger: the requested resource does not
 »   exist. (404 Not Found)
 »    specify --verbose flag for more information

Note that in addition the working command does not align with the documentation which instructs to provide leading slash.
Documentation examples:

Expected behavior
The aio cli trigger create works as documented.
The App Builder app deployment (aio app run) works as well and allows to create triggers along actions during deployment.

Versions:

  • OS: Windows 10 Pro
  • aio cli: 9.1.0
  • wsk cli: 1.2.0-windows-386
  • node: 14.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions