-
Notifications
You must be signed in to change notification settings - Fork 634
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
OnionShare closes before downloading is complete #929
Comments
Hi @g9so , this sounds like #812 - where we found a bug in certain Tor versions that causes exactly this problem, when using v3 onions. On Ubuntu 18.04, the version of Tor shipped seems to be 0.3.2.10 which likely contains this bug. You can try one of three things to see if it stops the issue for you:
Please try either of these and let us know if it fixes it for you. We'll probably need to write some documentation on this issue so long as versions of Tor like 0.3.2.10 remain in popular distributions like Ubuntu. Cheers |
Actually, I just realised 0.3.2.10 is probably too old even for v3 onions, so it's probably not related to that issue at all :( sorry. You could still try a newer upstream version of Tor as above, and see if it helps, in any case. |
Hi @mig5 I have upgraded to the latest stable version of Tor from the Tor Project's repository, but the problem still exists for both v2 and v3 onions. I have done a lot more testing and have found that the bug is actually present in both the CLI and GUI versions. In both the CLI and GUI versions OnionShare reports that the file download has started and will show progress on how much data has been sent as soon as the .onion/slug/download link is visited but before the save button is pressed in Tor Browser. In the CLI version as soon as OnionShare reports that the file has been fully downloaded OnionShare closes and whatever has not been received yet is truncated. In the GUI version OnionShare will report that the file has finished downloading and that sharing has stopped when in fact sharing continues. If OnionShare is closed after it reports that the download is complete and that sharing has stopped but before the download has actually completed the file will be truncated. |
hi @g9so ,
These two are not in fact bugs: OnionShare starts sending the data into the Tor network when Download is clicked (whether or not the client has clicked the Tor Browser dialog to save or open is purely client side stuff - the download is already happening in the background as a temporary file). And there is always a lag between when OnionShare says it's 'completed' sending a share, and what the client side reports, because what it means is that it's sent 100% of the data into the Tor network. The receiving end takes a slight extra time to receive the full file due to that data still traversing the nodes in the Tor circuit, even if OnionShare says it's finished - it can only report on the progress of sending the data into the Tor Network, and vice versa.
Did you close it yourself? Sounds unusual. In my tests on latest Tor, there is no truncating. The file I shared to myself is identical to the original file, on OnionShare 2. At the moment that OnionShare stops serving and the download says it's complete, they are identical files, no truncating. This is the same whether I use the GUI or CLI. On the OnionShare side, I'm using Tor 0.3.5.8 and on the client side I'm using Tor Browser 8.0.6, so Tor 0.3.5.7. I'm not using Ubuntu though. Anyway thanks for your report, perhaps it's OS specific. See what Micah says :) |
To clarify, what I am experiencing is not a slight network delay. OnionShare can send data for more than a minute and accounts for several MB of data after it reports that the download is complete.
Yes, if I close OnionShare after it reports that the download is complete but before Tor Browser reports that the download is complete the file will be truncated. From everything that I have seen it appears that the problem is the result of OnionShare overestimating how much data has been sent and consequently killing itself before the file has actually finished downloading. If OnionShare is configured to to close after the first download then the file will be truncated. If OnionShare is configured to stay open then sharing will continue until the whole file is downloaded without truncation. |
I have done some more testing in a VM and can confirm that the issue is also present when using Ubuntu 18.10. |
Just noting that I did indeed reproduce this today on Ubuntu 18.04 (but don't think it's OS-specific, nor Tor version specific (reproduced on both vanilla Ubuntu and upstream Tor apt repo). It's a very similar bug to #812 and I believe it's probably a Tor, not an OnionShare bug. In #812 the download would truncate once the Onion service stopped. This is similar, except if you leave OnionShare (the app) running (note: I'm not talking about However, if you shut down OnionShare (the app) entirely, severing its Tor connection, this severs the connection immediately on the client side, even though we'd already stopped and removed the .onion service via Stem. CLI probably reproduces this because the entire app exits when the service stops (but I didn't test CLI, only GUI). Over to Micah. Probably going to need a similar PoC to last time, except this time also stopping the Tor connection altogether on the server side. |
I observed this bug between a Ubuntu 20.04 with the official OnionShare PPA (OnionShare 2.2.ppa1, Tor 0.4.2.7) from one side and Fedora 32 with Tor Browser (version 9.0.2, embedded Tor version is The |
I don't reproduce it on the I shared a 100MB file with And I downloaded it with I diffed the original and the downloaded file and they were identical. I wonder if it's been 'accidentally' fixed somehow... |
It still seems to be a bug for me in the latest develop branch. Alas. Taking a look now. |
Okay, this bug is incredibly similar to #812, but with one small difference. With that bug, the circuits were closed when the ephemeral onion service was stopped, even if they were still in use (e.g. the server finished serving/uploading the file but the client hasn't finished downloading it). That was fixed. The problem we're hitting here is when the The bottom of finally:
# Shutdown
app.cleanup()
onion.cleanup() If you just comment out So I think the solution will be to somehow wait until the circuits are complete before killing the tor process... |
When I attempt to share a file using the CLI version of OnionShare 2.0 on Ubuntu 18.04 the file that is received is a truncated version of the original.
Attempting to resend the file will result in a different amount of data truncated.
This bug is only present in the CLI version, the GUI version behaves as expected.
When the --stay-open option is used the whole file will be downloaded correctly but OnionShare will report that the download has completed long before Tor Browser does.
The problem does not appear to occur when sharing vary small files but is consistent when sharing anything around 10 MB or larger.
The text was updated successfully, but these errors were encountered: