szimek / sharedrop

Easy P2P file transfer powered by WebRTC - inspired by Apple AirDrop
https://www.sharedrop.io
MIT License
9.99k stars 729 forks source link

transfer stuck #44

Open davidak opened 8 years ago

davidak commented 8 years ago

i was sending a 484 MB big file from Chromium Version 46.0.2490.71 (64-bit) on OS X 10.9.5 to Firefox 43.0.4 on OS X 10.11.1. after one hour its still the same status as some minutes after starting...

bildschirmfoto 2016-01-21 um 12 17 11
szimek commented 7 years ago

I've just started to get the same bug when transferring files from Chrome on Mac to Chrome on Android. Unfortunately, there's no error or anything on the Mac side that could suggest what's wrong, so finding out what's wrong might take a while, especially that I don't have much free time to work on it.

githubtefo commented 7 years ago

Same here from Firefox to Firefox under Linux.

szimek commented 7 years ago

I found out what the error was when transferring files to an Android device - it was caused by lack of free space on the device. Unfortunately, the app doesn't show any error in such case. I'm not sure if the error in your case was also caused by this.

I hope to add a check if browser has access to enough free space before starting the transfer, but unfortunately I don't have much free time, so it rather won't happen any time soon.

githubtefo commented 7 years ago

@szimek thanks for your response. No, it's not a free space issue. The transfer randomly stopped when I send files bigger than a few MB (40MB for example). This happened even under LAN than WAN connections.

szimek commented 7 years ago

I'm using it to transfer files of size 100-200MB almost every day between MacBook Pro and Android tablet and it works fine. If you get this error again, can you check if there are any errors logged in the dev tools console on any device?

githubtefo commented 7 years ago

I found these three errors from the receiver side (none from the sender):

1) 01:08:53.360 QuotaExceededError 1 vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:6:26869 2) 01:08:53.365 File error: abort { target: IDBTransaction, isTrusted: true, currentTarget: IDBTransaction, eventPhase: 2, bubbles: true, cancelable: false, defaultPrevented: false, timeStamp: 1488168533364265, originalTarget: IDBTransaction, explicitOriginalTarget: IDBTransaction, NONE: 0 } 1 share-drop-455507f8b14121a10f7593364cb4b9e1.js:1:29015 n.prototype.errorHandler https://www.sharedrop.io/assets/share-drop-455507f8b14121a10f7593364cb4b9e1.js:1:29015 n.prototype.append/</</</o.onerror https://www.sharedrop.io/assets/share-drop-455507f8b14121a10f7593364cb4b9e1.js:1:28365 3) 01:08:53.385 undefined 1 vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:2:247855 s https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:2:247855 e.default.trigger https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:5:10159 f.prototype._onError/< https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:5:16423 r.prototype.invoke https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:1:89893 r.prototype.flush https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:1:90427 n.prototype.flush https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:1:88459 o.prototype.end https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:1:92683 s/e._autorun< https://www.sharedrop.io/assets/vendor-94f8e0b7be468df8a5ce14f5ae294b7e.js:1:92113

If I switch the sender/receiver side, I obtain the same errors (see the below image)

captura de pantalla de 2017-02-27 01 35 24

szimek commented 7 years ago

@githubtefo QuotaExceededError are errors caused by insufficient free disk space. Browser can't use all the available disk space. The amount it can use is calculated like this (at least for Chrome):

This is calculated from 20% (up to 4 GB) of 1/3 of the available disk space.

If you have 5GB free on your device, 1/3 of it is 1.6GB and 20% of it is ~320MB.

Anyway, I need to add a check for available free space before starting the transfer and show a notification if the file is too big.

githubtefo commented 7 years ago

Thanks @szimek , I didn't know about the available disk space for the browser use. Nevertheless, transfers of files smaller than the 20% of 1/3 of my available disk space also show the same error output. Is there any way to change the available space for browser use?

szimek commented 7 years ago

The docs I sent were for Chrome, maybe in Firefox the limits are different.

You could try to clear all browsing data, but I don't know if it helps. In Chrome you can also go to dev tools -> Application -> Clear storage -> click "Clear site data" button. In Firefox it's a bit different and described here. However, the app should delete any incomplete transfers when it starts to avoid using up free space available to it, so you shouldn't have to clear it manually.

githubtefo commented 7 years ago

I cleaned the site data on both sides, but it wasn't change. Anyway the storage Inspector doesn't show a huge list.

szimek commented 7 years ago

Are you using Chrome or Firefox? I'll try to implement this check for available space, but unfortunately it won't happen anytime soon, unless someone comes with a PR.

githubtefo commented 7 years ago

I'm using Firefox always (at least from one side). Yesterday I also tried with Chrome (Windows)/Firefox (Linux).

szimek commented 7 years ago

@githubtefo Can you try with Chrome on the receiving side and see if you also get this error?

githubtefo commented 7 years ago

@szimek , sorry for the delay. Using Chrome (Win7) on the receiving side I can send a 300MB file without problems from Firefox 52 (Linux).

Jeff-Mich commented 5 years ago

I couldn't find any mention of file size limit except what's mentioned here (20% of 33% of free disk space). I've trying to receive a ~ 7GB file from another network where I have 160GB free and I'm using chrome on win8, sending side is firefox on win10.... it was going along pretty good, from "progress" circle it appears to have got 25% then just stopped. console log doesn't show any quote exception... it looks like the connection was simply disconnected? Here is console log

vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3805 DOMException: Failed to set the 'binaryType' property on 'RTCDataChannel': Blob support not implemented yet at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3805:171 at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3806:279 at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3892:117 share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: idle share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:152 Room: Connecting to: 6557ca2f-5076-4ea1-aefc-e95d1178d5d8 share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:152 Firebase: (Re)Connected share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:153 Room: user_added: Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:152 Firebase: User added to the room share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:153 Room: user_added: Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: idle share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: has_selected_file vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Creating RTCPeerConnection. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for ICE candidates. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for negotiationneeded vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for data channel vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for remote stream share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:161 Peer: Opening data channel connection... o share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: establishing_connection vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: negotiationneeded triggered vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Created offer. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Set localDescription: offer for: a6572620-2cdb-11e9-9191-7b997396198b 2vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Received ICE candidates for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Setting remote description RTCSessionDescription vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Set remoteDescription: ANSWER for: a6572620-2cdb-11e9-9191-7b997396198b 3vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Added ICE candidate for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Data channel connection success share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:160 Peer: Data channel connection opened: o share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: awaiting_response share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:66 Sending a file info... Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:70 Peer: Received file response Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: receiving_file_data share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:168 Peer: File response: Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:76 Peer: Sent file Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: idle vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: ICE connection state is 'disconnected', closing connections to a6572620-2cdb-11e9-9191-7b997396198b share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:160 Peer: Data channel connection error Error: ICE connection state is 'disconnected' at RTCPeerConnection.t.oniceconnectionstatechange [as onicechange] (vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3877) vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Cleaning up PeerConnection to a6572620-2cdb-11e9-9191-7b997396198b share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:161 Peer: P2P connection closed: o vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: DataChannel closed for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Event vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Creating RTCPeerConnection. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for ICE candidates. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for negotiationneeded vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for data channel vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Listening for remote stream vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Setting remote description RTCSessionDescription share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:161 Peer: Opening data channel connection... o 2vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Added ICE candidate for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Set remoteDescription: OFFER for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Created answer. vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Set localDescription: answer for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Received ICE candidates for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Added ICE candidate for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Received ICE candidates for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Received data channel vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Data channel connection success share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:158 Peer: Data channel connection opened: o share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:68 Peer: Received file info Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: received_file_info share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:164 Peer: File info: Object share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:105 Peer: State has changed: sending_file_data vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: ICE connection state is 'disconnected', closing connections to a6572620-2cdb-11e9-9191-7b997396198b share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:158 Peer: Data channel connection error Error: ICE connection state is 'disconnected' at RTCPeerConnection.t.oniceconnectionstatechange [as onicechange] (vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3877) vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Cleaning up PeerConnection to a6572620-2cdb-11e9-9191-7b997396198b share-drop-4a2284aff1d8e3e4885d2450a23abe62.js:161 Peer: P2P connection closed: o vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: DataChannel closed for: a6572620-2cdb-11e9-9191-7b997396198b vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3803 PeerJS: Event

szimek commented 5 years ago

I wanted to add a check that would run after file info is exchanged, to see if there's enough free space available to the browser on the receiving device, but never really had time to do it. The API also allows to request more space, but that would probably trigger some permission dialog in a browser.

That said, I'm not really sure if it was the reason it failed here. I've only tried it with files up to 1.5GB and that was between laptops.

alexmick commented 5 years ago

Getting a similar error on a 4Gb file today despite trying twice. Transfer works like a charm, all 4Gb seem to arrive on my machine (transferring from Chrome 73.0.3683.103 Mac to same version on Windows) but when comes the moment of downloading from filesystem:https://www.sharedrop.io/temporary/1555332641846-file.zip chrome gives me an instant Failed - Network Error because indeed the file is nowhere to be found in my AppData Chrome folder... I have plenty of available space, maybe a limitation in chrome ?