JoinMarket-Org / joinmarket-clientserver

Bitcoin CoinJoin implementation with incentive structure to convince people to take part
GNU General Public License v3.0
731 stars 179 forks source link

JoinMarket daemon is getting "Permission denied: 'commitmentlist'" error on testnet #667

Closed dmp1ce closed 4 years ago

dmp1ce commented 4 years ago

I have multiple makers setup to go through one daemon and every time I try to do a CoinJoin I get the following error below. I'm not sure if this is an issue with having multiple makers on one daemon or if it is a testnet issue.

I would like to be able to supply liquidity to testnet but so far I haven't been able to complete a CoinJoin using the sendpayment.py script.

joinmarketd_1     | 2020-08-14 22:33:09+0000 [JMDaemonServerProtocol,1,127.0.0.1] Unhandled Error
joinmarketd_1     |     Traceback (most recent call last):
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/amp.py", line 1038, in _commandReceived
joinmarketd_1     |         deferred = self.dispatchCommand(box)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/amp.py", line 1096, in dispatchCommand
joinmarketd_1     |         return maybeDeferred(responder, box)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 151, in maybeDeferred
joinmarketd_1     |         result = f(*args, **kw)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/amp.py", line 1183, in doit
joinmarketd_1     |         return maybeDeferred(aCallable, **kw).addCallback(
joinmarketd_1     |     --- <exception caught here> ---
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
joinmarketd_1     |         current.result = callback(current.result, *args, **kw)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/amp.py", line 1166, in checkKnownErrors
joinmarketd_1     |         key = error.trap(*command.allErrors)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 460, in trap
joinmarketd_1     |         self.raiseException()
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 488, in raiseException
joinmarketd_1     |         raise self.value.with_traceback(self.tb)
joinmarketd_1     |       File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 151, in maybeDeferred
joinmarketd_1     |         result = f(*args, **kw)
joinmarketd_1     |       File "/jm/clientserver/jmdaemon/jmdaemon/daemon_protocol.py", line 312, in on_JM_IOAUTH
joinmarketd_1     |         check_utxo_blacklist(self.active_orders[nick]["commit"], persist=True)
joinmarketd_1     |       File "/jm/clientserver/jmdaemon/jmdaemon/daemon_protocol.py", line 79, in check_utxo_blacklist
joinmarketd_1     |         with open(fname, "wb") as f:
joinmarketd_1     |     builtins.PermissionError: [Errno 13] Permission denied: 'commitmentlist'
joinmarketd_1     | 
joinmarketd_1     | 2020-08-14 22:33:09+0000 [JMDaemonServerProtocol,1,127.0.0.1] JMDaemonServerProtocol connection lost (HOST:IPv4Address(type='TCP', host='127.0.0.1', port=27183) PEER:IPv4Address(type='TCP', host='127.0.0.1', port=52396
AdamISZ commented 4 years ago

Hmm, I'm surprised you get a permission denied error there, can you confirm it works fine with only one maker client?

I quite often run several ygs and 1 taker in the same directory ,admittedly on a regtest setup.

Also it's interesting to know what happens with multiple maker clients with separate daemons (they open using different ports so no worry there), i.e. leaving the default daemon config settings, in the same joinmarket-clientserver directory. On second thoughts, while that could be interesting, it's not so much here .. you have only one daemon process, so I don't see why it should conflict on that file since it's just running a twisted event loop, it's not like there are different threads per maker. Are you sure the permissions situation is/should be OK here?

(edited: maker not taker)

Also just for background please give a bit more detail like your OS, what commands you ran etc.

dmp1ce commented 4 years ago

I'm running in a docker setup I have here: https://github.com/dmp1ce/BTC-Privacy-Suite

What is the directory which the process needs access to? I gave access to ~/.joinmarket but any other directory is probably owned by root but the process is running as joinmarket user.

EDIT: I figured out the commitmentlist is created in the scripts directory usually. I guess it is the working directory of running script? I need to fix that with my permissions. It would be nice if this was also stored in ~/.joinmarket.

dmp1ce commented 4 years ago

Yep! That worked! I symlinked commitmentlist file to ~/.joinmarket/commitmentlist can the script worked fine. My Docker setup only gives access to write to ~/. Thanks!