I got a crash in mcnode trying to add an authorization for another local testing node:
$ mcclient --apiUrl http://localhost:9004 auth grant QmXY1nyb6sbXgdAjEjDHcqXfpmmwjhj3S1KPSu94grp1xo 'museums.tate.*'
request to http://localhost:9004/auth/QmXY1nyb6sbXgdAjEjDHcqXfpmmwjhj3S1KPSu94grp1xo failed, reason: socket hang up
$ mcclient --apiUrl http://localhost:9004 auth show
network timeout at: http://localhost:9004/auth
I think this is happening because the auth.peers map is only created in the fromJSON method, so if the node doesn't have a config file, that method is never called and the auth map is nil.
Adding this config file to the node's data dir fixes it:
{"nat":"none","auth":{}}
Or, if you set any other config that causes the file to be created, e.g. mcclient config nat auto, then restart the node, it will trigger that method and create the map.
I got a crash in
mcnode
trying to add an authorization for another local testing node:The node's log:
after the crash, I could still get the node's id:
But
auth
commands time out:I think this is happening because the
auth.peers
map is only created in the fromJSON method, so if the node doesn't have a config file, that method is never called and the auth map isnil
.Adding this config file to the node's data dir fixes it:
Or, if you set any other config that causes the file to be created, e.g.
mcclient config nat auto
, then restart the node, it will trigger that method and create the map.