h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing

Home Page:https://fly.io/docs/app-guides/run-a-global-image-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to debug error 400 ?

Pix13 opened this issue · comments

commented

Hi,

I plugged Nexcloud 24 to an imaginary instance, but i only have errors 400 when it uses it, and the there is not much logs with DEBUG=*

2022/09/22 10:47:48 FreeOSMemory()
xx.xx.xx.xx - - [22/Sep/2022 08:48:05] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22smartcrop%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%7D%7D%5D HTTP/1.1" 400 41 29.9951
xx.xx.xx.xx - - [22/Sep/2022 08:48:05] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22smartcrop%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%7D%7D%5D HTTP/1.1" 400 41 29.9974

Is there a way to have an even more verbose output to understand what's wrong with the paylod of the POST ?

commented

( issue was that nextcloud was sending garbage)

Do you mind sharing how you identified that NC was sending garbage? I'm seeing 403's in my logs but am not sure where to start looking.

commented

Do you mind sharing how you identified that NC was sending garbage? I'm seeing 403's in my logs but am not sure where to start looking.

I compared the logs of the test suite of imaginary with those of the nextcloud requests, used the inspector on chrome to see the payloads, and finally figured out that imaginary received data that it could not probe as pictures, because i had server-side encryption on nextcloud.. and that nextcloud, in its infinite wisdom, was sending the encrypted pictures to imaginary. Had to un-encrypt my whole dataset