shesek / spark-wallet

⚡️ A minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps.
MIT License
344 stars 77 forks source link

Wallet rejecting connections with lightning client #176

Open theRescuer opened 3 years ago

theRescuer commented 3 years ago

Hi, I'm running Spark Wallet with c-lightning 0.9.3.1 in a docker deployment. Almost every day the connection breaks with Browser exception '502 - Bad Gateway' showing up

Output of 'Docker logs' command ...
HTTP server running on http://0.0.0.0:9737 Lightning client connection closed, reconnecting Lightning client connection error { Error: connect ECONNREFUSED /etc/lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/etc/lightning/lightning-rpc' } uncaughtException, stopping process Error: connect ECONNREFUSED /etc/lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) nc: unix connect failed: Connection refused Using lightningd directory mounted in /etc/lightning... waiting for RPC unix socket... Starting spark wallet (standalone mode)... Connected to c-lightning basedon-v0.9.3-1 with id 023808f558a644d786cb9071ea22f2afcd7329326170eded00dd2ce0b4e377ed2f on network bitcoin at /etc/lightning/lightning-rpc Loading login credentials from /data/.cookie

shesek commented 3 years ago

I see that you're using a c-lightning instance that's mounted from the host, can you check its log files for errors when spark gets disconnected from it?

theRescuer commented 3 years ago

Here it comes

docker logs 6cc7f04bc66a --tail 150

Lightning client connection closed, reconnecting Trying to reconnect... Lightning client connection error Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } events.js:291 throw er; // Unhandled 'error' event ^

Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) Emitted 'error' event on LightningClient instance at: at Socket. (/usr/src/app/lightning-client-js.js:71:23) at Socket.emit (events.js:314:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } Waiting /root/.nbxplorer/btc_fully_synched to be created... The chain is fully synched Reading config file cl-rest state dir: /usr/src/app Reading config file --- Starting the cl-rest server --- Reading SSL cert and key Reading rootkey for macaroon --- cl-rest api server is ready and listening on port: 3001 --- --- cl-rest doc server is ready and listening on port: 4001 --- Lightning client connection error Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } events.js:291 throw er; // Unhandled 'error' event ^

Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) Emitted 'error' event on LightningClient instance at: at Socket. (/usr/src/app/lightning-client-js.js:71:23) at Socket.emit (events.js:314:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } Waiting /root/.nbxplorer/btc_fully_synched to be created... The chain is fully synched Reading config file cl-rest state dir: /usr/src/app Reading config file --- Starting the cl-rest server --- Reading SSL cert and key Reading rootkey for macaroon --- cl-rest api server is ready and listening on port: 3001 --- --- cl-rest doc server is ready and listening on port: 4001 --- Lightning client connection error Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } events.js:291 throw er; // Unhandled 'error' event ^

Error: connect ECONNREFUSED /root/.lightning/lightning-rpc at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) Emitted 'error' event on LightningClient instance at: at Socket. (/usr/src/app/lightning-client-js.js:71:23) at Socket.emit (events.js:314:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '/root/.lightning/lightning-rpc' } Waiting /root/.nbxplorer/btc_fully_synched to be created... The chain is fully synched Reading config file cl-rest state dir: /usr/src/app Reading config file --- Starting the cl-rest server --- Reading SSL cert and key Reading rootkey for macaroon --- cl-rest api server is ready and listening on port: 3001 --- --- cl-rest doc server is ready and listening on port: 4001 --- Lightning client connected

shesek commented 3 years ago

Oh, I see it's part of a BTCPay setup, it helps to know that.

The errors in your last comment don't originate from Spark Wallet, they're from RTL's c-lightning-rest. This suggests that c-lightning is generally malfunctioning, and that it's not a Spark-specific issue.

I would suggest to try asking in the BTCPay support chat.

theRescuer commented 3 years ago

Ok, thanks. I'll ask them.