Skip to content

Request closed without response #1896

Closed
@steven-supersolid

Description

@steven-supersolid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions