lbryio / lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
https://lbry.tech
MIT License
3.56k stars 413 forks source link

exchange_rate_manager cannot connect network unreachable #7516

Open rnd42 opened 2 years ago

rnd42 commented 2 years ago

Bug I have been unable to purchase any content for months. Finally decided to dig in and see if I could figure out why.

In the logs below you can see it's trying to connect to various APIs via HTTPS port 443 without SSL (TLS). I'm guessing that's at least part of the issue since I can reach that host fine using curl:

host api.coinex.com:443 ssl:None

$ curl https://api.coinex.com
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>

Noting the UPnP error and the article at https://lbry.com/faq/startup-troubleshooting I forwarded 3333/tcp and 4444/udp through my router which does not allow UPnP but it doesn't seem to have made a difference.

To Reproduce Steps to reproduce the behavior:

  1. Go to any video for sale, I found the cheapest recent paid video for demonstration purposes: lbry://@尚食_1080p#a/尚食_35_1080p#6
  2. Click on the Play button
  3. Click on the "Purchase" button.
  4. Error "toast" message pops up: "Failed to view lbry://@尚食_1080p#a/尚食_35_1080p#6, please try again. If this problem persists, visit https://lbry.com/faq/support for support."

This happened using both the Flatpak and AppImage version of LBRY even after a clean reinstall (kill all *lbry* processes, added a .old suffix to the following paths and reinstalled software).

.config/LBRY .local/share/lbry .var/app/io.lbry.lbry-app

Expected behavior Pay for video and download it.

Screenshots If applicable, add screenshots to help explain your problem.

System Configuration

Additional context In my lbrynet.log file I see the following error messages during startup:

2022-03-21 10:14:02,686 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate CoinEx: Cannot connect to host api.coinex.com:443 ssl:None [Network is unreachable]
2022-03-21 10:14:02,725 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate hotbit: Cannot connect to host api.hotbit.io:443 ssl:None [Network is unreachable]
2022-03-21 10:14:02,738 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate CoinEx: Cannot connect to host api.coinex.com:443 ssl:None [Network is unreachable]
2022-03-21 10:14:02,747 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate hotbit: Cannot connect to host api.hotbit.io:443 ssl:None [Network is unreachable]
2022-03-21 10:14:02,837 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate Bittrex: Cannot connect to host api.bittrex.com:443 ssl:None [Network is unreachable]
2022-03-21 10:14:02,967 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate Bittrex: Cannot connect to host api.bittrex.com:443 ssl:None [Network is unreachable]
2022-03-21 10:14:05,392 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate UPbit: Cannot connect to host api.upbit.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')]
2022-03-21 10:14:05,602 WARNING  lbry.extras.daemon.components:562: upnp discovery failed: M-SEARCH for 10.42.0.1:1900 timed out
2022-03-21 10:14:05,603 ERROR    lbry.extras.daemon.components:653: failed to setup upnp

Later when the purchase failed I see the following added to the log:

2022-03-21 11:13:26,252 ERROR    lbry.file.file_manager:257: Unexpected error downloading stream:
Traceback (most recent call last):
  File "lbry/file/file_manager.py", line 191, in download_from_uri
  File "lbry/wallet/manager.py", line 305, in create_purchase_transaction
  File "lbry/extras/daemon/exchange_rate_manager.py", line 246, in to_dewies
  File "lbry/extras/daemon/exchange_rate_manager.py", line 243, in convert_currency
lbry.error.CurrencyConversionError: Unable to convert 50 from USD to LBC
2022-03-21 11:13:26,253 WARNING  lbry.extras.daemon.daemon:1174: Error downloading lbry://@尚食_1080p#a/尚食_35_1080p#6: Unable to convert 50 from USD to LBC
2022-03-21 11:14:32,114 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate hotbit: Cannot connect to host api.hotbit.io:443 ssl:None [Network is unreachable]
2022-03-21 11:14:32,183 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate CoinEx: Cannot connect to host api.coinex.com:443 ssl:None [Network is unreachable]
2022-03-21 11:14:32,207 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate CoinEx: Cannot connect to host api.coinex.com:443 ssl:None [Network is unreachable]
2022-03-21 11:14:32,234 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate hotbit: Cannot connect to host api.hotbit.io:443 ssl:None [Network is unreachable]
2022-03-21 11:14:33,274 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate Bittrex: Cannot connect to host api.bittrex.com:443 ssl:None [Network is unreachable]
2022-03-21 11:14:33,411 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate Bittrex: Cannot connect to host api.bittrex.com:443 ssl:None [Network is unreachable]
2022-03-21 11:14:56,614 WARNING  lbry.extras.daemon.exchange_rate_manager:94: Error trying to connect to exchange rate UPbit: Cannot connect to host api.upbit.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')]
rnd42 commented 2 years ago

Well if anyone else runs into this I found a simple work around. In the settings change "Max purchase price" to "No Limit". It may also work to set a price in LBC instead of USD but I didn't test that.