processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.11k stars 1.51k forks source link

Getting ejabberd_c2s:process_info/2:250 Unexpected info #3958

Closed lokesh411 closed 1 year ago

lokesh411 commented 1 year ago

Environment

Errors

2022-12-19 06:06:45.126949+00:00 [warning] <0.28864.1716>@ejabberd_c2s:process_info/2:250 Unexpected info: {http,{#Ref<0.893184502.2912157699.243232>, {{"HTTP/1.1",200,"OK"}, [{"cache-control","no-store"}, {"connection","keep-alive"}, {"date","Mon, 19 Dec 2022 06:06:45 GMT"}, {"etag","W/\"2-nOO9QiTIwXgNtWtBJezz8kv3SLc\""}, {"content-length","2"}, {"content-type","text/plain; charset=utf-8"}, {"expires","0"}, {"strict-transport-security", "max-age=31536000; includeSubDomains"}, {"x-frame-options","DENY"}, {"x-xss-protection","1; mode=block"}, {"referrer-policy","no-referrer"}, {"feature-policy","geolocation 'self'"}, {"x-content-type-options","nosniff"}, {"content-security-policy", "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"}, {"access-control-allow-methods", "GET, POST, OPTIONS"}, {"access-control-allow-headers", "Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since"}], <<"OK">>}}}

Bug description

Logs (in /opt/ejabberd/logs/ejabberd.log) is completely filled with these warnings. I browsed through this online, but not able to find any cause for this. It doesn't seem to cause any problems, but want to understand why this warning log comes. Thanks in advance

licaon-kter commented 1 year ago

Gist of the cleaned config?

lokesh411 commented 1 year ago
hosts:
  - "<hostname>"
loglevel: warning

certfiles:
  - "/opt/ejabberd/conf/ejabberd_rev.pem"

cache_size: 150000
disable_sasl_mechanisms:
  - "SCRAM-SHA-512"
  - "SCRAM-SHA-256"
  - "SCRAM-SHA-1"
  - "DIGEST-MD5"

listen:
  -
    port: 5222
    ip: "::"
    module: ejabberd_c2s
    max_stanza_size: 262144
    shaper: c2s_shaper
    tls: true
    #starttls: true
    access: c2s
    #starttls_required: true
  -
    port: 5269
    ip: "::"
    module: ejabberd_s2s_in
    max_stanza_size: 524288
  -
    port: 5443
    ip: "::"
    module: ejabberd_http
    tls: true
    request_handlers:
      "/admin": ejabberd_web_admin
      "/websocket_agents": ejabberd_http_ws
      "/api": mod_http_api
  -
    port: 5280
    ip: "::"
    module: ejabberd_http
    request_handlers:
      "/admin": ejabberd_web_admin
      "/api": mod_http_api

s2s_use_starttls: optional

acl:
  local:
    user_regexp: ""
  loopback:
    ip:
      - 127.0.0.0/8
      - ::1/128
      - ::FFFF:127.0.0.1/128
  admin:
    user:
      - <user>

access_rules:
  local:
    allow: local
  c2s:
    deny: blocked
    allow: all
  announce:
    allow: admin
  configure:
    allow: admin
  muc_create:
    allow: local
  pubsub_createnode:
    allow: local
  trusted_network:
    allow: loopback
    allow: yellow_network

api_permissions:
  "console commands":
    from:
      - ejabberd_ctl
    who: all
    what: "*"
  "yellow network":
    who:
        ip: "10.0.0.0/8"
    what:
      - "*"
      - "!stop"
      - "!start"
  "admin access":
    who:
      access:
        allow:
          acl: loopback
          acl: admin
      oauth:
        scope: "ejabberd:admin"
        access:
          allow:
            acl: loopback
            acl: admin
    what:
      - "*"
      - "!stop"
      - "!start"
  "public commands":
    who:
      ip: 127.0.0.1/8
    what:
      - status
      - connected_users_number

shaper:
  normal: 1000
  fast: 50000

shaper_rules:
  max_user_sessions: 100
  max_user_offline_messages:
    5000: admin
    100: all
  c2s_shaper:
    none: admin
    normal: all
  s2s_shaper: fast

max_fsm_queue: 10000

acme:
   contact: "mailto:<email>"
   ca_url: "https://acme-v02.api.letsencrypt.org"

websocket_ping_interval: 10
websocket_timeout: 20

host_config:
  "<email>":
    auth_method:
      - odbc
      - anonymous
    allow_multiple_connections: true
    anonymous_protocol: both

sql_type: mysql
sql_server: "<url>"
sql_database: "<db_name>"
sql_username: "<user>"
sql_password: "<pass>"

modules:
  mod_adhoc: {}
  mod_admin_extra: {}
  mod_client_state: {}
  mod_configure: {}
  mod_disco: {}
  mod_http_api: {}
  mod_ping: {}
  mod_register:
    ## Only accept registration requests from the "trusted"
    ## network (see access_rules section above).
    ## Think twice before enabling registration from any
    ## address. See the Jabber SPAM Manifesto for details:
    ## https://github.com/ge0rg/jabber-spam-fighting-manifesto
    ip_access: trusted_network
    #mod_roster:
    #versioning: true
  mod_s2s_dialback: {}
  mod_vcard: {}
  mod_stream_mgmt:
    resend_on_timeout: if_offline
  mod_vcard_xupdate: {}
  mod_yellow_presence: {}
  mod_version:
    show_os: false

### Local Variables:
### mode: yaml
### End:
### vim: set filetype=yaml tabstop=8

mod_yellow_presence is a custom module that we have written

prefiks commented 1 year ago

That maybe is some message that is produced by doing http request with httpc module? I don't think we do anything like this in c2s process anywhere, maybe this something that your module is doing?

lokesh411 commented 1 year ago

Thanks, Let me check and get back

badlop commented 1 year ago

Hi, is there any more details about this problem, or can it get closed as "cannot reproduce"?

lokesh411 commented 1 year ago

Hey @badlop, yes, I was able to fix this one, this was due to a bad code in the custom module, Thanks and Sorry for late responses