Transferring ID from outdated CLI version 0.17.0.13

I originally posted this 3 weeks ago here: Transferring ID from CLI version 0.17.0.13

When running the “blockstack wallet” command, I get the following:
“error”: “Failed to save keys”

Hey @BlockstackFTW, apologies for not replying earlier.

To answer your earlier question, the blockstack command is the old CLI, and was dropped from the project repository over a year ago. The current CLI is here, and its command is blockstack-cli.

The error message you’re getting happens if the blockstack program cannot start its background daemon, or cannot connect to it. Can you show the trace of the program when you run blockstack --debug wallet?

parallels@parallels-vm:~$ blockstack --debug wallet
Set BLOCKSTACK_DEBUG to 1
Re-exec as `"/usr/bin/python", "/usr/local/bin/blockstack", "wallet"`
[2019-03-18 16:49:40,202] [DEBUG] [spv:103] (21392.139818395858752) Using mainnet
[2019-03-18 16:49:40,488] [DEBUG] [client:95] (21392.139818395858752) Connect to https://node.blockstack.org:6263
[2019-03-18 16:49:40,490] [WARNING] [storage:633] (21392.139818395858752) Storage implementation is missing a "get_immutable_handler" method
[2019-03-18 16:49:40,490] [WARNING] [storage:633] (21392.139818395858752) Storage implementation is missing a "put_immutable_handler" method
[2019-03-18 16:49:40,490] [WARNING] [storage:633] (21392.139818395858752) Storage implementation is missing a "delete_immutable_handler" method
[2019-03-18 16:49:40,490] [WARNING] [storage:633] (21392.139818395858752) Storage implementation is missing a "delete_mutable_handler" method
[2019-03-18 16:49:40,873] [WARNING] [dropbox:188] (21392) Config file '/home/parallels/.blockstack/client.ini': section 'dropbox' is missing 'token'.  Write access will be disabled
[2019-03-18 16:49:40,874] [DEBUG] [client:110] (21392.139818395858752) Loaded storage drivers ['disk', 'gaia_hub', 'dropbox', 's3', 'blockstack_resolver', 'http', 'dht']
[2019-03-18 16:49:40,874] [DEBUG] [rpc:5510] (21392.139818395858752) Not running: 15081 (/home/parallels/.blockstack/api_endpoint.pid)
[2019-03-18 16:49:40,874] [DEBUG] [rpc:5586] (21392.139818395858752) RPC running (/home/parallels/.blockstack/api_endpoint.pid)
[2019-03-18 16:49:40,874] [DEBUG] [rpc:5510] (21392.139818395858752) Not running: 15081 (/home/parallels/.blockstack/api_endpoint.pid)
[2019-03-18 16:49:40,874] [DEBUG] [rpc:5586] (21392.139818395858752) RPC running (/home/parallels/.blockstack/api_endpoint.pid)
[2019-03-18 16:49:40,876] [DEBUG] [rpc:5092] (21392.139818395858752) Connect to API at localhost:6270
[2019-03-18 16:49:40,891] [DEBUG] [actions:1222] (21392.139818395858752) unlocking wallet (/home/parallels/.blockstack)
[2019-03-18 16:49:40,892] [DEBUG] [rpc:5092] (21392.139818395858752) Connect to API at localhost:6270
Enter wallet password: 
[2019-03-18 16:50:01,406] [DEBUG] [rpc:5092] (21392.139818395858752) Connect to API at localhost:6270
[2019-03-18 16:50:01,406] [DEBUG] [wallet:1059] (21392.139818395858752) Saving keys to memory
[2019-03-18 16:50:01,409] [ERROR] [wallet:1064] (21392.139818395858752) HTTPConnectionPool(host='localhost', port=6270): Max retries exceeded with url: /v1/node/ping (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f29fb3e47d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/wallet.py", line 1061, in save_keys_to_memory
data = proxy.backend_set_wallet(wallet_keys)
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/rpc.py", line 4376, in backend_set_wallet
res = self.check_version()
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/rpc.py", line 4355, in check_version
res = self.ping()
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/rpc.py", line 4343, in ping
req = self.requests_get( 'http://{}:{}/v1/node/ping'.format(self.server, self.port), timeout=self.timeout, headers=headers)
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/rpc.py", line 4313, in requests_get
return self.requests_dispatch('get', *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/blockstack_client/rpc.py", line 4282, in requests_dispatch
req = requests.get(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 508, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='localhost', port=6270): Max retries exceeded with url: /v1/node/ping (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f29fb3e47d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
[2019-03-18 16:50:01,434] [ERROR] [actions:1225] (21392.139818395858752) unlock_wallet: Failed to save keys
{
"error": "Failed to save keys"
}
parallels@parallels-vm:~$

@BlockstackFTW and we actually have documentation on the CLI which you can see here. . This page lets you see the current commands and their options without installing:

@BlockstackFTW I think we spoke on Slack recently? I’m just posting the solution as we worked it out so far:

Cause: the old CLI’s background daemon wasn’t starting properly for some reason when running blockstack wallet.
Solution:

  1. run blockstack --debug api start --foreground to start the background daemon manually. It should output { "status": True }.
  2. run blockstack wallet
  3. Install the new CLI (requires node.js and npm)
  4. use the owner and payment keys to execute the new CLI’s transfer command