adobe / adobe/aio-cli-plugin-runtime
`aio rt trigger create` fails to create a trigger with a feed from /whisk.system/alarms package
- Langage dominant
- JavaScript
- Étoiles
- 21
- Forks
- 33
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**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:
* [creating trigger using wsk cli](https://developer.adobe.com/runtime/docs/guides/reference/prepackages/)
* [creating trigger using app builder manifest file](https://developer.adobe.com/app-builder/docs/resources/cron-jobs/lesson2/)
**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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par suivre la commande `aio rt trigger create` et la gestion de son feed, en utilisant comme comparaison l’exemple défaillant `/whisk.system/alarms/once` et la commande `wsk` fonctionnelle. Vérifiez le comportement des noms de feed avec et sans barre oblique initiale, puis confirmez que la commande documentée fonctionne et que le comportement du déploiement de App Builder reste intact.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- cli
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100