Closed JulianTosh closed 6 years ago
Additionally, I'm capturing this copay crash from linux at the same moment.
chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:21
},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(this,require("buffer").Buffer)},{"./hash":48,buffer:337,inherits:46}],54:[function(require,module,exports){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=require("inherits"),SHA512=require("./sha512"),Hash=require("./hash"),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._
Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
at Object.bitcore.versionGuard (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:21:21783)
at Object.<anonymous> (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:21:21812)
at Object.r.65../lib/address (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:21:23673)
at s (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:15:28261)
at chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:15:28312
at Object.<anonymous> (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:15:30115)
at Object.r.3.../package.json (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:17:7643)
at s (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:15:28261)
at chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:15:28312
at Object.r.11../api (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/angular.js:17:28024)
chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:74
-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ia("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ia("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e)}catch(f){throw a[b]===k&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=eb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ia("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:
^
Error: [$injector:unpr] http://errors.angularjs.org/1.5.3/$injector/unpr?p0=bwcServiceProvider%20%3C-%20bwcService%20%3C-%20sjcl%20%3C-%20profileService
at Error (native)
at chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:40:416
at chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:77:7
at Object.d [as get] (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:74:270)
at chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:77:69
at d (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:74:270)
at e (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:75:1)
at Object.invoke (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:75:86)
at Object.$get (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:72:460)
at Object.invoke (chrome-extension://fmfiokedacobbphpmdlmbjddcbnmgbko/public/lib/ionic.bundle.js:75:295)
You have push notifications enabled on Copay but your server is not configured properly to send push notifications.
Since you would need Bitpay's app store keys to register push notifications, I would say just disable push notifications on your wallet. Before switching servers.
Where is the option to disable push notifications found in copay?
In the global app settings below the wallet list.
It's the 6th option from the top currently.
This option is only present in my android client, not my Linux client. The above error was captured on the Linux client so there's no way to change this setting.
Hmmm... try turning it off on your android, then reset everything and see if Linux works when you import it after having turned it off in the options.
I think there might be something in the wallet metadata that tells the server to use push notifications... which doesn't make sense, but I remember having to fumble around with push notifications to migrate to my bws
I ran into this server crash too, and found an even simple testcase:
Yes, that's it. When any user creates a wallet, the server dies. This should get fixed. The server should not crash just because it can't send push notifications.
Here's the error log:
erb Wallet created livenet
"POST /bws/api/v2/wallets/" 200 51 11.256
verb Notification NewCopayer
verb Notification copayerId
verb Notification copayerName
"POST /bws/api/v2/wallets/xxx/copayers" 200
"PUT /bws/api/v1/preferences/" 200
"GET /bws/api/v1/txhistory/?limit=5&r=47589" 200
"GET /bws/api/v2/wallets/?includeExtendedInfo=0&twoStep=1&r=12554" 200
ERR! /v1/pushnotifications/subscriptions/ :ECONNREFUSED:connect ECONNREFUSED 127.0.0.1:8000
[2016-12-29T06:32:31.152Z] error: uncaught exception: RangeError: Invalid status code: 0
at ServerResponse.writeHead (_http_server.js:192:11)
at ServerResponse.writeHead (/home/toomim/mynode/node_modules/on-headers/index.js:55:19)
at ServerResponse.writeHead (/home/toomim/mynode/node_modules/on-headers/index.js:55:19)
at ServerResponse._implicitHeader (_http_server.js:157:8)
at ServerResponse.end (/home/toomim/mynode/node_modules/compression/index.js:102:14)
at ServerResponse.send (/home/toomim/mynode/node_modules/express/lib/response.js:205:10)
at ServerResponse.json (/home/toomim/mynode/node_modules/express/lib/response.js:250:15)
at returnError (/home/toomim/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:111:31)
at /home/toomim/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:654:25
at Request._callback (/home/toomim/mynode/node_modules/bitcore-wallet-service/lib/server.js:3048:12)
[2016-12-29T06:32:31.154Z] error: RangeError: Invalid status code: 0
at ServerResponse.writeHead (_http_server.js:192:11)
at ServerResponse.writeHead (/home/toomim/mynode/node_modules/on-headers/index.js:55:19)
at ServerResponse.writeHead (/home/toomim/mynode/node_modules/on-headers/index.js:55:19)
at ServerResponse._implicitHeader (_http_server.js:157:8)
at ServerResponse.end (/home/toomim/mynode/node_modules/compression/index.js:102:14)
at ServerResponse.send (/home/toomim/mynode/node_modules/express/lib/response.js:205:10)
at ServerResponse.json (/home/toomim/mynode/node_modules/express/lib/response.js:250:15)
at returnError (/home/toomim/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:111:31)
at /home/toomim/mynode/node_modules/bitcore-wallet-service/lib/expressapp.js:654:25
at Request._callback (/home/toomim/mynode/node_modules/bitcore-wallet-service/lib/server.js:3048:12)
[2016-12-29T06:32:31.155Z] info: Beginning shutdown
[2016-12-29T06:32:31.155Z] info: Stopping insight-ui
[2016-12-29T06:32:31.156Z] info: Stopping bitcore-wallet-service
[2016-12-29T06:32:31.156Z] info: Stopping insight-api
[2016-12-29T06:32:31.156Z] info: Stopping web
[2016-12-29T06:32:31.157Z] info: Stopping bitcoind
[2016-12-29T06:32:31.762Z] warn: ZMQ disconnect: tcp://127.0.0.1:28332
FWIW I'm working around this bug currently by disabling push notifications from expressapp.js
by adding res.json({}); return;
to these two functions:
router.post('/v1/pushnotifications/subscriptions/', function(req, res) {
res.json({}); return; // I added this line to abort this function
getServerWithAuth(req, res, function(server) {
server.pushNotificationsSubscribe(req.body, function(err, response) {
if (err) return returnError(err, res, req);
res.json(response);
});
});
});
router.delete('/v1/pushnotifications/subscriptions/', function(req, res) {
res.json({}); return; // I added this line to abort this function
getServerWithAuth(req, res, function(server) {
server.pushNotificationsUnsubscribe(function(err, response) {
if (err) return returnError(err, res, req);
res.json(response);
});
});
});
Here are two proposals for more permanent solutions:
returnError()
lines, just print an error, but let the server continue to runI just posted this to https://github.com/bitpay/bitcore-wallet-service/issues/612, which seems more appropriate.
I have existing wallets that point to https://bws.bitpay.com/bws/api.
When I change the url in copay to my personal instance of bws, bitcored crashes. The copay wallet will display a network connection error. When I restart bitcored and retry the copay network connection, the wallet scan completes successfully.