bitpay / bitcore-wallet-service

A multisig, HD Bitcoin and Bitcoin Cash wallet service. Used by Copay.
https://copay.io/
MIT License
617 stars 543 forks source link

Error after closing out Copay #537

Closed dabura667 closed 6 years ago

dabura667 commented 7 years ago

I installed latest bitcore, bitcore-node, bws etc.

I reindexed blockchain

Now every time I open Copay and then close it, bitcored crashes.

ERR! /v1/pushnotifications/subscriptions/ :HPE_INVALID_CONSTANT:Parse Error 
[2016-07-11T03:06:35.173Z] error: uncaught exception: [RangeError: Invalid status code: 0]
[2016-07-11T03:06:35.181Z] error: RangeError: Invalid status code: 0
    at ServerResponse.writeHead (_http_server.js:192:11)
    at ServerResponse.writeHead (/home/jona/mynode/node_modules/bitcore-wallet-service/node_modules/morgan/node_modules/on-headers/index.js:55:19)
    at ServerResponse._implicitHeader (_http_server.js:157:8)
    at ServerResponse.OutgoingMessage.end (_http_outgoing.js:573:10)
    at ServerResponse.send (/home/jona/mynode/node_modules/bitcore-wallet-service/node_modules/express/lib/response.js:205:10)
    at ServerResponse.json (/home/jona/mynode/node_modules/bitcore-wallet-service/node_modules/express/lib/response.js:250:15)
    at returnError (/home/jona/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:100:31)
    at /home/jona/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:569:25
    at Request._callback (/home/jona/mynode/node_modules/bitcore-wallet-service/lib/server.js:2952:12)
    at self.callback (/home/jona/mynode/node_modules/bitcore-wallet-service/node_modules/request/request.js:200:22)
matiu commented 7 years ago

HPE_INVALID_CONSTANT seems to be an error on the lower layer TCP parsing:

Googling around found:

http://stackoverflow.com/questions/19009182/uncaught-exception-error-in-nodejs-for-get-call and https://www.bountysource.com/issues/1397159-http-hpe_invalid_constant-parse-error-if-connect-response-contains-body

We need to check we are sending content-size:0 if not body is sent in the request.

dabura667 commented 7 years ago

It could be that I don't have push notifications configured on my BWS, but my Copay has push notifications enabled from when I was using bitpay BWS.

matiu commented 7 years ago

I dont think is related to the URI handler itself, but pre processing by express/nodejs.