gridcoin-community / Gridcoin-Research

Gridcoin-Research
MIT License
585 stars 173 forks source link

Pop-up window with error "Invalid -tor address: '127.0.0.1:9050'" and inmediate program close after launching it with -tor=127.0.0.1:9050 option. #2732

Closed jairo709 closed 4 months ago

jairo709 commented 5 months ago

Bug Report

Current behavior If the option -tor=127.0.0.1:9050 is added when launching gridcoin, or if tor=127.0.0.1:9050 option is enabled on the gridcoinresearch.conf file, the program closes after displaying a pop-up window with the text "Invalid -tor address: '127.0.0.1:9050'". No information about this error is shown on the debug.log file or in terminal (when launched from it).

Expected behavior Gridcoin completes its initial processes and displays it's GUI. Tor hidden services are reached through the configured tor proxy.

Steps to reproduce:

  1. On the gridcoinresearch.conf file, located on the .GridcoinResearch directory, enable (or add if absent) the option "tor=127.0.0.1:9050".
  2. Launch the program from it's link as usually.

(Alternatively, Launch the program from a terminal typing "gridcoinresearch -tor=127.0.0.1:9050" and press enter.)

Screenshots invalid tor address

Gridcoin version v5.4.5.0 Installed from official Debian package: gridcoinresearch-qt_5.4.5.0_bullseye-1_amd64.deb on a Debian GNU/Linux 12 (bookworm) system.

Machine specs

Extra information

  1. Please, note that this behaviour is not observed If the "tor address" option is not enabled/included at launch.
  2. Please, take into account that db.log file is empty after reproducing the described behaviour.
  3. Extracted from debug.log (username modified on purpose) just after reproducing this behaviour:

2024-01-18T16:32:03Z Default data directory /home/*****/.GridcoinResearch

2024-01-18T16:32:03Z Using data directory /home/*****/.GridcoinResearch

2024-01-18T16:32:03Z Gridcoin version v5.4.5.0 (release build) 2024-01-18T16:32:03Z Starting Gridcoin 2024-01-18T16:32:03Z Initializing Core... 2024-01-18T16:32:03Z Boost Version: Using Boost 1.74.0

2024-01-18T16:32:03Z Using specific arg default 2024-01-18T16:32:03Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation

2024-01-18T16:32:03Z Block version 11 hard fork configured for block 2053000 2024-01-18T16:32:03Z Block version 12 hard fork configured for block 2671700 2024-01-18T16:32:03Z INFO AppInit2: DataDir = /home/*****/.GridcoinResearch. 2024-01-18T16:32:03Z Using OpenSSL version OpenSSL 1.1.1o 3 May 2022

2024-01-18T16:32:03Z INFO: GetTimes: timer init: Starting verify of database integrity: elapsed time: 3 ms, time since last check: 3 ms. 2024-01-18T16:32:03Z dbenv.open LogDir=/home//.GridcoinResearch/database ErrorFile=/home//.GridcoinResearch/db.log 2024-01-18T16:32:03Z INFO: GetTimes: timer init: Finished verifying database integrity: elapsed time: 89 ms, time since last check: 86 ms. 2024-01-18T16:32:15Z Core Initialized... 2024-01-18T16:32:16Z Main calling Shutdown... 2024-01-18T16:32:16Z gridcoinresearch exiting... 2024-01-18T16:32:16Z INFO: Shutdown: Stopping the scheduler. 2024-01-18T16:32:16Z INFO: Shutdown: Cleaning up any remaining threads in scheduler. 2024-01-18T16:32:16Z INFO: Shutdown: Flushing wallet database. 2024-01-18T16:32:16Z INFO: Shutdown: Interrupting sleeping threads. 2024-01-18T16:32:16Z INFO: Shutdown: Stopping net (node) threads. 2024-01-18T16:32:16Z StopNode() 2024-01-18T16:32:16Z Wait for 0 threads to join. 2024-01-18T16:32:16Z INFO: Shutdown: Final flush of wallet database and closing wallet database file. 2024-01-18T16:32:16Z INFO: Shutdown: Stopping RPC threads. 2024-01-18T16:32:16Z Stop RPC IO service

2024-01-18T16:32:16Z RPC IO server not started

2024-01-18T16:32:16Z Gridcoin exited 2024-01-18T16:32:17Z Wait for 1 threads to join.

div72 commented 5 months ago

-tor option seems to have a few logic issues, does -proxy work?

jairo709 commented 5 months ago

Yes. The -proxy option works. Gridcoin UI reaches main window without issues. Also, I have to mention that the program closes after clicking on the "Accept" button in the error message. I didn't mention it on the title nor on the description.

jamescowens commented 5 months ago

I think a local proxy server that proxies tor is considered a SOCKS5 proxy, so -proxy is the correct startup parameter to use. We should probably change the in app help to clarify.

jairo709 commented 5 months ago

As I understand the -tor option as it is explained on the Wiki, it's objective is to make possible to reach .onion nodes through tor while connecting directly to the rest of the network. This would be interesting just to connect to hidden nodes with .onion directions without "hiding" the node in the process. On the other hand, the -proxy option makes gridcoin connect to all nodes through the configured proxy.