I'm using Insomnia for an API developed in Node.js with the help of Sails.js. After every single deployment to our production system, randomly endpoints are throwing the error 400. That鈥檚 an error - Your client has issued a malformed or illegal request. That鈥檚 all we know..
The failing endpoints are not always the same, and if I compare the local request headers and responses from staging and production, there's no difference to find at all.
Here's a copy of the request timeline with sensitive information blanked:
* Preparing request to http://******/movies
* Using libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
* Disable timeout
* Enable automatic URL encoding
* Enable SSL validation
* Enable cookie sending with jar of 0 cookies
* Hostname ****** was found in DNS cache
* Trying *****...
* TCP_NODELAY set
* Connected to ***** (*****) port 80 (#22)
> GET /movies HTTP/1.1
> Host: *****
> User-Agent: insomnia/6.4.2
> x-access-token: ******
> Content-Type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
> Accept: */*
> Content-Length: 25
| --X-INSOMNIA-BOUNDARY--
* We are entirely uploaded and fine
* HTTP 1.0, assume close after body
< HTTP/1.0 400 Bad Request
< Content-Type: text/html; charset=UTF-8
< Referrer-Policy: no-referrer
< Content-Length: 1555
< Date: Tue, 07 May 2019 19:02:46 GMT
* Received 1551 B chunk
* Closing connection 22
It's a Google error, at least that's how it's rendered within the response preview in Insomnia, and I'm hosting the API within Google Cloud via Kubernetes.
The only difference between my local development and the deployment on staging or production is the NGINX server in between to upstream the express.js server.
It's probably not an Insomnia issue, but maybe you've experienced something similar and have some tips for me to resolve the issue.
馃憢 Thanks for opening your first issue! If you're reporting a 馃悶 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 馃巵, please provide real
use cases that would benefit. 馃應
To help make this a smooth process, please be sure you have first read the
contributing guidelines.
Are you sending an empty Multipart form on purpose? That looks suspicious
Sent with GitHawk
@gschier Damn, you're right!!!!!
After 16 hours of programming, I didn't notice that. Thank you so much.
Changing it to No Body fixed the issue!!!!!
Cheers
Hehe, sometimes you just need another set of eyes 馃槃
That is so true :D
The cause of the issue was simply my stupidity by cloning existing endpoints and changing the request method, but not how I want to send the data, damn.
Cheers
Most helpful comment
That is so true :D
The cause of the issue was simply my stupidity by cloning existing endpoints and changing the request method, but not how I want to send the data, damn.
Cheers