Bug 450905 - Send file function starts transferring the file but freezes and never completes
Summary: Send file function starts transferring the file but freezes and never completes
Status: CONFIRMED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (other bugs)
Version First Reported In: 1.7
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
: 452710 474206 476171 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-27 04:14 UTC by ioo+kde
Modified: 2025-11-10 11:31 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ioo+kde 2022-02-27 04:14:30 UTC
SUMMARY
***
Cannot send any files with KDE Connect, file transfer starts successfully and freezes somewhere before finishing.
***


STEPS TO REPRODUCE
1. Select a file from Android device
2. Click Share
3. Select KDE Connect icon 
4. File on PC starts to copy "Receiving file"
5. Progress bar gets 1/2 way and freezes.
6. File never completes. It never times out it just stops receiving.

Try this with many files, each one starts the transfer and stops at a different place never completing the file transfer. I do not know if the problem is with the Android app or the KDE connect software on the PC.

OBSERVED RESULT
I have tried two different network connections and two devices. None of them can transfer the file, they transfer a part of it and then just stop.

EXPECTED RESULT
I would expect that KDE connect would send a file successfully. If there were some connection issue it will either notify of the issue or timeout. Currently it just stops and nothing happens until the user presses the stop button to cancel the transfer.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.24
KDE Plasma Version: 5.24.1
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Comment 1 ioo+kde 2022-03-03 15:47:15 UTC
Please let me know if there is anything else I can provide to assist with this bug. I can reproduce it ever time. It has never worked.
Comment 2 ioo+kde 2022-03-03 15:54:22 UTC
I just upgraded to version 1.19.1 and the problem persists. It doesn't matter what type of file I am sending. The file transfer starts to send. I can see a *.part file in the destination folder. The transfer progresses to around 80-90% then it just stops. It never timesout of fails it just freezes and never completes.
Comment 3 Rigoberto Leyva Salmeron 2023-03-20 18:49:14 UTC
Having the same issue with Android 11 and KDE Neon. 

When transferring 17 photos only 9 are actually transferred - the notification of "transferring" stays on the lower left of screen.
Comment 4 TraceyC 2024-05-14 01:26:32 UTC
I was able to reproduce a similar problem testing #452710

1. On my Android, I opened KDE Connect and selected Send Files
2. From the DCIM folder I selected 6 png files
3. Tapped Select

Result:
On the Android, KDE Connect reports "Failed sending 6 of 6 files to <system name>"
On the laptop, KDE Connect says
Receiving file
6 files to Downloads

I attempted to transfer one text file, 67.21 KB
67.21 KB = 65.634765625 KiB

In Dolphin, the file was present in the Download folder with a size of 65.6IiB
The notification pop up had a bar that just kept going back and forth.
Inspecting the file, it looked complete
I force closed KDE Connect.

Attempting to send the same file a second time also succeeded and this time the laptop notification showed the transfer as complete.
Another text file sent completed normally.

After that, I was able to successfully send 6 jpg files from the phone's DCIM folder on the SD Card (also from DCIM on internal storage)
Sending 12 images was successful, as was 30

In summary:
The first few attempts at sending files succeeded but the phone said it failed and the laptop notification hung
After force closing KDE Connect and restarting it, file transfers worked as normal, no error on Android and the notification did the right thing
Comment 5 TraceyC 2024-05-14 01:27:13 UTC
*** Bug 452710 has been marked as a duplicate of this bug. ***
Comment 6 TraceyC 2024-05-14 01:33:05 UTC
My system info

Operating System: Solus 4.5
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.6.3
Kernel Version: 6.8.9-289.current (64-bit)
Graphics Platform: Wayland
Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: Dell Inc.
Product Name: XPS 17 9710
Comment 7 TraceyC 2024-05-14 01:35:50 UTC
*** Bug 474206 has been marked as a duplicate of this bug. ***
Comment 8 TraceyC 2024-05-14 01:36:37 UTC
*** Bug 476171 has been marked as a duplicate of this bug. ***
Comment 9 skierpage 2024-05-26 21:31:18 UTC
This happened to me today. I think the last time I transferred Android -> Linux and it worked might have been May 8. My behavior is a little different. I share a picture from Google Photos or Google Files and quickly get an Android notification from KDE Connect version 1.30.1 "Failed sending file to fedlaptop", while KDE Connect 24.02-2 on my laptop pops up a "Receiving file" progress notification that never completes. But unlike @TraceyC, I don't see any partial files.

I Force stop'd KDE Connect on Android and restarted, and now sending files results in a fast notification "Receiving file (Failed) Received incomplete file: Error opening file:~/Documents/temp/<IMAGE FILENAME>: No such file or directory." I ran strace on the kconnectd PID and saw lines like:
    [pid  2402] statx(AT_FDCWD, "~/Documents/temp/2024-05-26_SFJAZZ_Holland_Potter_Hussain.png",
             AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_ALL, 0x7fffd73ee8d0) = -1
             ENOENT (No such file or directory)
Hold on, syscalls don't know about '~' for home directory!

WORKAROUND: After I went into System Settings > KDE Connect > Share and receive > Configure and changed the "Save files in" path to a full path with no '~'  (i.e. /home/MYUSERNAME/SOME/PATH), sending files worked! 👈 People, try this.

It seems the fix in kdeconnect is to expand ~ before handing the path to lower-level software. (Or, worse, disallow ~ in the file chooser dialog.) I've used KDE Connect so long I can't remember what its default Save path was, but until it failed I hadn't changed it for months.
Comment 10 skierpage 2024-05-27 00:29:47 UTC
(In reply to skierpage from comment #9)
> It seems the fix in kdeconnect is to expand ~ before handing the path to
> lower-level software.
If this is the problem, it could be in how share/shareplugin.cpp calls:
    QUrl dir = QUrl::fromLocalFile(config()->getString(QStringLiteral("incoming_path"), defaultDownloadPath));
I don't think this does anything with "~" in the path, and it's unclear if QUrl understands a "~" in a file URL, and then KIO::mkpath(dir) fails. (As an aside, with decent language support for typing, it should be impossible to pass an unparsed path string with ~, $HOME, %1 or whatever into a function that takes an O.S. path -- rewrite it in Rust ;-) .) 

> I've used KDE Connect so long I can't remember what its default Save path was.
I think it uses QStandardPaths::DownloadLocation which defaults to "~/Downloads".

If I run `/usr/libexec/kdeconnectd --replace` in a terminal (I can never remember how to view qWarning() output), sending a file from Android prints:
  2024-05-26T17:19:51 default: couldn't create QUrl("file:~/Downloads")
  2024-05-26T17:19:51 default: couldn't create QUrl("file:~/Downloads")
  2024-05-26T17:19:52 default: QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.
  2024-05-26T17:19:52 default: QIODevice::write (QFile, "~/Downloads/MYIMAGEFILE.jpg"): device not open
  ...

Hope this helps.
Comment 11 danic 2025-11-10 11:31:16 UTC
Dont know if related: in my case I consistently cannot share images taken with org.codeaurora.snapcam (will show "Received incomplete file" on desktop). Any other file or pictures taken with a different camera app shares normally. 
kdeconnect desktop version 25.08.2
Android app version 1.34.1

Logs on desktop are simply: 

kdeconnect.core: It is a known device "OnePlus 10T 5G"
kdeconnect.plugin.share: File transfer
kdeconnect.core: FileTransferJob Downloading payload to QUrl("file:///home/daniel/Downloads/AGC_20251110_120941676.jpg") size: 2769985
kdeconnect.core: Received incomplete file ( 4921170 / 2769985 bytes ), deleting
kdeconnect.plugin.share: File transfer failed. QUrl("file:///home/daniel/Downloads/AGC_20251110_120941676.jpg")

Mobile logs show its deliberately sending 4921170 bytes:
11-10 12:19:35.527  9268 18263 I KDE/LanLink: Beginning to send payload for kdeconnect.share.request
11-10 12:19:35.541  9268  9268 D VRI[MainActivity]: onFocusEvent true
11-10 12:19:35.542  9268  9284 D VRI[ShareActivity]: dispatchAppVisibility visible:false
11-10 12:19:35.553  9268  9268 D VRI[ShareActivity]: visibilityChanged oldVisibility=true newVisibility=false
11-10 12:19:35.553  9268  9268 D callGcSupression: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
11-10 12:19:35.553  9268  9268 D VRI[ShareActivity]: setWindowStopped stopped:true
11-10 12:19:35.558  9268  9268 W WindowOnBackDispatcher: sendCancelIfRunning: isInProgress=false callback=android.app.Activity$2@67bd418
11-10 12:19:35.559  9268  9268 D OplusScrollToTopManager: org.kde.kdeconnect_tp/org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity,window dying
11-10 12:19:35.559  9268  9268 D OplusScrollToTopManager: org.kde.kdeconnect_tp/org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity,unregisterSystemUIBroadcastReceiver 
11-10 12:19:35.559  9268  9268 D OplusScrollToTopManager: org.kde.kdeconnect_tp/org.kde.kdeconnect.Plugins.SharePlugin.ShareActivity, unregisterSystemUIBroadcastReceiver failed java.lang.IllegalArgumentException: Receiver not registered: android.view.OplusScrollToTopManager$2@c110705
11-10 12:19:35.565  9268  9268 D HWUI    : RenderProxy::destroy: this=0xb400007d1453bd00, mContext=0xb400007d2d377b40
11-10 12:19:35.565  9268  9792 D HWUI    : SkiaOpenGLPipeline::setSurface: this=0xb400007c96cbfbc0, surface=NULL
11-10 12:19:35.565  9268  9792 D BufferQueueProducer: [VRI[ShareActivity]#46(BLAST Consumer)46](id:24340000002e,api:1,p:9268,c:9268) disconnect: api 1
11-10 12:19:35.565  9268  9792 D BLASTBufferQueue: [VRI[ShareActivity]#46](f:0,a:2) destructor()
11-10 12:19:35.565  9268  9792 D BufferQueueConsumer: [VRI[ShareActivity]#46(BLAST Consumer)46](id:24340000002e,api:0,p:-1,c:9268) disconnect
11-10 12:19:35.579  9268  9268 D callGcSupression: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
11-10 12:19:35.579  9268  9268 W VRI[MainActivity]: handleResized abandoned!
11-10 12:19:35.738  9268 18263 I KDE/LanLink: Finished sending payload (4921170 bytes written)