# Json\_decode\_html size limit - Twig template

**URL:** https://forum.mautic.org/t/json-decode-html-size-limit-twig-template/23588
**Category:** Product Support
**Tags:** mautic-3, mautic-4
**Created:** [April 5, 2022, 2:22pm UTC](https://forum.mautic.org/t/json-decode-html-size-limit-twig-template/23588 "2022-04-05T14:22:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![juanlugo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/juanlugo/32/6981_2.png) [@juanlugo](https://forum.mautic.org/u/juanlugo)
#### Post date: [April 5, 2022, 2:22pm UTC](https://forum.mautic.org/t/json-decode-html-size-limit-twig-template/23588/1 "2022-04-05T14:22:43Z")

</div>

**Your software**  
My Mautic version is: v4.1.2  
My PHP version is: PHP Version 7.4.26  
My Database type and version is: Ver 15.1 Distrib 10.5.13-MariaDB, for debian-linux-gnu (x86\_64) using readline 5.2

**Your problem**  
My problem is:

I have been using twig templates in my emails to access the data sent in the body via POST request.

I use the function “json\_decode\_html” to achieve this, example:

{% set orderEncoded = attribute(tokens, ‘{order}’) %}  
{% set order = orderEncoded| json\_decode\_html %}

In my emails, I use the for loop to be able to map my arrays of objects without problems, but I have noticed a peculiarity and that is when my array of objects is very large, I cannot access them and I receive the error "500 Internal Server Error " when making the post request.

This only happens if I try to access the properties of the object, so it has made me think about it.

One of the conclusions I’m having is that the “json\_decode\_html” function has a limit size, but I’m not sure about it.

If anyone could help me or has had the same problem I will really appreciate it.

Thanks

These errors are showing in the log:

**NOTE: What is shown in the logs has nothing to do with my problem**

[2022-04-05 12:55:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 12:55:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 12:56:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 12:56:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 12:57:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 12:57:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 12:58:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 12:58:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 12:59:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 12:59:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:00:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:00:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:01:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:01:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:02:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:02:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:03:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:03:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:04:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:04:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:05:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:05:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:06:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:06:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:07:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:07:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:08:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:08:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:09:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:09:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:10:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:10:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:11:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:11:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:12:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:12:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:13:03] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:13:03] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1    
[2022-04-05 13:14:04] mautic.NOTICE: Symfony\Component\Console\Exception\RuntimeException: Too many arguments, expected arguments “command”. (uncaught exception) at /var/www/html/mautic/vendor/symfony/console/Input/ArgvInput.php line 172 while running console command `mautic:maintenance:cleanup`    
[2022-04-05 13:14:04] mautic.WARNING: Command `mautic:maintenance:cleanup` exited with status code 1

Steps I have tried to fix the problem:

I have performed the test using two payloads with the same structure and values, one with more repeated values than the other.

The behavior: The payload that has less content works.

---

<div class="post-metadata">

### Author: ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)
#### Post date: [April 5, 2022, 2:32pm UTC](https://forum.mautic.org/t/json-decode-html-size-limit-twig-template/23588/2 "2022-04-05T14:32:51Z")

</div>

Hey, @kuzmany do you have an idea, what the solution is?  
Thx.
