davechallis / ocypod

Ocypod is a Redis-backed service for orchestrating background jobs. Clients/workers can be written in any language, using HTTP/JSON to queue/fetch jobs, store results, etc.
Apache License 2.0
193 stars 13 forks source link

Why patch requests keeps giving 413 after upgrade ocypod? #27

Closed 18601673727 closed 2 years ago

18601673727 commented 2 years ago

Before I upgraded docker image of ocypod, using following configuration

[queue.default]
timeout = "10m"
max_body_size = "32MiB"

everything went well, but after, giving an output payload like this:

{
  "asdf": "j567qfasdfqb",
  "bfasd1236421": "j567qfasdfqb",
  "bfasd123g6421": "j567qfasdfqb",
  "asdfasdfadsf": "j567qfasdfqb",
  "bfasdadsvb6421": "j567qfasdfqb",
  "bfasd12316421": "j567qfasdfqb",
  "bfavasdfsd6421": "j567qfasdfqb",
  "bf11asd126421": "j567qfasdfqb",
  "email": "nielsenhawkins@gronk.com",
  "phone": "+1 (960) 568-2243",
  "address": "565 Kenilworth Place, Connerton, Connecticut, 5044",
  "about": "Ad eu sint irure officia non tempor irure quis laboris. Proident amet dolor nulla exercitation labore magna nisi aliquip adipisicing. Laborum qui sit id ad voluptate exercitation cillum. Eiusmod est labore ut incididunt eu esse ea dolore. Adipisicing do ullamco anim et ad aliquip reprehenderit magna do ullamco eu sint. Consequat Lorem enim magna nisi irure aute non labore esse sint voluptate elit sunt. Labore et reprehenderit laborum eu enim culpa ullamco irure ex nostrud enim.\r\n",
  "registered": "2016-10-07T11:06:45 -08:00",
  "friends": [
    {
      "id": 0,
      "name": "Joyce Mills"
    },
    {
      "id": 1,
      "name": "Blevins Acosta"
    },
    {
      "id": 2,
      "name": "Bernadine Francis"
    }
  ]
}

It will return 413, instead of 204.

Anybody experiencing the same?

joe-at-startupmedia commented 2 years ago

I'm not experiencing the same but I do not have max_body_size specified in my config. One thing I noticed is that this value is configured at the configuration server block (not the queue block). If the value is null the default value is 1024B which is exceeded by the request you have pasted above (1.2Kb). First I would enable debug logging to ensure the value is being parsed: https://github.com/davechallis/ocypod/blob/master/src/bin/ocypod-server.rs#L60

If not try providing the value at the server block instead:

[server]
max_body_size =  "32MiB"
davechallis commented 2 years ago

Yup, @joe-at-startupmedia is correct, that setting is applied globally for all queues, and is set in the [server] section of the config.

It gets ignored when added to a specific queue's configuration (but might not be a bad idea to log a warning about that in future).

18601673727 commented 2 years ago

Thank you @joe-at-startupmedia @davechallis , put max_body_size under server section works!