Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build circuits #5486

Closed
qstokkink opened this issue Jul 17, 2020 · 11 comments
Closed

Unable to build circuits #5486

qstokkink opened this issue Jul 17, 2020 · 11 comments

Comments

@qstokkink
Copy link
Contributor

qstokkink commented Jul 17, 2020

Concerns:

  • release-7.5
  • devel

OS: Ubuntu 20.04
python3-libtorrent: 1.1.13-1.1build2 (Ubuntu 20.04 default version)

I am unable to build circuits on the latest commit. I have worked down the line for the release-7.5 branch and found the following behavior:

Is this due to a lack of peers running the latest commit or is this a bug?

Here is the log for the crashes:

$ bash src/tribler.sh
[PID:3807] 2020-07-17 16:48:44,381 - INFO - root(24) - __init__()
[PID:3807] 2020-07-17 16:48:44,832 - INFO - root(50) -   self._outSocket.error() = '2'
[PID:3807] 2020-07-17 16:48:44,833 - INFO - root(60) - __init__(): returning
[PID:3807] 2020-07-17 16:48:45,975 - INFO - TriblerGUI(130) - Will connect to events endpoint
[PID:3807] 2020-07-17 16:48:46,201 - INFO - TriblerGUI(74) - Got Tribler core error: 1
[PID:3807] 2020-07-17 16:48:46,728 - INFO - TriblerGUI(130) - Will connect to events endpoint
[PID:3807] 2020-07-17 16:48:46,729 - INFO - TriblerGUI(74) - Got Tribler core error: 1
[PID:3807] 2020-07-17 16:48:47,229 - INFO - TriblerGUI(130) - Will connect to events endpoint
[PID:3807] 2020-07-17 16:48:47,230 - INFO - TriblerGUI(74) - Got Tribler core error: 1
[PID:3826] 2020-07-17 16:48:47,535 - INFO - Session(387) - Session is using state directory: /home/quinten/.Tribler/7.5
[PID:3826] 2020-07-17 16:48:47,582 - INFO - RESTManager(87) - Starting REST API on port 8085
[PID:3826] 2020-07-17 16:48:47,655 - INFO - root(120) - Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt
[PID:3826] 2020-07-17 16:48:47,708 - INFO - root(120) - Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt
[PID:3826] 2020-07-17 16:48:47,722 - INFO - RefactoringTool(263) - Skipping optional fixer: buffer
[PID:3807] 2020-07-17 16:48:47,728 - INFO - TriblerGUI(130) - Will connect to events endpoint
[PID:3826] 2020-07-17 16:48:47,802 - INFO - RefactoringTool(263) - Skipping optional fixer: idioms
[PID:3826] 2020-07-17 16:48:47,900 - INFO - RefactoringTool(263) - Skipping optional fixer: set_literal
[PID:3826] 2020-07-17 16:48:47,961 - INFO - RefactoringTool(263) - Skipping optional fixer: ws_comma
[PID:3826] 2020-07-17 16:48:48,284 - INFO - TrackerManager(38) - No tracker blacklist file found at /home/quinten/.Tribler/7.5/tracker_blacklist.txt.
[PID:3826] 2020-07-17 16:48:48,312 - INFO - DHTDiscoveryCommunity(186) - DHT community initialized (peer mid b'8a6c0741eb780291b32f9c61c58b2a4197e4d86e')
[PID:3826] 2020-07-17 16:48:48,317 - INFO - TriblerTunnelCommunity(163) - Setting exitnode = False
[PID:3826] 2020-07-17 16:48:48,322 - INFO - PopularityCommunity(39) - Popularity Community initialized (peer mid 8a6c0741eb780291b32f9c61c58b2a4197e4d86e)
[PID:3826] 2020-07-17 16:48:48,731 - INFO - Socks5Connection(85) - Client has sent METHOD REQUEST
[PID:3826] 2020-07-17 16:48:48,817 - INFO - Socks5Connection(170) - Accepting UDP ASSOCIATE request to 127.0.0.1:35446
[PID:3807] 2020-07-17 16:48:49,653 - ERROR <tribler_window:107> root.on_exception(): Traceback (most recent call last):
  File "/home/quinten/Documents/tribler/src/tribler-gui/tribler_gui/event_request_manager.py", line 112, in on_read_data
    raise RuntimeError(json_dict["event"]["text"])
RuntimeError: 'listen_succeeded_alert' object has no attribute 'port'
--LONG TEXT--
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/quinten/Documents/tribler/src/pyipv8/ipv8/taskmanager.py", line 131, in done_cb
    future.result()
  File "/home/quinten/Documents/tribler/src/pyipv8/ipv8/taskmanager.py", line 18, in interval_runner
    await task(*args)
  File "/home/quinten/Documents/tribler/src/pyipv8/ipv8/util.py", line 55, in call_async
    return func(*args, **kwargs)
  File "/home/quinten/Documents/tribler/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py", line 454, in _task_process_alerts
    self.process_alert(alert, hops=hops)
  File "/home/quinten/Documents/tribler/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py", line 350, in process_alert
    self.listen_ports[hops] = alert.port
AttributeError: 'listen_succeeded_alert' object has no attribute 'port'

--CONTEXT--
{'message': 'Exception in callback TaskManager.register_task.<locals>.done_cb(<Task finishe...bute \'port\'")>) at /home/quinten/Documents/tribler/src/pyipv8/ipv8/taskmanager.py:128', 'exception': AttributeError("'listen_succeeded_alert' object has no attribute 'port'"), 'handle': <Handle TaskManager.register_task.<locals>.done_cb(<Task finishe...bute 'port'")>) at /home/quinten/Documents/tribler/src/pyipv8/ipv8/taskmanager.py:128>}

[PID:3807] 2020-07-17 16:48:49,723 - INFO - TriblerGUI(130) - Will connect to events endpoint
[PID:3807] 2020-07-17 16:48:49,746 - INFO - TriblerGUI(74) - Got Tribler core error: 401
[PID:3826] 2020-07-17 16:48:49,749 - INFO - Session(587) - Tribler shutdown state notification:Shutting down Torrent Checker...
[PID:3826] 2020-07-17 16:48:49,757 - INFO - Session(587) - Tribler shutdown state notification:Shutting down Gigachannel Manager...
[PID:3826] 2020-07-17 16:48:49,765 - INFO - Session(587) - Tribler shutdown state notification:Shutting down Version Checker...
[PID:3826] 2020-07-17 16:48:49,781 - INFO - Session(587) - Tribler shutdown state notification:Unloading Tunnel Community...
[PID:3826] 2020-07-17 16:48:49,787 - INFO - Socks5Connection(200) - Closing session, reason stopping
[PID:3826] 2020-07-17 16:48:49,790 - INFO - Socks5Connection(200) - Closing session, reason unspecified
[PID:3826] 2020-07-17 16:48:49,803 - INFO - Session(587) - Tribler shutdown state notification:Shutting down TrustChain Community...
[PID:3826] 2020-07-17 16:48:49,817 - INFO - Session(587) - Tribler shutdown state notification:Shutting down IPv8...
[PID:3826] 2020-07-17 16:48:49,833 - INFO - Session(587) - Tribler shutdown state notification:Saving configuration...
[PID:3826] 2020-07-17 16:48:49,834 - INFO - Session(587) - Tribler shutdown state notification:Checkpointing Downloads...
[PID:3826] 2020-07-17 16:48:49,835 - INFO - Session(587) - Tribler shutdown state notification:Shutting down Downloads...
[PID:3826] 2020-07-17 16:48:49,836 - INFO - Session(587) - Tribler shutdown state notification:Shutting down Libtorrent Manager...
[PID:3826] 2020-07-17 16:48:49,836 - INFO - Session(587) - Tribler shutdown state notification:Waiting for Libtorrent to finish...
[PID:3826] 2020-07-17 16:48:50,869 - INFO - Session(587) - Tribler shutdown state notification:Waiting for Libtorrent to finish...
[PID:3807] 2020-07-17 16:48:51,848 - INFO - root(169) - Shutting down Tribler
QProcess: Destroyed while process ("/usr/bin/python3") is still running.
@qstokkink qstokkink added this to the V7.5: core refactoring milestone Jul 17, 2020
@egbertbouman
Copy link
Member

Oh, sometimes listen_succeeded_alert as a port and sometimes it doesn't. There seem to be quite some differences between versions 😟

I guess we'll have to add a getattr call. I'll compile libtorrent 1.1.13 and have a look.

@qstokkink
Copy link
Contributor Author

My listen_succeeded_alert apparently doesn't have a port, but it does have an endpoint which seems to be a tuple:

('::', 43742)

@qstokkink
Copy link
Contributor Author

This fixes it for me:

diff --git a/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py b/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py
index d7c188322..f2e07809a 100644
--- a/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py
+++ b/src/tribler-core/tribler_core/modules/libtorrent/download_manager.py
@@ -347,7 +347,7 @@ class DownloadManager(TaskManager):
             self._logger.debug("Got alert for unknown download %s: %s", hexlify(infohash), alert)
 
         if alert_type == 'listen_succeeded_alert':
-            self.listen_ports[hops] = alert.port
+            self.listen_ports[hops] = alert.endpoint[1]
 
         elif alert_type == 'peer_disconnected_alert' and \
                 self.tribler_session and self.tribler_session.payout_manager:

@egbertbouman
Copy link
Member

Now let's hope that the endpoint is still there in newer versions.

@qstokkink
Copy link
Contributor Author

Well the getattr option is still on the table 😃.

@egbertbouman
Copy link
Member

Just tested it with 1.2.7 and the endpoint is still there, your patch should be OK.

@egbertbouman
Copy link
Member

@qstokkink Do you want the honor of making a PR for this?

@qstokkink
Copy link
Contributor Author

What I posted here is probably super flimsy though. I am completely open to more.. mature fixes.

We should also add this version to our validation experiment https://jenkins-ci.tribler.org/job/validation_experiments/job/validation_experiment_libtorrent_compatibility/. This is the default on Ubuntu 20.04 after all.

@qstokkink
Copy link
Contributor Author

Looking at:

https://github.com/arvidn/libtorrent/blob/RC_1_2/bindings/python/src/alert.cpp#L636-L638

The endpoint property seems to be gated behind TORRENT_ABI_VERSION == 1. I am unsure what this means.

@qstokkink
Copy link
Contributor Author

It seems that means its deprecated to use the endpoint:

https://github.com/arvidn/libtorrent/blob/RC_1_2/include/libtorrent/aux_/export.hpp#L41-L45

I guess we'll have to use getattr then anyway.

@qstokkink
Copy link
Contributor Author

Alright, I think I have enough information to make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants