{"action":"created","issue":{"url":"https://api.github.com/repos/erlio/vernemq/issues/176","repository_url":"https://api.github.com/repos/erlio/vernemq","labels_url":"https://api.github.com/repos/erlio/vernemq/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/erlio/vernemq/issues/176/comments","events_url":"https://api.github.com/repos/erlio/vernemq/issues/176/events","html_url":"https://github.com/erlio/vernemq/issues/176","id":168025310,"number":176,"title":"Facing Broker Hang after series of invalid Username/Password connection trials and recover after a valid Username/Password Connection","user":{"login":"hbahn","id":13863157,"avatar_url":"https://avatars.githubusercontent.com/u/13863157?v=3","gravatar_id":"","url":"https://api.github.com/users/hbahn","html_url":"https://github.com/hbahn","followers_url":"https://api.github.com/users/hbahn/followers","following_url":"https://api.github.com/users/hbahn/following{/other_user}","gists_url":"https://api.github.com/users/hbahn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbahn/subscriptions","organizations_url":"https://api.github.com/users/hbahn/orgs","repos_url":"https://api.github.com/users/hbahn/repos","events_url":"https://api.github.com/users/hbahn/events{/privacy}","received_events_url":"https://api.github.com/users/hbahn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-28T06:49:23Z","updated_at":"2016-07-28T09:06:46Z","closed_at":null,"body":"Hi there,\r\n\r\nWe faced a VerneMQ hang issue under the certain situation.\r\nBefore I describe detail issues and phenomenon, I would like to explain how our system works regarding authentication.\r\n\r\nAuthentication: our system has a Portal and it stores user's credentials(ID and PW). when a MQTT client connects to the Broker a modified lua script (please find the first attachment) to refer the credential whether the client is member of our system or not.\r\n\r\nHere is Cause and Behaviour\r\n\r\n_1) a invalid user (Client **0**) tried to connect to Broker (without ID/PW, no username/password) and please see the log below_\r\n```\r\n2016-07-22 17:09:29.154 [error] <0.243.0>@vmq_diversity_script:handle_call:124 can't call function auth_on_register with args [{addr,<<\"218.36.252.2\">>},{port,46120},{mountpoint,<<>>},{client_id,<<\"100001\">>},{username,undefined},{password,undefined},{clean_session,true}] in \"/etc/vernemq/vmq_diversity/_build/default/lib/vmq_diversity/priv/../scripts/init.lua\" due to {illegal_index,nil,<<\"CERT_CLIENT_ID\">>}\r\n2016-07-22 17:09:30.171 [error] <0.243.0>@vmq_diversity_script:handle_call:124 can't call function auth_on_register with args [{addr,<<\"218.36.252.2\">>},{port,46150},{mountpoint,<<>>},{client_id,<<\"100001\">>},{username,undefined},{password,undefined},{clean_session,true}] in \"/etc/vernemq/vmq_diversity/_build/default/lib/vmq_diversity/priv/../scripts/init.lua\" due to {illegal_index,nil,<<\"CERT_CLIENT_ID\">>}\r\n2016-07-22 17:09:31.188 [error] <0.243.0>@vmq_diversity_script:handle_call:124 can't call function auth_on_register with args [{addr,<<\"218.36.252.2\">>},{port,46185},{mountpoint,<<>>},{client_id,<<\"100001\">>},{username,undefined},{password,undefined},{clean_session,true}] in \"/etc/vernemq/vmq_diversity/_build/default/lib/vmq_diversity/priv/../scripts/init.lua\" due to {illegal_index,nil,<<\"CERT_CLIENT_ID\">>}\r\n```\r\n_2) After step 1) Broker can receive Publish message and send PUBACK message from Client **A** but Broker cannot send this message to Client **B** (who is a receiver and subscribes proper topic, Client **A** sends the message toward Client **B**). It is like system hang._\r\n\r\n_3) After step 2) another client **C** tried to connect with invalid credential (no username/password), the hang phenomenon was no recovered. (the Client **B** could not receive any message from Broker, however the Client **A** kept publishing messages toward Broker and intened to send to Client **B**)_\r\n```\r\n2016-07-24 10:03:03.023 [error] <0.243.0>@vmq_diversity_script:handle_call:124 can't call function auth_on_register with args [{addr,<<\"94.102.49.190\">>},{port,36461},{mountpoint,<<>>},{client_id,<<\"paho/D33AC37DEFA35CD7CD\">>},{username,undefined},{password,undefined},{clean_session,true}] in \"/etc/vernemq/vmq_diversity/_build/default/lib/vmq_diversity/priv/../scripts/init.lua\" due to {illegal_index,nil,<<\"CERT_CLIENT_ID\">>}\r\n```\r\n_3) After step 3) another client **D** tried to connect with proper credential (username/password) and the hang was suddenly recovered which means that  (the Client **B** could receive message sent Client **A**)_\r\n\r\nSorry for this long description.\r\nI would ask you that Is this bug of VerneMQ or our Lua script for refering credential from 3rd party entity?\r\nAppreciated in advance.\r\n\r\nHongbeom."},"comment":{"url":"https://api.github.com/repos/erlio/vernemq/issues/comments/235840791","html_url":"https://github.com/erlio/vernemq/issues/176#issuecomment-235840791","issue_url":"https://api.github.com/repos/erlio/vernemq/issues/176","id":235840791,"user":{"login":"hbahn","id":13863157,"avatar_url":"https://avatars.githubusercontent.com/u/13863157?v=3","gravatar_id":"","url":"https://api.github.com/users/hbahn","html_url":"https://github.com/hbahn","followers_url":"https://api.github.com/users/hbahn/followers","following_url":"https://api.github.com/users/hbahn/following{/other_user}","gists_url":"https://api.github.com/users/hbahn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbahn/subscriptions","organizations_url":"https://api.github.com/users/hbahn/orgs","repos_url":"https://api.github.com/users/hbahn/repos","events_url":"https://api.github.com/users/hbahn/events{/privacy}","received_events_url":"https://api.github.com/users/hbahn/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T09:06:46Z","updated_at":"2016-07-28T09:06:46Z","body":"Actually, the Broker was not broken down we do not have any crash log. As I mentioned without any failover and Broker was recoved.\r\nThe version is 0.12.5 and we \"off\" the allow_anonymous configuration.\r\n\r\nThanks"}}
{"actor":{"display_login":"hbahn"}}