How to increase Postman Client request timeout - postman

I am requesting an API from postman and getting response after 2 minutes, which is fine because the business logic is complex. But the problem is that postman is giving
502 Bad Gateway
After that, I checked the business logic and found that it successfully executed without any error.
So my concern is how to increase the request time.

What version of postman do you use?
In version 4.1.3 I have XHR Timeout(ms) which means :
Set how long the app should wait for a response before saying that the server isn't responding.
Settings -> general ->XHR Timeout(ms)

For POSTMAN client new version go to
Settings-->General-->Request timeout in ms (0 for infinity)

XHR Timeout(ms)
Set how long the app should wait for a response before saying that the server isn't responding.
Go to settings -> general ->XHR Timeout(ms) set it to 120000

Request timeout setting option in the latest version v10.8.1

Related

Canceling multiple HTTP/2 requests leads to unrecoverable connection timeouts

I have a native iOS app that loads multiple videos from AWS cloudfront via HTTP/2 requests. If the user skips to the next video, I cancel the request and start the new one.
After some cancels I get timeouts for the following requests and the connection seems to be unrecoverably broken.
edit
CloudFront monitoring shows only 200 responses – so no errors/timeouts are reported.
Using Charles Proxy for debugging shows new requests but they never receive any data ...
edit end
To check if this is a iOS problem or not, I rebuilt the same logic in NodeJS (using got) and ran into the same problems. So it's not iOS-related.
When using axios (which only supports HTTP/1.1) for doing the actual requests in Node, everything worked as expected.
So I tried and disabled HTTP/2 for my cloudfront distribution and after that the iOS implementation also worked.
Is this a known problem with HTTP/2? That canceling requests can lead to timeouts? I tried searching the web/SO but couldn't find anything helpful.
How can I get this to work with HTTP/2? Or should I just keep using HTTP/1.1?

django 2FA with yubikey creates wsgi error in login: Timeout when reading response headers from daemon process

Usual 2FA first requires to type your password and then the yubikey token, either when setting it up or when it is already set. I'm using this code (for simplicity I'm not changing anything on it): https://github.com/jazzband/django-two-factor-auth
When i have to type the yubikey token, i.e., press the yubikey, the information is sent to the database but in the client side the process is not finished (page doesn't go to the next step and browser shows the loading icon but nothing happens until gateway timeout).
Nothing works, what I see is that my mysql processlist goes idle (sleep)
after the token is typed so it makes me think that the connection with the database is ok. The same code in my localhost with the lightweight django server works fine but in my apache server I have this issue.
How could I track down the problem? the error log only says wsgi error, Timeout when reading response headers from daemon process.
In my localhost this step gives a 302 response (it works. I believe 302 response is ok with the yubikey). In the apache server is 504 (Gateway timeout).
Any help is appreciated

Flask API, browser requests stopped working, no log the request was received

I have a very simple flask app that has been working for years, but last week requests from the built app return a 500, and from the Flask side, I can't even see the request. I am not seeing an OPTIONS request.
The below lines worked previously to keep CORS happy.
#app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization,Auth-Token')
response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
return response
I have tried in a few browsers and all of them fail to successfully make any requests. Since the server doesn't even acknowledge the request has been made, I am not sure where to trouble shoot. I did confirm the app returns data as expected when I use Postman to make the request, as well as confirming that if I use the app locally (gulp serve on my computer) that the requests are successful. I have to believe its CORS, but what might I have to add / do to get the browser to be happy? Thanks.
The solution to my problem was that chrome started to "restrict the ability of websites to communicate with devices on the local network"
Communicating from Chrome 94+ with LAN devices that do not support HTTPS from a web app

Is there a workaround for Postman's bug when content is returned with a 204?

Using Postman, when I make a PUT request to an endpoint which returns a 204 with content, Postman is unable to parse the response, and my collection runner stops that iteration, indicating that an error has occurred.
When run outside of the runner, Postman displays the following:
Other people have also had this problem
Unfortunately I cannot fix the non-standard endpoint. Is there a workaround that will let Postman continue without throwing an error, especially when using the collection runner?
The 204 (204 NO CONTENT) response from the server means that the server processed your request successfully and a response is not needed.
More here: https://httpstatuses.com/204
Actually as much as I know, if the server is sending a 204 with a payload response, the endpoint is not developed as it should.
This would be the main reason Postman is not showing a response payload. You will only be able to read response headers.
So if you send a PUT request, and only receive headers, it means everything is ok. If you spect data the server should be responding with a 200 code.
Now, said this, if postman is telling you that “it could not get any response” it means basically the server is not responding any thing. Now try to increase the timeout in the postman settings. It’s very probable that the server is taking to much time. Check outside the runner how much time it’s taking to response.
I hope this helps you.

504 gateway timeout django site with nginx+fastcgi

we added ability for admin users to change server date&time through the portal. Changing the date&time back is working fine, but changing forward(more than fastcgi_read_timeout) is returning '504 gateway timeout' even though server time successfully changed behind the scenes.
Please advice how to handle this?
Thanks.
I had a very similar issue with another project. Maybe it is best to submit the date&time credentials (I assume you would be using NTP servers IPs to do this) through the portal asynchronously via a JavaScript AJAX request. Then, let the server then do its thing with the date&time.
Meanwhile, have the client side JavaScript, continuously probe the server with interval AJAX requests (perhaps every 5 seconds) to get back a response message on the server time. That way, each subsequent AJAX request initiates a new Nginx session and if the first fails/timeouts, then try a second time, if that fails, then try a third time, and so on.
This worked on our system. However, I do not know if your product has login/authentication credentials. If it does, then the user may have to log back in once all set and done because a change in time may also expire their log-in session. I don't think this is such a big deal though because theoretically they should only need to change the date/time once in a while if not just one time only. So it shouldn't have too much of an impact on the user experience.
tags: nginx, NTP, timeout, 504