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

MJML server received too many data error firing and not sure why #63

Closed
benjamindell opened this issue Oct 6, 2018 · 9 comments
Closed

Comments

@benjamindell
Copy link

Hi. I'm not sure if this is due to me running python3 and the latest Django but when i try and send an email the following lines are triggered in tcpserver.js

} else if (total_data.length > data_size) {
            result = 'MJML server received too many data';
            conn.write('1');
        } else {

I'm guessing the check here is simply to see if data sizes match? I was racking my brains as to how to resolve this but couldnt come up with anything. So i have just commented out that condition and the emails are now sending.

So firstly - have I created a bigger issue by letting this error go unchecked? And secondly, do you have any ideas how I should fix this?

Thanks!

@liminspace
Copy link
Owner

@benjamindell do you use latest version of django-mjml? This checking is important because tcp-server can receive data by several portions. It works well in Python 3.6.
Tell me about your environment: OS, python version, django-mjml version, how you run tcpserver, email's size you try to send, encoding your template file etc.

@benjamindell
Copy link
Author

Hey, sorry for the delay in replying. Just checking versions etc now.

So we have django-mjml 0.5.3 - is that the latest version?

In terms of our environment:

OS: Ubuntu 18.04.1 LTS
Python: 3.6.6
django-mjml: 0.5.3
mjml-core: 4.2.0-beta.3
mjml-cli: 4.2.0-beta.3

We run tcpserver via a supervisor conf - using the exact same structure and params as the example one you provide in the readme. The emails we send might be slightly larger than usual, due to images in there etc, but nothing too crazy.

Is there anything else you need me to check at this stage?

Thanks 🙌

@liminspace
Copy link
Owner

liminspace commented Oct 9, 2018

@benjamindell
I don't have any idea why you get this problem, I am not at my work laptop these weeks and can't check it.
Try to check that your templates is utf-8 and write here the size of data which is sent to tcpserver.
Also try to test small emails.
If you send images inside email check if you encode them into base64.

@benjamindell
Copy link
Author

Cool thanks Igor. I'll check it out.

@liminspace
Copy link
Owner

I closed this issue. If you still have some problems, you can reopen it.

@danihodovic
Copy link

danihodovic commented Jun 18, 2019

I'm having the same issue. Is there any way to run the mjml server in debug mode?

If you send images inside email check if you encode them into base64.

Why do images need to be base64 encoded?

Update: it seems to be related to emails that contain emojis...

@danihodovic
Copy link

danihodovic commented Jun 18, 2019

Email with the characters 🍭🍭 and 🌎 caused this error for me.

@liminspace liminspace reopened this Jun 18, 2019
@liminspace
Copy link
Owner

Thanks, I'll try to fix this issue at this week.

@liminspace
Copy link
Owner

The problem has been fixed in 0.8.0 version.

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