Skip to content

Request closed without response #1896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
steven-supersolid opened this issue May 24, 2016 · 5 comments
Closed

Request closed without response #1896

steven-supersolid opened this issue May 24, 2016 · 5 comments

Comments

@steven-supersolid
Copy link
Contributor

steven-supersolid commented May 24, 2016

Issue Description

We're seeing Heroku error reports of requests being closed with no response aka H13. https://devcenter.heroku.com/articles/error-codes#h13-connection-closed-without-response

This error is thrown when a process in your web dyno accepts a connection, but then closes the socket without writing anything to it.

To try and track down the issue I added some debug logging to my index.js

    app.use(function(req, res, next) {
        var startTime = Date.now();

        res.on('close', function() {
            var duration = Date.now() - startTime;
            console.error('response closed duration=', duration + 'ms', 'statusCode=', res.statusCode, req.method, req.url, 'headers=', req.headers, 'body=', req.body);
        });
        next();
    });

Logs/Trace

response closed duration= 55059ms statusCode= 200 POST /functions/MyCloudCodeFunction headers= { host: 'myapp.herokuapp.com', 
May 24 18:05:27 myapp app/web.14:   connection: 'close', 
May 24 18:05:27 myapp app/web.14:   'x-parse-application-id': 'abc', 
May 24 18:05:27 myapp app/web.14:   'x-parse-app-display-version': 'com.myapp', 
May 24 18:05:27 myapp app/web.14:   'x-unity-version': '5.3.4f1', 
May 24 18:05:27 myapp app/web.14:   'x-parse-windows-key': '123', 
May 24 18:05:27 myapp app/web.14:   'x-parse-installation-id': 'abc', 
May 24 18:05:27 myapp app/web.14:   'x-parse-os-version': 'asus ASUS_T00F', 
May 24 18:05:27 myapp app/web.14:   'x-parse-revocable-session': '1', 
May 24 18:05:27 myapp app/web.14:   'content-type': 'application/json', 
May 24 18:05:27 myapp app/web.14:   'x-parse-session-token': 'r:123', 
May 24 18:05:27 myapp app/web.14:   'x-parse-client-version': 'net-unity1.7.0.0', 
May 24 18:05:27 myapp app/web.14:   'x-parse-app-build-version': '0.14.3', 
May 24 18:05:27 myapp app/web.14:   'user-agent': 'Dalvik/1.6.0 (Linux; U; Android 4.4.2; ASUS_T00F Build/KVT49L)', 
May 24 18:05:27 myapp app/web.14:   'accept-encoding': 'gzip', 
May 24 18:05:27 myapp app/web.14:   'x-request-id': 'abc', 
May 24 18:05:27 myapp app/web.14:   'x-forwarded-for': '123.456.78.90', 
May 24 18:05:27 myapp app/web.14:   'x-forwarded-proto': 'https', 
May 24 18:05:27 myapp app/web.14:   'x-forwarded-port': '443', 
May 24 18:05:27 myapp app/web.14:   via: '1.1 vegur', 
May 24 18:05:27 myapp app/web.14:   'connect-time': '0', 
May 24 18:05:27 myapp app/web.14:   'x-request-start': '1464113072065', 
May 24 18:05:27 myapp app/web.14:   'total-route-time': '0', 
May 24 18:05:27 myapp app/web.14:   'content-length': '1937' } body= {} 

I don't have any more info yet but could the client be sending the body as compressed? It seems there is some content due to the content-length but body is displayed as empty.

All of the errors of this type have a duration of ~55s

Environment Setup

  • Server
    • parse-server version: 2.2.7
    • Operating System: Ubuntu 14.04
    • Hardware: performance-l
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
  • Database
    • MongoDB version: 3.09
    • Storage engine: MMAPv1
    • Hardware: High Performance
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab
@steven-supersolid
Copy link
Contributor Author

By examining the logs I've realised that this code is actually catching Heroku H27 and H28 errors, which explains the 55 seconds timeout for the H28's: https://devcenter.heroku.com/articles/http-routing#timeouts.

Going back to the drawing board on this one.

@drew-gross
Copy link
Contributor

Thanks for the update. Let me know if you find anything we can help with.

@steven-supersolid
Copy link
Contributor Author

Digging a bit deeper, a typical log looks like the following:
May 27 21:43:38 myapp heroku/router: at=error code=H13 desc="Connection closed without response" method=CONNECT path="myapp.herokuapp.com:443" host=myapp.herokuapp.com request_id=5a77307b-71b5-4841-8015-f2d9c596f117 fwd="213.213.123.123" dyno=web.7 connect=0ms service=1ms status=503 bytes=0

This looks like the client is trying to make a connect request, which is not supported by Heroku. Could this be coming from a client SDK or internal parse-server request?

@drew-gross
Copy link
Contributor

I'm not familiar enough with all of our SDKs to say. It could also be a random crawler on the web, or someone probing your app for vulnerabilities.

@ryderjack
Copy link

Any more news on this? I'm seeing this log when I'm calling a cloud function from the iOS SDK to send a push notification - I'm also using Heroku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants