apache / openwhisk-package-alarms

Apache OpenWhisk package that can be used to create periodic, time-based alarms.
https://openwhisk.apache.org/
Apache License 2.0
24 stars 49 forks source link

ENOTFOUND when creating an alarm trigger #222

Closed mluds closed 3 years ago

mluds commented 3 years ago

I'm trying to create a cron trigger using this command: wsk trigger create mytrigger --feed /whisk.system/alarms/alarm --param cron '0 * * * *'

However I get what seems to be a DNS related error:

{
    "activationId": "1d2cf4e1d23b4699acf4e1d23ba69952",
    "annotations": [
        {
            "key": "path",
            "value": "whisk.system/alarms/alarm"
        },
        {
            "key": "waitTime",
            "value": 114
        },
        {
            "key": "kind",
            "value": "nodejs:6"
        },
        {
            "key": "timeout",
            "value": false
        },
        {
            "key": "limits",
            "value": {
                "concurrency": 1,
                "logs": 10,
                "memory": 256,
                "timeout": 60000
            }
        }
    ],
    "duration": 12,
    "end": 1602630229302,
    "logs": [],
    "name": "alarm",
    "namespace": "whisk.system",
    "publish": false,
    "response": {
        "result": {
            "error": {
                "code": "ENOTFOUND",
                "errno": "ENOTFOUND",
                "host": "https",
                "hostname": "https",
                "message": "getaddrinfo ENOTFOUND https https:443",
                "name": "Error",
                "port": 443,
                "stack": "Error: getaddrinfo ENOTFOUND https https:443\n    at errnoException (dns.js:28:10)\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)",
                "syscall": "getaddrinfo"
            }
        },
        "size": 344,
        "status": "application error",
        "success": false
    },
    "start": 1602630229290,
    "subject": "whisk.system",
    "version": "0.0.1"
}
{
    "activationId": "438b0b2ac7ec4c3a8b0b2ac7ecbc3a46",
    "annotations": [
        {
            "key": "path",
            "value": "whisk.system/alarms/alarm"
        },
        {
            "key": "waitTime",
            "value": 26
        },
        {
            "key": "kind",
            "value": "nodejs:6"
        },
        {
            "key": "timeout",
            "value": false
        },
        {
            "key": "limits",
            "value": {
                "concurrency": 1,
                "logs": 10,
                "memory": 256,
                "timeout": 60000
            }
        }
    ],
    "duration": 17,
    "end": 1602630229380,
    "logs": [],
    "name": "alarm",
    "namespace": "whisk.system",
    "publish": false,
    "response": {
        "result": {
            "error": {
                "code": "ENOTFOUND",
                "errno": "ENOTFOUND",
                "host": "https",
                "hostname": "https",
                "message": "getaddrinfo ENOTFOUND https https:443",
                "name": "Error",
                "port": 443,
                "stack": "Error: getaddrinfo ENOTFOUND https https:443\n    at errnoException (dns.js:28:10)\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)",
                "syscall": "getaddrinfo"
            }
        },
        "size": 344,
        "status": "application error",
        "success": false
    },
    "start": 1602630229363,
    "subject": "whisk.system",
    "version": "0.0.1"
}
ok: deleted trigger mytrigger

The host parameter looked off so I checked the environment configuration, but it looks ok.

root@openwhisk-alarmprovider-fccf54c4f-vxwzf:/# echo $ENDPOINT_AUTH
openwhisk.mydomain.org:443
root@openwhisk-alarmprovider-fccf54c4f-vxwzf:/# echo $ROUTER_HOST
openwhisk.mydomain.org:443

I also verified that DNS does work.

root@openwhisk-alarmprovider-fccf54c4f-dhgll:/# node
> dns.resolve('www.google.com', (error, addresses) => { console.error(error); console.log(addresses); });
QueryReqWrap {
  bindingName: 'queryA',
  callback: [Function],
  hostname: 'www.google.com',
  oncomplete: [Function: onresolve],
  ttl: false,
  domain:
   Domain {
     domain: null,
     _events:
      [Object: null prototype] {
        removeListener: [Function: updateExceptionCapture],
        newListener: [Function: updateExceptionCapture],
        error: [Function: debugDomainError] },
     _eventsCount: 3,
     _maxListeners: undefined,
     members: [],
     [Symbol(kWeak)]: WeakReference {} },
  channel:
   ChannelWrap {
     domain:
      Domain {
        domain: null,
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        members: [],
        [Symbol(kWeak)]: WeakReference {} } } }
> null
[ '216.58.195.68' ]

I'm running this on Openwhisk installed on Kubernetes using the Helm chart, and configured to use the openwhisk/alarmprovider:2.2.0 image. Here is my Helm config (I changed some variables, including the domain, for security reasons):

whisk:
  ingress:
    domain: openwhisk.mydomain.org
    apiHostName: openwhisk.mydomain.org
    apiHostPort: 443
    apiHostProto: https
    type: Standard
    # annotations:
    #   traefik.ingress.kubernetes.io/router.entrypoints: websecure
    #   traefik.ingress.kubernetes.io/router.tls: "true"
  auth:
    system: "mysystemtoken"
    guest: "myguesttoken"
  containerPool:
    userMemory: "10240m"
  limits:
    actionsInvokesConcurrent: 200
    actionsInvokesPerminute: 200
    triggersFiresPerminute: 200
    actions:
      time:
        max: "60m"
      memory:
        max: "8192m"
      concurrency:
        max: 4
k8s:
  dns: kube-dns.kube-system
docker:
  registry:
    name: "myregistry"
    username: "myusername"
    password: "mypassword"
zookeeper:
  replicaCount: 3
kafka:
  replicaCount: 3
db:
  external: true
  wipeAndInit: true
  protocol: "http"
  host: "couchdb-svc-couchdb.couchdb.svc.cluster.local"
  port: 5984
  auth:
    username: "myusername"
    password: "mypassword"
nginx:
  httpsNodePort: 443
  replicaCount: 3
controller:
  replicaCount: 3
invoker:
  jvmHeapMB: "2048"
  containerFactory:
    impl: "docker"
    enableConcurrency: true

Any help would be appreciated.

rabbah commented 3 years ago

This error "message": "getaddrinfo ENOTFOUND https https:443", suggests the the API host for the alarm service wasn't configured or cannot be resolved correctly. The action whisk.system/alarms/alarm needs to be able to reach the Alarm API host.

mluds commented 3 years ago

I wasn't able to track down the exact issue, but upgrading openwhisk-deploy-kube from commit 3899c47cd87b06c7fd3b1753a06b3d630684b364 to f58729b8265fe47f663dd1fd4e8b798391c45e86 seemed to resolve it. Thank you