Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Bridge - Web Hook Creation Error #10321

Closed
zhongwencool opened this issue Apr 4, 2023 · 2 comments
Closed

Data Bridge - Web Hook Creation Error #10321

zhongwencool opened this issue Apr 4, 2023 · 2 comments
Assignees
Labels

Comments

@zhongwencool
Copy link
Member

zhongwencool commented Apr 4, 2023

Report Link: https://www.emqx.io/forum/t/data-bridge-web-hook-creation-error/242/3

What happened?

I have two nodes in AWS EC2 instance and they are joined together in same cluster.
When I create a new Data Bridge (web hook) after clicking save I have error 500. But when I leave the cluster the data bridge is shown in the Data Bridge tab on both the nodes.

The Error

500 INTERNAL_ERROR:error,
{case_clause,
    [#{metrics => #{dropped => 0,'dropped.expired' => 0,'dropped.other' => 0,'dropped.queue_full' => 0,'dropped.resource_not_found' => 0,'dropped.resource_stopped' => 0,failed => 0,inflight => 0,late_reply => 0,matched => 0,queuing => 0,rate => 0.0,rate_last5m => 0.0,rate_max => 0.0,received => 0,retried => 0,success => 0
            },name => <<"test2">>,node => 'emqx@X.X.X.X',status => connected,type => <<"webhook">>,<<"connect_timeout">> => <<"5s">>,<<"enable">> => true,<<"enable_pipelining">> => 100,<<"headers">> => #{<<"content-type">> => <<"application/json">>
            },<<"max_retries">> => 2,<<"method">> => <<"post">>,<<"pool_size">> => 4,<<"pool_type">> => <<"random">>,<<"request_timeout">> => <<"15s">>,<<"resource_opts">> => #{<<"async_inflight_window">> => 100,<<"auto_restart_interval">> => <<"60s">>,<<"health_check_interval">> => <<"15s">>,<<"max_queue_bytes">> => <<"1GB">>,<<"query_mode">> => <<"async">>,<<"request_timeout">> => <<"15s">>,<<"start_after_created">> => <<"true">>,<<"start_timeout">> => <<"5s">>,<<"worker_pool_size">> => 4
            },<<"ssl">> => #{<<"ciphers">> => [],<<"depth">> => 10,<<"enable">> => false,<<"hibernate_after">> => <<"5s">>,<<"reuse_sessions">> => true,<<"secure_renegotiate">> => true,<<"user_lookup_fun">> => <<"emqx_tls_psk:lookup">>,<<"verify">> => <<"verify_peer">>,<<"versions">> => ['tlsv1.3','tlsv1.2','tlsv1.1',tlsv1
                ]
            },<<"url">> => <<"http://X.X.X.X:3000/logData">>
        },#{metrics => #{dropped => 0,'dropped.expired' => 0,'dropped.other' => 0,'dropped.queue_full' => 0,'dropped.resource_not_found' => 0,'dropped.resource_stopped' => 0,failed => 0,inflight => 0,late_reply => 0,matched => 0,queuing => 0,rate => 0.0,rate_last5m => 0.0,rate_max => 0.0,received => 0,retried => 0,success => 0
            },name => <<"test2">>,node => 'emqx@x.x.x.x',status => connected,type => <<"webhook">>,<<"connect_timeout">> => <<"5s">>,<<"enable">> => true,<<"enable_pipelining">> => 100,<<"headers">> => #{<<"content-type">> => <<"application/json">>
            },<<"max_retries">> => 2,<<"method">> => <<"post">>,<<"pool_size">> => 4,<<"pool_type">> => <<"random">>,<<"request_timeout">> => <<"15s">>,<<"resource_opts">> => #{<<"async_inflight_window">> => 100,<<"auto_restart_interval">> => <<"60s">>,<<"health_check_interval">> => <<"15s">>,<<"max_queue_bytes">> => <<"1GB">>,<<"query_mode">> => <<"async">>,<<"request_timeout">> => <<"15s">>,<<"start_after_created">> => <<"true">>,<<"start_timeout">> => <<"5s">>,<<"worker_pool_size">> => 4
            },<<"ssl">> => #{<<"ciphers">> => [],<<"depth">> => 10,<<"enable">> => false,<<"hibernate_after">> => <<"5s">>,<<"reuse_sessions">> => true,<<"secure_renegotiate">> => true,<<"user_lookup_fun">> => <<"emqx_tls_psk:lookup">>,<<"verify">> => <<"verify_peer">>,<<"versions">> => ['tlsv1.3','tlsv1.2','tlsv1.1',tlsv1
                ]
            },<<"url">> => <<"http://X.X.X.X:3000/logData">>
        }
    ]
},
[
    {emqx_bridge_api,'-pick_bridges_by_id/3-fun-1-',
        4,
        [
            {file,
                "emqx_bridge_api.erl"
            },
            {line,
                724
            }
        ]
    },
    {lists,foldl,
        3,
        [
            {file,
                "lists.erl"
            },
            {line,
                1267
            }
        ]
    },
    {emqx_bridge_api,'-zip_bridges/1-fun-0-',
        3,
        [
            {file,
                "emqx_bridge_api.erl"
            },
            {line,
                714
            }
        ]
    },
    {lists,foldl,
        3,
        [
            {file,
                "lists.erl"
            },
            {line,
                1267
            }
        ]
    },
    {emqx_bridge_api,'/bridges',
        2,
        [
            {file,
                "emqx_bridge_api.erl"
            },
            {line,
                498
            }
        ]
    },
    {minirest_handler,apply_callback,
        3,
        [
            {file,
                "minirest_handler.erl"
            },
            {line,
                111
            }
        ]
    },
    {minirest_handler,handle,
        2,
        [
            {file,
                "minirest_handler.erl"
            },
            {line,
                44
            }
        ]
    },
    {minirest_handler,init,
        2,
        [
            {file,
                "minirest_handler.erl"
            },
            {line,
                27
            }
        ]
    },
    {cowboy_handler,execute,
        2,
        [
            {file,
                "cowboy_handler.erl"
            },
            {line,
                41
            }
        ]
    },
    {cowboy_stream_h,execute,
        3,
        [
            {file,
                "cowboy_stream_h.erl"
            },
            {line,
                318
            }
        ]
    },
    {cowboy_stream_h,request_process,
        3,
        [
            {file,
                "cowboy_stream_h.erl"
            },
            {line,
                302
            }
        ]
    },
    {proc_lib,init_p_do_apply,
        3,
        [
            {file,
                "proc_lib.erl"
            },
            {line,
                226
            }
        ]
    }
]

What did you expect to happen?

Don't crash

How can we reproduce it (as minimally and precisely as possible)?

No response

Anything else we need to know?

No response

EMQX version

$ ./bin/emqx_ctl broker
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

v5.0

</details>


### Log files

<details>

</details>
@nishuthan
Copy link

How can we reproduce it (as minimally and precisely as possible)?

1.Install EMQ v5.0.21-g97e7c439 using APT followed this guide
2. edited node.cookie = <My secreet cookie>
3. Followed steps 1 and 2 for 2nd node.
4. In 2nd node used command sudo emqx_ctl cluster join emqx@x.x.x.x (used cluster.discovery_strategy = manual ) Ref
5. Successfully joined the cluster (can see the node in the EMQX dashboard)
6. Rules -> Created rule
7. Databridge -> webhook -> upon clicking save getting the above error.

OS version

Amazon EC2 instance
Ubuntu Server 22.04 LTS

@thalesmg
Copy link
Contributor

thalesmg commented Apr 4, 2023

Hi @nishuthan .

From the version you reported (5.0.21-g97e7c439), it looks like you used a particular commit that is not the actually released v5.0.21.

The commit you used does indeed contain a bug that was later fixed, and the code in v5.0.21 does not contain such bug.

Could you please try again using the correct released v5.0.21? I could not reproduce the issue there.

You may find that version here: https://github.com/emqx/emqx/releases/tag/v5.0.21

I'll close this issue now as it has been solved. Please feel free to open a new one if you find something.

@thalesmg thalesmg closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants