GithubHelp home page GithubHelp logo

Frame too Large quirk about emqx HOT 7 CLOSED

SlothCroissant avatar SlothCroissant commented on May 30, 2024
Frame too Large quirk

from emqx.

Comments (7)

SlothCroissant avatar SlothCroissant commented on May 30, 2024 1

Update - Didn't even think about the fact that when running replicants, MQTT requests hit the replicants, not the core :)

Adding the same env var to the replicantsTemplate seems to have resolved my problem. Appreciate your support @zmstone!

---
apiVersion: apps.emqx.io/v2beta1
kind: EMQX
metadata:
  name: emqx
spec:
  image: emqx:5.5.0
  coreTemplate:
    spec:
      replicas: 3
      env:
      - name: EMQX_MQTT__MAX_PACKET_SIZE
        value: 256MB
  bootstrapAPIKeys:
    - key: some_api_key
      secret: some_api_secret
  replicantTemplate:
    spec:
      replicas: 3
      env:
      - name: EMQX_MQTT__MAX_PACKET_SIZE
        value: 256MB
  listenersServiceTemplate:
    spec:
      type: LoadBalancer
      loadBalancerIP: 10.1.50.13
  dashboardServiceTemplate:
    spec:
      type: LoadBalancer
      loadBalancerIP: 10.1.50.14

from emqx.

zmstone avatar zmstone commented on May 30, 2024

Hi @SlothCroissant

To inspect the config value in effect, you can execute this command:

$ emqx eval 'emqx_config:get_zone_conf(default, [mqtt, max_packet_size])'
268435456

If it's indeed 256MB in your case, it's likely that the client has sent some bytes which were parsed into a frame length greater than this.

from emqx.

SlothCroissant avatar SlothCroissant commented on May 30, 2024

If it's indeed 256MB in your case, it's likely that the client has sent some bytes which were parsed into a frame length greater than this.

emqx@emqx-core-bfd48bd6c-0:/opt/emqx$ emqx eval 'emqx_config:get_zone_conf(default, [mqtt, max_packet_size])'
268435456

Thanks for your reply, @zmstone. Indeed it is set properly, it seems. Is there a trace log that will show the payload size? From what I can tell, the client is simply sending some JSON (which is not nearly 256MB in size). It's also strange that I can fix the issue with 100% success rate simply by pressing "save" in the EMQX UI.

from emqx.

SlothCroissant avatar SlothCroissant commented on May 30, 2024

Did some more digging to find out if the message was indeed going rogue and sending 256MB+

Packet capture taken on the client side is below.

Client: 10.42.2.183
EMQX: 10.43.247.45

The summary is that no single packet is larger than a couple dozen Kilobytes (Largest single packert is roughly 20KB). Entire TCP conversation is only 100-200KB total.

Thoughts on how I can debug further?

Screenshot 2024-02-18 at 08 35 46

from emqx.

zmstone avatar zmstone commented on May 30, 2024

The trace logs do not include the actual length received (this is something we can improve, we will work on a fix).

Could you share the pcap file so we can have a closer look?

Another question, are you running EMQX nodes in a cluster?
The changes made from UI applies to all nodes in the cluster, but environment variable is not shared.
You mentioned that you are setting EMQX_MQTT__MAX_PACKET_SIZE environment variable, but also changing settings from the UI.

from emqx.

SlothCroissant avatar SlothCroissant commented on May 30, 2024

I deploy EMQX in a clustered environment via the emqx-operator:

---
apiVersion: apps.emqx.io/v2beta1
kind: EMQX
metadata:
  name: emqx
spec:
  image: emqx:5.5.0
  coreTemplate:
    spec:
      replicas: 3
      env:
      - name: EMQX_MQTT__MAX_PACKET_SIZE
        value: 256MB

Does this deploy the env var to all nodes (I assume so, but sanity check)? Is there a better way to set this via the operator?

Pcap attached.

12527.pcap.zip

from emqx.

zmstone avatar zmstone commented on May 30, 2024

Thanks @SlothCroissant
I have sent a logging enhancement here: #12530 to help troubleshooting.

from emqx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.