Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Error creating Openwhisk cron triggers #188

Open
mluds opened this issue Dec 23, 2019 · 0 comments
Open

Error creating Openwhisk cron triggers #188

mluds opened this issue Dec 23, 2019 · 0 comments
Assignees

Comments

@mluds
Copy link

mluds commented Dec 23, 2019

Bug Report

Description

  1. What did you do?

sls deploy using openwhisk and a cron trigger.

  1. What happened?

An "application error" on the openwhisk trigger. It says it can't find it in the database:

$ wsk trigger get check-ipa-trigger                                                                                                         
{                                                                                                                                                                                       
    "activationId": "52ee78185a654383ae78185a65b38392",                                                                                                                                 
    "annotations": [                                                                                                                                                                    
        {                                                                                                                                                                               
            "key": "path",                                                                  
            "value": "whisk.system/alarms/alarm"
        },
        {
            "key": "waitTime",
            "value": 35
        },
        {
            "key": "kind",
            "value": "nodejs:6"
        },
        {
            "key": "timeout",
            "value": false
        },
        {
            "key": "limits",
            "value": {
                "concurrency": 1,
                "logs": 10,
                "memory": 256,
                "timeout": 60000
            }
        }
    ],
    "duration": 125,
    "end": 1577126423791,
    "logs": [],
    "name": "alarm",
    "namespace": "admin",
    "publish": false,
    "response": {
        "result": {
            "error": {
                "error": "could not find trigger /admin/check-ipa-trigger in the database"
            }
        },
        "size": 85,
       "status": "application error",
        "success": false
    },
    "start": 1577126423666,
    "subject": "admin",
    "version": "0.0.1"
}
  1. What should've happened?

The trigger should be created successfully. It works when I create the trigger manually:

$ wsk trigger create manual_trigger --feed /whisk.system/alarms/alarm --param cron "* * * * *"
$ wsk trigger get manual_trigger                 
{                      
    "activationId": "74443eb6ae8647cd843eb6ae86a7cd2b",
    "annotations": [                         
        {                                                                                   
            "key": "path",
            "value": "whisk.system/alarms/alarm"
        },          
        {                   
            "key": "waitTime",
            "value": 7
        },                 
        {              
            "key": "kind",
            "value": "nodejs:6"
        },                                                                                  
        {
            "key": "timeout",
            "value": false
        },
        {
            "key": "limits",
            "value": {
                "concurrency": 1,
                "logs": 10,
                "memory": 256,
                "timeout": 60000
            }
        }
    ],
    "duration": 48,
    "end": 1577126623465,
    "logs": [],
    "name": "alarm",
    "namespace": "admin",
    "publish": false,
    "response": {
        "result": {
            "config": {
                "cron": "* * * * *",
                "name": "manual_trigger",
                "namespace": "admin",
                "payload": {
                    "payload": ""
                }
            },
            "status": {
                "active": true,
                "dateChanged": 1577126581081,
                "dateChangedISO": "2019-12-23T18:43:01Z"
            }
        },
        "size": 193,
        "status": "success",
        "success": true
    },
    "start": 1577126623417,
    "subject": "admin",
    "version": "0.0.1"
}

And make this change to my serverless.yaml:

functions:
  check-ipa:
    events:
      - trigger: manual_trigger
  1. What's the content of your serverless.yml file?
service: checkipa

provider:
  name: openwhisk
  runtime: python:2

functions:
  check-ipa:
    handler: check-ipa.main
    image: my.private.registry/checkipa:1.0
    memory: 512
    events:
      - trigger: check-ipa-trigger
    environment:
      TOKEN: ${env:TOKEN}

plugins:
  - serverless-openwhisk
  - serverless-python-requirements
  - serverless-dotenv-plugin

custom:
  pythonRequirements:
   pythonBin: /bin/python
   noDeploy: []
  zip: true

resources:
  triggers:
    check-ipa-trigger:
      feed: /whisk.system/alarms/alarm
      feed_parameters:
        cron: '* * * * *'
  1. What's the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)
$ SLS_DEBUG=* serverless deploy
Serverless: Load command interactiveCli
Serverless: Load command config                                                                              
Serverless: Load command config:credentials                                                               
Serverless: Load command create                                                                   
Serverless: Load command install                                                                                    
Serverless: Load command package                                                                                          
Serverless: Load command deploy                                                                                              
Serverless: Load command deploy:function                                                                                           
Serverless: Load command deploy:list                                                                                          
Serverless: Load command deploy:list:functions                                                                              
Serverless: Load command invoke                                                                                     
Serverless: Load command invoke:local                                                                             
Serverless: Load command info                                                                              
Serverless: Load command logs                                                                                                             
Serverless: Load command metrics                                                                                                                                                        
Serverless: Load command print                                                                                                                                                          
Serverless: Load command remove                                                                                                                                                         
Serverless: Load command rollback                                                                                                                                                       
Serverless: Load command rollback:function                                                                                                                                              
Serverless: Load command slstats                                                                                                                                                        
Serverless: Load command plugin                                                                                                                                                         
Serverless: Load command plugin                                                                                                                                                         
Serverless: Load command plugin:install                                                                                                                                                 
Serverless: Load command plugin                                                                                                                                                         
Serverless: Load command plugin:uninstall                                                                                                                                               
Serverless: Load command plugin                                                                                                                                                         
Serverless: Load command plugin:list                                                                                                                                                    
Serverless: Load command plugin                                                                                                                                                         
Serverless: Load command plugin:search                                                                                                                                                  
Serverless: Load command config                                                                                                                                                         
Serverless: Load command config:credentials                                                                                                                                             
Serverless: Load command config                                                                                                                                                         
Serverless: Load command config:credentials                                                                                                                                             
Serverless: Load command requirements                                                                                                                                                   
Serverless: Load command requirements:clean                                                                                                                                             
Serverless: Load command requirements:install                                               
Serverless: Load command requirements:cleanCache
Serverless: DOTENV: Loading environment variables from .env:
Serverless:      - TOKEN                                                                    
Serverless: Load command login                                                              
Serverless: Load command logout                                                             
Serverless: Load command generate-event                                                     
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Generated requirements from /home/mludwig/serverless-functions/functions/function-check-ipa/requirements.txt in /home/mludwig/serverless-functions/functions/function-check-
ipa/.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /home/mludwig/.cache/serverless-python-requirements/7cc4959877dbe6b6c63a8eb1bfe3bfb545fa8fe5b28b1b2c13e4a7c1c0d1c4d4_slspyc ...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Compiling Functions...
Serverless: Compiling Packages...
Serverless: Compiling API Gateway definitions...
Serverless: Compiling Rules...
Serverless: Compiling Triggers & Feeds...
Serverless: Compiling Service Bindings...
Serverless: Deploying Functions...
Serverless: Deploying Triggers...
Serverless: Deploying Rules...
Serverless: Deployment successful!

Service Information
platform:       http://redacted.host:port
namespace:      _
service:        checkipa

packages:
**no packages deployed**

actions:
checkipa-dev-check-ipa

triggers:
check-ipa-trigger    manual_trigger

rules:
checkipa_check-ipa-trigger_to_check-ipa

endpoints (api-gw):
**no routes deployed**

endpoints (web actions):
**no web actions deployed**

Similar or dependent issues:

  • #12345
@medikoo medikoo transferred this issue from serverless/serverless Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants