How can I fix this grin-wallet error?

$ ./grin-wallet info
Password:
20220626 17:07:02.896 WARN grin_wallet_libwallet::api_impl::owner_updater - This wallet has not been scanned against the current chain. Beginning full scan... (this first scan may take a while, but subsequent scans will be much quicker)
20220626 17:07:02.896 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20220626 17:07:02.923 ERROR grin_wallet_impls::node_clients::http - Error calling get_unspent_outputs: Request error: Cannot make request: error sending request for url (http://127.0.0.1:3413/v2/foreign): connection closed before message completed
Wallet command failed: LibWallet Error: Client Callback Error: Error calling get_unspent_outputs: Request error: Cannot make request: error sending request for url (http://127.0.0.1:3413/v2/foreign): connection closed before message completed

Both ./grin-wallet address and ./grin-wallet account work normally.

Version info:

grin: v5.1.2
grin-wallet: v5.1.0
OS: Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-120-generic x86_64)

About tor:

I have no tor installation. By running ./grin-wallet listen, I get

20220625 08:53:44.812 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Warn, min. level: Info
20220625 08:53:44.812 INFO grin_wallet - Using wallet configuration file at ~/.grin/main/grin-wallet.toml
20220625 08:53:44.812 INFO grin_wallet - This is Grin Wallet version 5.1.0 (git v5.1.0), built for x86_64-unknown-linux-gnu by rustc 1.59.0 (9d1b2106e 2022-02-23).
20220625 08:53:44.845 WARN grin_wallet_controller::controller - Starting Tor Hidden Service for API listener at address pk7q3gkqczkzfgscjzpcvvexdmk34wqukmkeq4s7xjmpk53bixfopoad, binding to 127.0.0.1:3415
20220625 08:53:44.846 WARN grin_wallet_controller::controller - Unable to start TOR listener; Check that TOR executable is installed and on your path
20220625 08:53:44.846 ERROR grin_wallet_controller::controller - Tor Error: Tor Process Error: Process("TOR executable (`tor`) not found. Please ensure TOR is installed and on the path: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }")
20220625 08:53:44.846 WARN grin_wallet_controller::controller - Listener will be available via HTTP only
20220625 08:53:44.846 WARN grin_wallet_controller::controller - Starting HTTP Foreign listener API server at 127.0.0.1:3415.
20220625 08:53:44.846 WARN grin_wallet_controller::controller - HTTP Foreign listener started.

I see this address “pk7q3gkqczkzfgscjzpcvvexdmk34wqukmkeq4s7xjmpk53bixfopoad”. However, my address displayed by grin-wallet address is different.

$ grin-wallet address
grin102lsmx<omit on purpose>

Is this OK?

Is your node running on the same machine? If yes then restart the node and try again

Yes, on the same machine. I have restarted the node and seen the Running status for several times. I constantly see this error message.

i’m not on a pc where i have node/wallet so i can’t test anything, but the problem in your case is that your wallet can’t connect to your node’s foreign api. Node’s foreign api should be available when you start the node. It’s normal that grin-wallet address works, because that call doesn’t need a node (and that’s actually your address, i would ignore the TOR address - that’s probably ed25519 pubkey or smth). You don’t need to run grin-wallet listen for the wallet to communicate to the node, that’s only for tor sync communication. I would run netstat -tunlp and check if you have 0.0.0.0:3413 or 127.0.0.1:3413 there.

I have to run grin-wallet listen because I want to do solo mining locally to bypass the internal network blocking of all available mining pools.

Here is my netstat output

$ netstat -tunlp
tcp        0      0 127.0.0.1:3413          0.0.0.0:*               LISTEN      122661/./grin
tcp        0      0 0.0.0.0:3414            0.0.0.0:*               LISTEN      122661/./grin
tcp        0      0 127.0.0.1:3415          0.0.0.0:*               LISTEN      129959/./grin-wallet
tcp        0      0 127.0.0.1:3416          0.0.0.0:*               LISTEN      122661/./grin

I think you need to install TOR. Maybe someone else can confirm

But from the output, it seems it is OK without tor?

i think http is deprecated but i’m not 100% sure. But the node connectivity issue is not related to tor

Wow, so the output message of grin-wallet is not updated accordingly? Then the quality of the overall Grin project is questionable…

Patches are always welcome :slight_smile:

1 Like

Try ufw allow 3413

Or upgrade the grin version to 5.2.0-alpha.2. I had also issues with version 5.1.2 to solo mine. Now its running super stable.

1 Like

tnx, you very help me

1 Like