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

mconnect creates and renames files non-stop in ~/.cache/mconnect #68

Open
moviuro opened this issue Jun 20, 2023 · 8 comments
Open

mconnect creates and renames files non-stop in ~/.cache/mconnect #68

moviuro opened this issue Jun 20, 2023 · 8 comments

Comments

@moviuro
Copy link

moviuro commented Jun 20, 2023

I noticed heavy usage of my drive, caused by mconnect

% { strace mconnect } 2>&1| grep --line-buffered .cache/mconnect/devices....... | pv >/dev/null
30,0KiB 0:00:01 [30,0KiB/s] [  <=>                                                                                                                 ]

Sample log:

...
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.UYPW61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.UYPW61", "/home/moviuro/.cache/mconnect/devices") = 0
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.JXTW61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.JXTW61", "/home/moviuro/.cache/mconnect/devices") = 0
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.X8LW61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.X8LW61", "/home/moviuro/.cache/mconnect/devices") = 0
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.6POW61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.6POW61", "/home/moviuro/.cache/mconnect/devices") = 0
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.9BRV61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.9BRV61", "/home/moviuro/.cache/mconnect/devices") = 0
openat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices.SHKV61", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 13
newfstatat(AT_FDCWD, "/home/moviuro/.cache/mconnect/devices", {st_mode=S_IFREG|0644, st_size=6534, ...}, AT_SYMLINK_NOFOLLOW) = 0
rename("/home/moviuro/.cache/mconnect/devices.SHKV61", "/home/moviuro/.cache/mconnect/devices") = 0
...
% mconnect -d
...
** INFO: 15:25:30.795: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.798: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.798: devicechannel.vala:270: received line: {"id":1687267531432,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.798: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.798: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.798: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.798: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530798,"body":{"pair":true}}

** INFO: 15:25:30.798: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.803: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.803: devicechannel.vala:270: received line: {"id":1687267531434,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.803: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.803: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.803: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.803: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530803,"body":{"pair":true}}

** INFO: 15:25:30.803: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.806: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.806: devicechannel.vala:270: received line: {"id":1687267531440,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.806: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.806: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.806: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.806: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530806,"body":{"pair":true}}

** INFO: 15:25:30.807: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.811: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.811: devicechannel.vala:270: received line: {"id":1687267531443,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.811: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.811: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.811: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.811: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530811,"body":{"pair":true}}

** INFO: 15:25:30.811: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.814: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.814: devicechannel.vala:270: received line: {"id":1687267531448,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.814: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.814: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.814: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.814: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530814,"body":{"pair":true}}

** INFO: 15:25:30.814: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.820: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.820: devicechannel.vala:270: received line: {"id":1687267531452,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.820: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.820: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.820: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.820: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530820,"body":{"pair":true}}

** INFO: 15:25:30.820: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
** (mconnect:378616): DEBUG: 15:25:30.825: devicechannel.vala:285: check for IO, conditions: 0x1
** (mconnect:378616): DEBUG: 15:25:30.825: devicechannel.vala:270: received line: {"id":1687267531459,"type":"kdeconnect.pair","body":{"pair":true}}
** (mconnect:378616): DEBUG: 15:25:30.825: device.vala:418: pair in progress: false is paired: true pair: true
** (mconnect:378616): DEBUG: 15:25:30.825: device.vala:433: unsolicited pair change from device, pair status: true
** (mconnect:378616): DEBUG: 15:25:30.825: device.vala:275: start pairing
** (mconnect:378616): DEBUG: 15:25:30.825: devicechannel.vala:229: send data: {"type":"kdeconnect.pair","id":1687267530825,"body":{"pair":true}}

** INFO: 15:25:30.825: devicemanager.vala:190: device cda1530b_39c8_4e7e_add9_c09c32518d31-Oneirophrenia-phone-7 pair status change: true
...
@moviuro
Copy link
Author

moviuro commented Jun 20, 2023

Removing this line seems to fix the issue. I have no idea about the side effects though.

this.pair.begin (false);

@hedgehog1029
Copy link

i'm seeing this behaviour as well - I wonder if the mobile app changed behaviour to cause this?

from poking around the code last night, that seems like a reasonable solution. though the code also seems to love calling handle_pair(true) all over the place... not sure why.

@albertvaka
Copy link

I think this is because of a change I ended up reverting, here: https://invent.kde.org/network/kdeconnect-android/-/commit/e4743002be768261a4eab288326bcebf11a308aa

I just released 1.26.1 with this revert, let me know if it fixes the issue for you :)

@moviuro
Copy link
Author

moviuro commented Jun 30, 2023

@albertvaka now I'm having to re-pair my machine upon mconnect (426.3991150-99) (re)start, sometimes multiple times in a row; as well as when the Android app (1.26.2) (re)starts.

But the present issue (infinite rewrites) is no longer present.

Edit: just noticed that bug report should probably have gone to https://github.com/grimpy/mconnect which is the upstream for https://aur.archlinux.org/packages/mconnect-git

@albertvaka
Copy link

In the Play Store analytics I can see lots of crashes when the app is trying to restore a saved paired device. The errors seem to be because the certificate isn't properly stored. I wonder if the crashes are all coming from mconnect users for some reason specific to this implementation, or if they come from devices that have some particularity that I still don't know. If you could attach the Android logs after pairing and also after the error happens, hopefully we can find something interesting/useful there.

@xlucn
Copy link

xlucn commented Jul 20, 2023

I am also running into mconnect requesting pairing a lot of times when I unlock the Android phone. This happens in the few recent android app versions (1.26.x).

Is that an issue of the android app, or is mconnect simply not supporting some new changes of the android app?

@albertvaka
Copy link

I'm the maintainer of the KDE Connect Android app. I'm not sure why this is happening to some users. It would be really useful if someone can send me the Android app logs to debug this, ideally from the latest version (1.27.x).

@albertvaka
Copy link

albertvaka commented Jul 29, 2023

I just released version 1.27.1, which might (maybe, hopefully) fix the issue with having to pair the devices again and again. Let me know if it works.

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

No branches or pull requests

4 participants