emqx / emqx-web-hook

EMQX Webhook Plugin
https://www.emqx.com
Apache License 2.0
79 stars 36 forks source link

webhook badmatch error #255

Closed rauntska closed 2 years ago

rauntska commented 3 years ago

Hi,

I seem to be having some error with the latest 4.2.5 emqx version. Image im running : image: emqx/emqx:4.2.5

emqx_web_hook.conf:

##====================================================================
## WebHook
##====================================================================

## The web services URL for Hook request
##
## Value: String
web.hook.api.url = https://blahblah.azurewebsites.net/api/MqttEventLogger

##--------------------------------------------------------------------
## HTTP Request Headers
##
## The header params what you extra need
## Format:
##    web.hook.headers.<param> = your-param
## Example:
## 1. web.hook.headers.token = your-token
## 2. web.hook.headers.other = others-param
##
## Value: String
## web.hook.headers.token = your-token

##--------------------------------------------------------------------
## Encode message payload field
##
## Value: base64 | base62
## web.hook.encode_payload = base64
## Mysql ssl configuration.
##
## Value: on | off
## web.hook.ssl = off

##--------------------------------------------------------------------
## CA certificate.
##
## Value: File
## web.hook.ssl.cafile  = path to your ca file
## Client ssl certificate.
##
## Value: File
## web.hook.ssl.certfile = path to your clientcert file

##--------------------------------------------------------------------
## Client ssl keyfile.
##
## Value: File
## web.hook.ssl.keyfile = path to your clientkey file

##--------------------------------------------------------------------
## Pool size of HTTP connection pools.
##
## Value: Integer
# web.hook.pool_size = 32

##--------------------------------------------------------------------
## Hook Rules
## These configuration items represent a list of events should be forwarded
##
## Format:
##   web.hook.rule.<HookName>.<No> = <Spec>
web.hook.rule.client.connect.1       = {"action": "on_client_connect"}
web.hook.rule.client.connack.1       = {"action": "on_client_connack"}
web.hook.rule.client.connected.1     = {"action": "on_client_connected"}
web.hook.rule.client.disconnected.1  = {"action": "on_client_disconnected"}
web.hook.rule.client.subscribe.1     = {"action": "on_client_subscribe"}
web.hook.rule.client.unsubscribe.1   = {"action": "on_client_unsubscribe"}
web.hook.rule.session.subscribed.1   = {"action": "on_session_subscribed"}
web.hook.rule.session.unsubscribed.1 = {"action": "on_session_unsubscribed"}
web.hook.rule.session.terminated.1   = {"action": "on_session_terminated"}
web.hook.rule.message.publish.1      = {"action": "on_message_publish"}
web.hook.rule.message.delivered.1    = {"action": "on_message_delivered"}
web.hook.rule.message.acked.1        = {"action": "on_message_acked"}

Upon starting the server i receive the following error: [error] [Plugins] Load plugin emqx_web_hook failed, cannot start plugin emqx_web_hook for {bad_return,{{emqx_web_hook_app,start,[normal,[]]},{'EXIT',{{badmatch,#{host => "blahblah.azurewebsites.net",path => "/api/MqttEventLogger",scheme => "https"}},[{emqx_web_hook_app,translate_env,0,[{file,"emqx_web_hook_app.erl"},{line,56}]},{emqx_web_hook_app,start,2,[{file,"emqx_web_hook_app.erl"},{line,30}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,277}]}]}}}}

The url itself works fine (tested with postman)

BR, Rauno

zmstone commented 2 years ago

Fixed in https://github.com/emqx/emqx-web-hook/pull/253