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

escapeshellarg(): Argument exceeds the allowed length of 8192 bytes #64

Closed
eldair opened this issue Jun 22, 2020 · 7 comments
Closed

escapeshellarg(): Argument exceeds the allowed length of 8192 bytes #64

eldair opened this issue Jun 22, 2020 · 7 comments

Comments

@eldair
Copy link

eldair commented Jun 22, 2020

Hello,

I just started using the app, testing some payment webhooks and this error occurred:

PHP Fatal error:  escapeshellarg(): Argument exceeds the allowed length of 8192 bytes in phar://.../Composer/vendor/beyondcode/expose/builds/expose/vendor/namshi/cuzzle/src/Formatter/CurlFormatter.php on line 137

In CurlFormatter.php line 137:

after which the app closed.
I'm on windows using PHP7.4

@mpociot
Copy link
Member

mpociot commented Jun 22, 2020

Depending on the payload size that comes in this could happen.
You can increase the memory limit in your expose configuration file that you can publish with expose publish.

@mpociot mpociot closed this as completed Jun 22, 2020
@wouterrutgers
Copy link

wouterrutgers commented Jul 10, 2020

This isn't an issue with memory. php -r "escapeshellarg(str_repeat('a', 8000));" doesn't throw any exceptions but php -r "escapeshellarg(str_repeat('a', 9000));" does, regardless of the memory limit. Mine is set to 4gb.

A possible solution would be to check whether the $this->rawRequest exceeds 8000 characters and just return an empty string in getRequestAsCurl() if that's the case.

I wanted to try this for Github webhooks, but their payloads exceed the 8000 characters, unfortunately.

@Trashpants
Copy link

Trashpants commented Aug 13, 2020

Just to throw my hat into this - I've upped my memory to 2G (tried both 2G and 2GB) and still get this issue. using ngrok no issue at all.

PHP Fatal error:  escapeshellarg(): Argument exceeds the allowed length of 262144 bytes in phar:///Users/nash/.composer/vendor/beyondcode/expose/builds/expose/vendor/namshi/cuzzle/src/Formatter/CurlFormatter.php on line 137

In CurlFormatter.php line 137:
                                                                         
escapeshellarg(): Argument exceeds the allowed length of 262144 bytes  

Also just to add this is on MacOS

@eldair
Copy link
Author

eldair commented Aug 14, 2020

I switched to using wsl 2 and I've set memory limit to 2GB and it works fine now (for same requests)

@Trashpants
Copy link

im really puzzled as to whats happening on my machine then -

Just so im not being a complete idiot, this is the line I have in my config:

    /*
    |--------------------------------------------------------------------------
    | Maximum Allowed Memory
    |--------------------------------------------------------------------------
    |
    | The maximum memory allocated to the expose process.
    |
    */
    'memory_limit' => '1024M',

@dinamic
Copy link

dinamic commented Nov 5, 2020

Guys, this is still not working properly on mac OS. It does not seem to be affected by the memory limit setting.

~/.expose/config.php:

    'memory_limit' => '1024M',

Where's this limitation coming from? I don't understand.

In CurlFormatter.php line 137:

  escapeshellarg(): Argument exceeds the allowed length of 262144 bytes

@mpociot what's your take on this?

@markandrewkato
Copy link

markandrewkato commented Nov 20, 2020

This also happens on my mac. Checked the stack trace and it looks like an issue with the "cuzzle" package used where it fails to format large request body.

namshi/cuzzle#20

Not sure if there's a way to update the package being used.

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

6 participants