Unable to connect Server2 to Server1 - No Unspent output with activate permission

+2 votes
I followed the getting started page. Setup Server1, and initialized the blockchain. On server2, I connected and was told I needed permissions granted. Back on Server1, I issued the multichain-cli chain1 grant <walletId> command. This gave me error code -4 and the message "No unspent output with activate or admin permission".

 

Did I miss a step when setting up the initial blockchain?
asked Feb 11, 2017 by JPT
Thanks. Can you please provide the following information:

a) The version of multichaind that you are using, and whether you're on Linux or Windows.

b) Did anything happen to the first server between when it created the blockchain, and when you are trying to do this? Like a hard shutdown and restart?

c) Please post the output of the following multichain-cli calls on the first server:

listaddresses
listpermissions
listunspent 0 999999
getinfo
getblockchainparams

d) Please post the full grant API call you are making.

Thanks - that will hopefully help us narrow this down.
1. MultiChain Core RPC client build 1.0 alpha 27 protocol 10007

2. No

chain1: listaddresses
{"method":"listaddresses","params":[],"id":1,"chain_name":"chain1"}

[
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "ismine" : true
    },
    {
        "address" : "1Qr8YsmMb2y4BJfBgBPetabUoDL2qgLX7G9Mfr",
        "ismine" : true
    }
]

[
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "mine",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "admin",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "activate",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "connect",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "send",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "receive",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "issue",
        "startblock" : 0,
        "endblock" : 4294967295
    },
    {
        "address" : "1Ukxoyr8ifnKa7PctEXwC3mYrcFw5Ywvemiumy",
        "for" : null,
        "type" : "create",
        "startblock" : 0,
        "endblock" : 4294967295
    }
]

{"method":"listunspent","params":[0],"id":1,"chain_name":"chain1"}

[
]
chain1: listunspent 0 999999
{"method":"listunspent","params":[0,999999],"id":1,"chain_name":"chain1"}

[
]

{"method":"getinfo","params":[],"id":1,"chain_name":"chain1"}

{
    "version" : "1.0 alpha 27",
    "protocolversion" : 10007,
    "chainname" : "chain1",
    "description" : "MultiChain chain1",
    "protocol" : "multichain",
    "port" : 6467,
    "setupblocks" : 60,
    "nodeaddress" : "chain1@10.0.2.15:6467",
    "burnaddress" : "1XXXXXXWs6XXXXXXFXXXXXXXKsXXXXXXanBy9p",
    "incomingpaused" : false,
    "miningpaused" : false,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "walletdbversion" : 2,
    "reindex" : false,
    "blocks" : 1403,
    "timeoffset" : 0,
    "connections" : 0,
    "proxy" : "",
    "difficulty" : 0.00001526,
    "testnet" : false,
    "keypoololdest" : 1486831769,
    "keypoolsize" : 2,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00000000,
    "errors" : ""
}

{"method":"getblockchainparams","params":[],"id":1,"chain_name":"chain1"}

{
    "chain-protocol" : "multichain",
    "chain-description" : "MultiChain chain1",
    "root-stream-name" : "root",
    "root-stream-open" : true,
    "chain-is-testnet" : false,
    "target-block-time" : 15,
    "maximum-block-size" : 8388608,
    "default-network-port" : 6467,
    "default-rpc-port" : 6466,
    "anyone-can-connect" : false,
    "anyone-can-send" : false,
    "anyone-can-receive" : false,
    "anyone-can-receive-empty" : true,
    "anyone-can-create" : false,
    "anyone-can-issue" : false,
    "anyone-can-mine" : false,
    "anyone-can-activate" : false,
    "anyone-can-admin" : false,
    "support-miner-precheck" : true,
    "allow-p2sh-outputs" : true,
    "allow-multisig-outputs" : true,
    "setup-first-blocks" : 60,
    "mining-diversity" : 0.30000000,
    "admin-consensus-admin" : 0.50000000,
    "admin-consensus-activate" : 0.50000000,
    "admin-consensus-mine" : 0.50000000,
    "admin-consensus-create" : 0.00000000,
    "admin-consensus-issue" : 0.00000000,
    "mining-requires-peers" : true,
    "first-block-reward" : -1,
    "initial-block-reward" : 0,
    "reward-halving-interval" : 52560000,
    "reward-spendable-delay" : 1,
    "minimum-per-output" : 0,
    "maximum-per-output" : 100000000000000,
    "minimum-relay-fee" : 0,
    "native-currency-multiple" : 100000000,
    "skip-pow-check" : false,
    "pow-minimum-bits" : 16,
    "target-adjust-freq" : -1,
    "allow-min-difficulty-blocks" : false,
    "only-accept-std-txs" : true,
    "max-std-tx-size" : 4194304,
    "max-std-op-returns-count" : 10,
    "max-std-op-return-size" : 2097152,
    "max-std-op-drops-count" : 5,
    "max-std-element-size" : 8192,
    "chain-name" : "chain1",
    "protocol-version" : 10007,
    "network-message-start" : "fff1e2ff",
    "address-pubkeyhash-version" : "005d6f1b",
    "address-scripthash-version" : "05887782",
    "private-key-version" : "80fac13e",
    "address-checksum-value" : "ff20b90e",
    "genesis-pubkey" : "0289ad322bab17b3dbddcbe2caa20eae54e0ed341dd005171ae67c7bf3ab44cda7",
    "genesis-version" : 1,
    "genesis-timestamp" : 1486824187,
    "genesis-nbits" : 520159231,
    "genesis-nonce" : 72013,
    "genesis-pubkey-hash" : "cd6110711e50f799d6d098040f746326b3e6cf8b",
    "genesis-hash" : "0000d7a0e540257ca9ed0b9200ae1db58588e94486124f315ad0ac3fd2fe84d3",
    "chain-params-hash" : "d829606fa4d3bfafdc9fb8c2a04112ed8297244a87d0227e4a2762055f959293"
}

 

multichain-cli chain1 grant 1XFrnBUQJmrwrbgviWnY1NgKG4Z8imBEcJmc71 connect

 

Thanks, John
Thanks. So there are indeed no unspent outputs, and there should only be two ways for this to happen. Either (a) you've been building and sending raw transactions which spent the last unspent output for the admin address, without creating a change output, or (b) there's some bug in MultiChain which is causing this in your case.

Assuming it's not (a), we'd appreciate your help in debugging this. Could you please stop the node (using multichain-cli chain1 stop), then zip up the chain1 blockchain directory (in ~/.multichain/ on Linux), and email it to us at multichain dot debug at gmail dot com. Thanks in advance.
Just sent the archive. Appreciate you taking the time to look at this. Thanks.
Thanks, we can confirm the problem with your files and are taking a look. Since this happened in such a simple case of following the tutorial, it's a rare problem. So for now you should be able to just start again with a new chain. I would be surprised if the problem occurs again, but if it does, please let us know - perhaps it's due to some library version or other characteristic of your system.

1 Answer

+1 vote

We looked through the logs, which show a crash or hard kill on 2017-02-11 15:40:58. Is it possible that you killed the multichaind process without issuing the stop API command, and then at some point restarted it? If so we're still aware there are some of these "disgraceful shutdown" issues, and they're on the to-do list. The way to recover from this kind of thing is to restart multichaind with the -reindex flag (or in this case, even -rescan should be sufficient).

If the multichaind process crashed, rather than you killing it yourself, please let us know. 

answered Feb 12, 2017 by MultiChain
I have both nodes running in Virtualbox VMs, so I may have crashed something while getting the NAT network layer to work. I created a new chain, chain2, and everything seems to be working now. Thanks again for looking into this.
Great, thanks for the update.
...