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

mod_event_pusher returns error when pushing notifications to muc_light rooms #3407

Closed
apontini opened this issue Nov 18, 2021 · 4 comments
Closed

Comments

@apontini
Copy link

MongooseIM version: 5.0.0
Installed from: Docker
Erlang/OTP version: 23.1-1

As the title states, when I send a message to a muc light room, the following log string is printed and no notification is sent.

when=2021-11-18T09:34:39.234571+00:00 level=error what=hook_failed reason="{badarg,[{ets,lookup_element,['mod_event_pusher_muclight.localhost',backends,2],[{error_info,#{cause => id,module => erl_stdlib_errors}}]},{mod_event_pusher,push_event,3,[{file,\"/home/circleci/app/src/event_pusher/mod_event_pusher.erl\"},{line,52}]},{mod_event_pusher_hook_translator,filter_local_packet,1,[{file,\"/home/circleci/app/src/event_pusher/mod_event_pusher_hook_translator.erl\"},{line,62}]},{ejabberd_hooks,gen_hook_fn_wrapper,3,[{file,\"/home/circleci/app/src/ejabberd_hooks.erl\"},{line,109}]},{safely,apply,2,[{file,\"/home/circleci/app/src/safely.erl\"},{line,42}]},{gen_hook,run_hook,4,[{file,\"/home/circleci/app/src/gen_hook.erl\"},{line,203}]},{mongoose_hooks,run_fold,4,[{file,\"/home/circleci/app/src/mongoose_hooks.erl\"},{line,1473}]},{mongoose_local_delivery,do_route,5,[{file,\"/home/circleci/app/src/mongoose_local_delivery.erl\"},{line,40}]}]}" pid=<0.1099.0> at=gen_hook:log_error_running_hook/5:227 text="Error running hook" params_args= key="{filter_local_packet,<<\"localhost\">>}" handler="{hook_handler,90,fun ejabberd_hooks:gen_hook_fn_wrapper/3,#{function => filter_local_packet,hook_name => filter_local_packet,hook_tag => <<\"localhost\">>,host_type => <<\"localhost\">>,module => mod_event_pusher_hook_translator}}"

My configuration is the following

[general]
  loglevel = "info"
  hosts = ["localhost"]
  default_server_domain = "localhost"
  language = "en"
[auth]
  methods = ["rdbms"]
  password.format = "plain"
[outgoing_pools.rdbms.default]
  scope = "global"
  workers = 5

  [outgoing_pools.rdbms.default.connection]
    driver = "pgsql"
    host = "172.17.0.2"
    database = "mongooseim"
    username = "admin"
    password = "password"

[outgoing_pools.http.push_pool]
  scope = "global"
  workers = 50
  
  [outgoing_pools.http.push_pool.connection]
    host = "http://172.17.0.4:1080"
    path_prefix = "/push"
    
[listen]
  [[listen.c2s]]
    port = 5222

  [[listen.http]]
    port = 5280
    transport.num_acceptors = 10
    transport.max_connections = 1024

    [[listen.http.handlers.mod_bosh]]
      host = "_"
      path = "/http-bind"

    [[listen.http.handlers.mod_websockets]]
      host = "_"
      path = "/ws-xmpp"
      ping_rate = 30_000

    [[listen.http.handlers.mongoose_api_admin]]
      host = "_"
      path = "/admin"

[modules.mod_muc]
  backend = "rdbms"
[modules.mod_muc_light]
  #legacy_mode = true
  backend = "rdbms"
  host = "muclight.@HOST@"
[modules.mod_disco]
[modules.mod_mam_meta]
  backend = "rdbms"
  archive_chat_markers = true
  pm.backend = "rdbms"
  muc.backend = "rdbms"
  muc.host = "muclight.@HOST@"
  rdbms_message_format = "simple"

[modules.mod_mam_meta.muc]
[modules.mod_commands]
[modules.mod_muc_commands]
[modules.mod_muc_light_commands]
[modules.mod_inbox]
  reset_markers = ["displayed"]
  groupchat = ["muclight"]
[modules.mod_last]
  backend = "rdbms"
[modules.mod_offline_stub]
[modules.mod_roster]
  backend = "rdbms"
[modules.mod_carboncopy]
[modules.mod_event_pusher.backend.http]
  pool_name = "push_pool"
  path = "/notifications"
  callback_module = "mod_event_pusher_http_defaults"

I'll add more information if needed

@apontini apontini changed the title mod_event_pusher returns error when pushing notifications to muc light groups mod_event_pusher returns error when pushing notifications to muc_light rooms Nov 18, 2021
@gustawlippa
Copy link
Contributor

Hi! Thank you for the report.

Did you manage to enable push notifications in the end? From what I see, the error was related to mishandling of the MUC Light host, when a stanza was addressed to a room, and should not affect push notifications. We will fix the error in the logs, but you should still get the notifications. From the configuration you provided, they should be POSTed to "http://172.17.0.4:1080/push/notifications".

@apontini
Copy link
Author

apontini commented Feb 3, 2022

Hi! Thank you for your response.

No, I didn't investigate this further due to time related reasons but I'll try again if I'm able to!

@DenysGonchar
Copy link
Collaborator

Fixed in #3939

@DenysGonchar
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants