Heroku Request blocked - heroku

in my application (deployed in Heroku), there is a request (GET) that is blocked in the infrastructure layer, the request does not get to execute the code of my application. It returns an error status=400 and connect=0ms and does not carry any associated Heroku error code and description. The request never reaches the application.
It only happens with this GET request, when it comes from the production server. if I make the request from postman it is received correctly with status=200
The other requests have not problem and are executed correctly from the production server.
This is an example:
2021-08-20T10: 27: 02.217551 + 00: 00 heroku [router]: at=info method=GET path="/api/get" host=myapp.herokuapp.com request_id=2920634e-87f2-4b2c-be60-b38497c53e58 dyno=web.1 connect=0ms service=1ms status=400 bytes=47 protocol=https

The problem was identified and corrected.
The problem was that one of the headers of the GET request was being sent to null and the request was rejected as Bad Request Exception before entering the APP.
regards

Related

Django rest backend deployed well on Heroku but when viewing site got Application Error with the given below log errors

I have deployed Django REST FRAMEWORK APP on Heroku deployed successfully but but when viewing site got Application Error with the given below log errors
Stopping all processes with SIGTERM,
State changed from starting to up and down,
at=error code=H12 desc="Request timeout" method=GET path="/"
dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https

MeteorJS high response time on Heroku

I am running a Meteor app on Heroku and the Heroku response time chart is constantly filled with high response time queries hitting 30 seconds limit
The router logs shows that all the 30 seconds queries are some kind of sockJS xhr call
14 Aug 2021 11:37:33.249334 <158>1 2021-08-14T03:37:32.837295+00:00 heroku router - - at=info method=POST path="/sockjs/950/pwiv10fk/xhr" host=www.abc.com request_id=edbe326a-cddd-4e5e-9347-0f5c1c49651b fwd="121.6.80.103,162.158.165.53" dyno=web.1 connect=0ms service=29493ms status=200 bytes=384 protocol=httpHigh Response Time
14 Aug 2021 11:37:33.358335 <158>1 2021-08-14T03:37:32.837093+00:00 heroku router - - at=info method=POST path="/sockjs/707/7haw05h4/xhr" host=www.abc.com request_id=20ca52a2-5aa4-43fa-bb61-39462eb0ab86 fwd="121.6.80.103,162.158.167.169" dyno=web.1 connect=0ms service=29484ms status=200 bytes=384 protocol=httpHigh Response Time
14 Aug 2021 11:38:03.405335 <158>1 2021-08-14T03:38:02.836998+00:00 heroku router - - at=info method=POST path="/sockjs/950/pwiv10fk/xhr" host=www.abc.com request_id=f3a51bc3-9319-4b80-91b5-ed76bf179493 fwd="121.6.80.103,162.158.166.136" dyno=web.1 connect=0ms service=29480ms status=200 bytes=384 protocol=httpHigh Response Time
The reality is that there is only a few users on the app, and no unusual activity happening on server. Actually the users did not experience slow down as well, so i suspect, the socket connections mechanisms on Meteor app is polluting the heroku response time charts, I also have to turn off slow response time alerts because they are too many.
These non-stops 30 seconds response times calls creates a problem which I do not really know the true speed of the web app.
What is happening and how to avoid this?
It seems that the issue was introduced by Cloudflare. They seem to have been interrupting the websocket connections, causing Meteor to fall back to polling, which is not efficient.

Heroku throws an error when retrieving JSON response with 40 elements

So I have an app deployed in Heroku, a Go backend with Angular 8 frontend using Hobby dinos. But today I noticed that one of my endpoints would not work if the result contains more than 40 elements. I tested this locally and this doesnt happen locally, so it must be a problem when running in Heroku. Any idea about what is going on here? Heroku throws the following error message:
sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/invoices/g/range?from=2020-08-01T00:00:00.000+00:00&to=2020-08-28T00:00:00.000+00:00" host=xxx-prod.herokuapp.com request_id=d113ba1c-f51a-4f57-8f02-31195da1b5f8 fwd="xx.xxx.xxx.xxx" dyno=web.1 connect=1ms service=60ms status=503 bytes= protocol=https
So I finally figured out what was going on here. It has to do with an unsolved Node issue, see: https://github.com/nodejs/node/issues/12339
When using the POST handler I was receiving a large response that triggered that Issue. What I did is I rebuilt my logic in order to retrieve the response using a GET. Now it works as expected.

Heroku - prevent scraping

I am looking on my drain log and I see this
327 <158>1 2018-04-17T22:03:27.578702+00:00 heroku router - - at=info method=GET path="/{url}" host={my_host} request_id=11bb9b05-dea3-42c2-b57a-9be6fb9b93d2 fwd="80.6.26.72,141.101.107.25" dyno=web.1 connect=0ms service=1ms status=200 bytes=6265 protocol=http
I am certain that this request doesn't come from a legit user, how is it possible to dig in more and get the remote server IP? I used https://stackoverflow.com/a/6837689/2513428 inside my script to check the ip's but I assume it returned the proxy of herocu servers.
Heroku makes the IP making the request available in the fwd log field: https://devcenter.heroku.com/articles/http-routing#heroku-router-log-format
You can also read it within your code by looking at the X-Forwarded-For HTTP header.
So in your case, the IP of the client making this request was 80.6.26.72.

Proximo Heroku addon is timing out

I have a simple node proxy that I have added proximo to use whitelisting for an API. It worked before, but having followed the tutorial I now get this in my logs:
2014-08-19T16:23:21.376311+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/?url=http://www.google.com" host=warm-cliffs-7633.herokuapp.com request_id=ecf77eea-a027-4115-86ff-5acf527c7333 fwd="82.24.137.140" dyno=web.1 connect=1ms service=30001ms status=503 bytes=623
If I try to access the page, I get an error message, but the page works fine if no URL is requested from the proxy.
There isn't very much documentation and I'm not sure if this is right in my Procfile:
web: bin/proximo node proxy.js

Resources