Yves payload too large

ivan-jurisic
ivan-jurisic Senior Spryker developer Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello, when I try to upload file bigger than 1MB I get an error on Yves side that the Payload is too large. Where that can be configured?

Tagged:

Answers

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 60 πŸ› - Council (mod)

    By default is 128M, so , it's weird that output. Could you please share where you're trying to upload the file from?

    To change the default config, open your deploy.dev.yml file and in the php image, set, for example

    image:
        tag: spryker/php:8.2
        php:
            ini:
                "upload_max_filesize": "248M"
                "post_max_size": "248M"
    

    the run docker/sdk boot deploy.dev.yml

    and docker/sdk up

  • ivan-jurisic
    ivan-jurisic Senior Spryker developer Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey Hidran, thank you for the answer.

    It is a /register route on B2B shop when new customer is registering. We added a file which is being sent in payload as binary. It's local file being uploaded.

  • ivan-jurisic
    ivan-jurisic Senior Spryker developer Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    If I try to do this ini modifications, it still throws so I guess it comes from somewhere else. I somehow feel that it is thrown already on nginx level or so, and it doesn't reach PHP at all. Interestingly it throws me failwhale even though debugging mode is on.

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 60 πŸ› - Council (mod)

    Are you working on a local environment?

    As I told you before, by default is 128M. So, it's really weird to have that response form 1Mb.

  • ivan-jurisic
    ivan-jurisic Senior Spryker developer Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 14

    I think I figured it out. It is a default value for yves and I overwrote it like this in deploy.dev.yml

    http:
    max-request-body-size: 10m

    According to the deploy file reference :

    groups: applications: application: http: max-request-body-size: - defines the maximum allowed size of the request body that can be sent to the application, in MB. If not specified, the default values apply:

    backoffice - 10m
    merchant-portal - 10m
    glue-storefront - 10m
    glue-backend - 10m
    glue - 2m
    yves - 1m

    And these values seems to be correct for me and worked after I configured it as mentioned.

  • andrej.jelinic
    andrej.jelinic Spryker Solution Partner Posts: 1 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi ivan-jurisic, can you try it like this?

    Put this on top of deploy.dev.yml file, just under the version.

    x-file-upload-limit-yves: &yves-max-file-size "40M"

    Then add this under yves_eu β†’ http

    yves_eu:
        application: yves
        http:
            max-request-body-size: *yves-max-file-size
    

    We had same issue, this helped. Just do docker/sdk boot deploy.dev.yml and docker/sdk up.

  • ivan-jurisic
    ivan-jurisic Senior Spryker developer Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey @andrej.jelinic we post it in the same minute almost :D
    Thanks. Yes, that's exactly what is solving the issue. I appreciate your help.