Skip to content
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

Slow responses or failures: "UnhandledPromiseRejectionWarning" in logs #148

Open
allthesignals opened this issue Jul 4, 2019 · 1 comment

Comments

@allthesignals
Copy link
Collaborator

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2190)
2019-07-04T07:14:30.762640861Z app[web.1]: (node:12) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://planninglabs.carto.com/api/v1/map reason: Unexpected token < in JSON at position 0
2019-07-04T07:14:30.762671860Z app[web.1]: at /app/node_modules/node-fetch/lib/index.js:239:32
2019-07-04T07:14:30.762679740Z app[web.1]: at
2019-07-04T07:14:30.762685290Z app[web.1]: at process._tickCallback (internal/process/next_tick.js:189:7)
2019-07-04T07:14:30.762692350Z app[web.1]: (node:12) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2192)
2019-07-04T07:16:53.746479428Z app[web.1]: (node:12) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://planninglabs.carto.com/api/v1/map reason: Unexpected token < in JSON at position 0
2019-07-04T07:16:53.746585972Z app[web.1]: at /app/node_modules/node-fetch/lib/index.js:239:32
2019-07-04T07:16:53.746601401Z app[web.1]: at
2019-07-04T07:16:53.746610628Z app[web.1]: at process._tickCallback (internal/process/next_tick.js:189:7)
2019-07-04T07:16:53.746671457Z app[web.1]: (node:12) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2194)
2019-07-04T07:17:38.989221770Z app[web.1]: (node:12) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://planninglabs.carto.com/api/v1/map reason: Unexpected token < in JSON at position 0
2019-07-04T07:17:38.989294113Z app[web.1]: at /app/node_modules/node-fetch/lib/index.js:239:32
2019-07-04T07:17:38.989311456Z app[web.1]: at
2019-07-04T07:17:38.989321816Z app[web.1]: at process._tickCallback (internal/process/next_tick.js:189:7)

@allthesignals
Copy link
Collaborator Author

We should confirm that the delay comes from some issue with Carto. Assuming this is true, it probably has to do with there being too many requests for tile templates:

ZoLa, for example, requests about 17 tile templates from Carto per request, and the API makes no effort to roll up these into a single tile template.

One possible way to address this is to have the app round up all requested sources into a single request by collating all the relevant 'source-layers' properties. This easy fix is worth investigating.

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

1 participant