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

Mempool Summary Page times out #127

Closed
sangaman opened this issue May 15, 2019 · 9 comments
Closed

Mempool Summary Page times out #127

sangaman opened this issue May 15, 2019 · 9 comments
Labels

Comments

@sangaman
Copy link
Contributor

Describe the bug
Going to the mempool page fails with ESOCKETTIMEDOUT (once I saw a 504 Gateway error, although I haven't seen it since).

Environment (please complete the following information):

  • bitcoind 0.18.0
  • node 10.15.3
  • Firefox
  • Commit 256b465

To Reproduce
Go to the mempool summary page.

Screenshots or Log Output

/home/bitcoin/btc-rpc-explorer/views/mempool-summary.pug:22
    20| 					tr
    21| 						td(class="properties-header") Transaction Count
  > 22| 						td #{getmempoolinfo.size.toLocaleString()}
    23| 
    24| 					tr
    25| 						- var mem1Data = utils.formatLargeNumber(getmempoolinfo.usage, 2);

Cannot read property 'size' of undefined

TypeError: /home/bitcoin/btc-rpc-explorer/views/mempool-summary.pug:22
    20| 					tr
    21| 						td(class="properties-header") Transaction Count
  > 22| 						td #{getmempoolinfo.size.toLocaleString()}
    23| 
    24| 					tr
    25| 						- var mem1Data = utils.formatLargeNumber(getmempoolinfo.usage, 2);

Cannot read property 'size' of undefined
    at eval (eval at wrap (/home/bitcoin/btc-rpc-explorer/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:690:72)
    at template (eval at wrap (/home/bitcoin/btc-rpc-explorer/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:2275:72)
    at Object.exports.renderFile (/home/bitcoin/btc-rpc-explorer/node_modules/pug/lib/index.js:427:38)
    at Object.exports.renderFile (/home/bitcoin/btc-rpc-explorer/node_modules/pug/lib/index.js:417:21)
    at exports.__express (/home/bitcoin/btc-rpc-explorer/node_modules/pug/lib/index.js:464:11)
    at View.app.engine (/home/bitcoin/btc-rpc-explorer/app.js:61:23)
    at View.render (/home/bitcoin/btc-rpc-explorer/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/bitcoin/btc-rpc-explorer/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/bitcoin/btc-rpc-explorer/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/bitcoin/btc-rpc-explorer/node_modules/express/lib/response.js:1008:7)
    at /home/bitcoin/btc-rpc-explorer/routes/baseActionsRouter.js:175:7
@sangaman sangaman added the bug label May 15, 2019
@tyzoo
Copy link

tyzoo commented May 17, 2019

I also have experienced this on Mempool and Unconfirmed Tx Pages.

I tested on chaintools.io and same issue. Mempool page never loads, Unconfirmed Tx page loads with error:

image

btcexp:error Error 38eh39hdee: Error: ESOCKETTIMEDOUT, json: {"cause":{"code":"ESOCKETTIMEDOUT","connect":false},"isOperational":true,"code":"ESOCKETTIMEDOUT","connect":false}, userData: [object Object] (json: {}) +5s
btcexp:error Stack: Error: ESOCKETTIMEDOUT
btcexp:error at ClientRequest. (\node_modules\request\request.js:816:19)
btcexp:error at Object.onceWrapper (events.js:273:13)
btcexp:error at ClientRequest.emit (events.js:182:13)
btcexp:error at Socket.emitRequestTimeout (_http_client.js:668:40)
btcexp:error at Object.onceWrapper (events.js:273:13)
btcexp:error at Socket.emit (events.js:182:13)
btcexp:error at Socket._onTimeout (net.js:452:8)
btcexp:error at listOnTimeout (timers.js:324:15)
btcexp:error at processTimers (timers.js:268:5) +0ms
btcexp:app Unhandled Rejection at: Promise Promise {
{ Error: ESOCKETTIMEDOUT
at ClientRequest. (\node_modules\request\request.js:816:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at Socket.emitRequestTimeout (_http_client.js:668:40)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at Socket._onTimeout (net.js:452:8)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5)
cause:
{ Error: ESOCKETTIMEDOUT
at ClientRequest. \node_modules\request\request.js:816:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at Socket.emitRequestTimeout (_http_client.js:668:40)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at Socket._onTimeout (net.js:452:8)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5) code: 'ESOCKETTIMEDOUT', connect: false },
isOperational: true,
code: 'ESOCKETTIMEDOUT',
connect: false } } reason: { Error: ESOCKETTIMEDOUT
at ClientRequest. (\node_modules\request\request.js:816:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at Socket.emitRequestTimeout (_http_client.js:668:40)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at Socket._onTimeout (net.js:452:8)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5)
cause:
{ Error: ESOCKETTIMEDOUT
at ClientRequest. (\node_modules\request\request.js:816:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at Socket.emitRequestTimeout (_http_client.js:668:40)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at Socket._onTimeout (net.js:452:8)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5) code: 'ESOCKETTIMEDOUT', connect: false },
isOperational: true,
code: 'ESOCKETTIMEDOUT',
connect: false } stack: Error: ESOCKETTIMEDOUT
at ClientRequest. (\node_modules\request\request.js:816:19)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:182:13)
at Socket.emitRequestTimeout (_http_client.js:668:40)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at Socket._onTimeout (net.js:452:8)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5) +1ms

@tyzoo
Copy link

tyzoo commented May 20, 2019

Seems to be working now, on both my local node and Chaintools

Probably had something to do with Bitcoin Core

@sangaman
Copy link
Contributor Author

sangaman commented May 20, 2019

It still does not work for me. The page hung for a minute or two and eventually gave me a 504 error gateway timeout. Other things like checking an address or transaction still work.

Edit: Same with the unconfirmed transaction page.

@tyzoo
Copy link

tyzoo commented May 20, 2019

Confirming that it is not working again on my end. I still think this has something to do with Bitcoin Core

@Relaxo143
Copy link

It happens when the mempool is too full. You need to increase the timeout time in the config of btc-rpc-explorer. I think the default is 5000ms. I changed it to 10 000 and it`s working now.

@sangaman
Copy link
Contributor Author

sangaman commented Jun 3, 2019

Maybe the scope of these calls should be limited to prevent the page load from taking so long. getmempoolinfo returns almost immediately even with a decently sized mempool. For unconfirmed transaction for example it shouldn't try to load every unconfirmed transaction at once (if that's what it's doing).

@mercurytoxic
Copy link

mercurytoxic commented Jun 17, 2019

Changed timeout to 10000 and then to 20000 and still showing the same timeout behavior on mempool and unconfirmed transactions pages. Current mempool is around 48000.

Edit: A day later with a mempool of 12000 works fine.

@sangaman
Copy link
Contributor Author

Just bumping to say that I'm still noticing this issue, currently getting 504 Gateway Time-out in my browser and

Unhandled Rejection at: Promise Promise {
  <rejected> { Error: ESOCKETTIMEDOUT
      at ClientRequest.<anonymous> (/home/bitcoin/btc-rpc-explorer/node_modules/request/request.js:816:19)
...

in the debug output. Mempool is currently around 25k transactions and 16MB.

@janoside
Copy link
Owner

janoside commented Oct 1, 2019

Too long for this to get fixed, but today's large mempool provided some inspiration at the right moment when I had some bandwidth to spare. Please enjoy this long-overdue improvement/bug fix.

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

No branches or pull requests

5 participants