Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

http response handling changes of epsagon 1.56.1 still produce runtime errors #249

Closed
tripodsan opened this issue Mar 23, 2020 · 2 comments · Fixed by #253
Closed

http response handling changes of epsagon 1.56.1 still produce runtime errors #249

tripodsan opened this issue Mar 23, 2020 · 2 comments · Fixed by #253
Labels

Comments

@tripodsan
Copy link
Contributor

even with the recent fixes of #244, we're still seeing errors with epsagon enabled, that are otherwise not a problem:

RangeError: Resource length mismatch (possibly incomplete body)
    at throwLengthMismatch (./node_modules/fetch-h2/dist/lib/body.js:17:11)
    at StreamResponse.validateIntegrity (./node_modules/fetch-h2/dist/lib/body.js:167:13)
    at awaitBuffer.then.already_1.tap.buffer 

could be caused by epsagon, consuming the chunks of the response.

@tripodsan
Copy link
Contributor Author

tripodsan commented Mar 23, 2020

see https://github.com/tripodsan/epsagon-testing/blob/f135ed185fc74b120af6e2ade7ab1ccab6501ce9/action-with-fetch/src/index.js#L30-L34

running the example shows:

> node test/run.js fetch

using fetch to download content.
Patching http2 module
instrumenting epsagon.
406
Sending trace async
Posting trace to https://us-east-1.tc.epsagon.com
Trace was filtered with ignored keys
trace: {
  "app_name": "Helix Testing",
  "events": [
    {
      "id": "4dd6eb8c5e7b0abf1bbfa66e706a2972",
      "start_time": 1584959278.971,
      "resource": {
        "name": "/tripod/epsagon-testing@1.0.2",
        "type": "openwhisk_action",
        "operation": "invoke",
        "metadata": {
          "activation_id": "4dd6eb8c5e7b0abf1bbfa66e706a2972",
          "api_host": "https://runtime.adobe.io",
          "namespace": "tripod",
          "transaction_id": "922c0cea7c3823035b82225f00b9f36e",
          "params": {}
        }
      },
      "origin": "runner",
      "duration": 10.63,
      "error_code": 2,
      "exception": {
        "type": "RangeError",
        "message": "Resource length mismatch (possibly incomplete body)",
        "traceback": "RangeError: Resource length mismatch (possibly incomplete body)\n    at throwLengthMismatch (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:17:11)\n    at StreamResponse.validateIntegrity (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:167:13)\n    at awaitBuffer.then.already_1.tap.buffer (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:81:52)\n    at ./epsagon-testing/action-with-fetch/node_modules/already/dist/index.js:63:15\n    at process._tickCallback (internal/process/next_tick.js:68:7)",
        "time": 1584959289.601,
        "additional_data": {
          "handled": true
        }
      }
    },
    {
      "id": "http-aebe9132-1bc6-4146-adf4-65493573976d",
      "start_time": 1584959279.669,
      "resource": {
        "name": "adobeioruntime.net",
        "type": "http",
        "operation": "GET",
        "metadata": {
          "status": 406,
          "http_trace_id": "d79ca21dfeba4251817e6ad4f502d688:b3910c2d9b9f6098:b0cb72ea63492206:1",
          "path": "/api/v1/web/helix/helix-services/word2md@v1?path=%2Fen%2Farchive%2F2020%2Fshare-like-a-boss.docx&shareLink=https%3A%2F%2Fadobe.sharepoint.com%2Fsites%2FTheBlog%2FShared%2520Documents%2Ftheblog&rid=VqNCOOblZXzBlnpLTvgG39uWoAIrGDWF&src=adobe%2Ftheblog%2Fdd25127aa92f65fda6a0927ed3fb00bf5dcea069",
          "url": "https://adobeioruntime.net/",
          "request_headers": {
            "connection": "keep-alive",
            "epsagon-trace-id": "d79ca21dfeba4251817e6ad4f502d688:b3910c2d9b9f6098:b0cb72ea63492206:1",
            "host": "adobeioruntime.net",
            "accept": "application/json",
            "user-agent": "helix-fetch",
            "accept-encoding": "br;q=1, gzip;q=0.8, deflate;q=0.5"
          },
          "response_headers": {
            "content-type": "application/json",
            "date": "Mon, 23 Mar 2020 10:28:09 GMT",
            "strict-transport-security": "max-age=7884000; includeSubDomains",
            "x-content-type-options": "nosniff",
            "x-frame-options": "deny",
            "x-request-id": "cKMrhyyytj6r9xgqEp2mga0QHzktndoh",
            "x-xss-protection": "1; mode=block",
            "content-length": "140",
            "connection": "keep-alive"
          },
          "response_body": {
            "code": "cKMrhyyytj6r9xgqEp2mga0QHzktndoh",
            "error": "Resource representation is only available with these types:\ntext/plain; charset=UTF-8"
          }
        }
      },
      "origin": "http",
      "duration": 9.924,
      "error_code": 0,
      "exception": {}
    }
  ],
  "exceptions": [],
  "version": "1.57.2",
  "platform": "node 10.18.0"
}
filtered blacklist hostname us-east-1.tc.epsagon.com
Trace posted!
RangeError: Resource length mismatch (possibly incomplete body)
    at throwLengthMismatch (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:17:11)
    at StreamResponse.validateIntegrity (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:167:13)
    at awaitBuffer.then.already_1.tap.buffer (./epsagon-testing/action-with-fetch/node_modules/fetch-h2/dist/lib/body.js:81:52)
    at ./epsagon-testing/action-with-fetch/node_modules/already/dist/index.js:63:15
    at process._tickCallback (internal/process/next_tick.js:68:7)
{ statusCode: 500 }

@ranrib
Copy link
Member

ranrib commented Mar 31, 2020

🎉 This issue has been resolved in version 1.58.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants