Bug 451836 - Unable to sync podcasts more than once
Summary: Unable to sync podcasts more than once
Status: RESOLVED FIXED
Alias: None
Product: kasts
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: bart
URL:
Keywords:
: 451306 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-03-23 21:33 UTC by bugs.kde@nordcomputer.de
Modified: 2022-06-01 07:09 UTC (History)
3 users (show)

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


Attachments
Screenshot: syncronisation is still disabled (65.46 KB, image/png)
2022-04-07 20:02 UTC, ccamara
Details
publickey - ccamara@pm.me - 0xD439405D.asc (1.75 KB, application/pgp-keys)
2022-04-08 17:36 UTC, ccamara
Details
signature.asc (509 bytes, application/pgp-signature)
2022-04-08 17:36 UTC, ccamara
Details
Log of successful sync (first setup) (23.66 KB, text/plain)
2022-05-07 14:14 UTC, ccamara
Details
Log of failing sync (1.51 KB, text/plain)
2022-05-07 14:15 UTC, ccamara
Details
publickey - ccamara@pm.me - 0xD439405D.asc (1.75 KB, application/pgp-keys)
2022-05-30 18:24 UTC, ccamara
Details
signature.asc (509 bytes, application/pgp-signature)
2022-05-30 18:24 UTC, ccamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugs.kde@nordcomputer.de 2022-03-23 21:33:31 UTC
SUMMARY
When configuring the sync function (nextcloud sync), the sync just works until kasts gets closed.
When reopen the software, sync is disabled. When trying to login again, the password field is empty and even if it gets set again, sync stays disabled.
Running the flatpak as root (sudo -i) works as expected.



STEPS TO REPRODUCE
1. Install Kasts Flatpak and open it
2. Configure Synchronization for nextcloud-gpodder sync.
3. Sync your podcasts
4. Close Kasts
5. Reopen Kasts

OBSERVED RESULT
Synchronizsation is disabled and sync is not working anymore, even if you try to re-enter your credentials and url.

EXPECTED RESULT
Sync should work, even after closing and reopening Kasts.

SOFTWARE/OS VERSIONS
Linux: Debian Bookworm
Kasts Version: 22.02 (Flatpak)
Comment 1 bart 2022-03-24 08:38:42 UTC
*** Bug 451306 has been marked as a duplicate of this bug. ***
Comment 2 bart 2022-03-24 08:55:44 UTC
Thanks for reporting.  This is a bit puzzling though, as this works for me under all the scenarios that I'll list below.

Kasts will try to save passwords first to the current keyring through the "secret service".  In that case you should see a popup from the keyring when you have entered the password the first time (e.g. kde wallet, gnome keyring or keepassxc).  Did you see such a popup?

If not, kasts will try to fall back to saving the password to a local file.  This should be in `~/.var/app/org.kde.kasts/data/KDE/kasts`.  The filename should be equal to the username and should contain the password.  Is this indeed the case?

(You mentioned that it does work as root.  Running as root will change the config and data directory for the flatpak.  So that might indicate that there is an issue with the configuration under `./var` of your regular user account.)

If not, you could enable debug for the sync routine to try and find out what's going on.  You can do this by e.g. running the following from the command line:
`QT_LOGGING_RULES=org.kde.kasts.sync=true flatpak run org.kde.kasts`.
Then look for lines on the stdout that mention keychain and/or password files.
Comment 3 bugs.kde@nordcomputer.de 2022-03-24 11:33:54 UTC
(In reply to bart from comment #2)
> Thanks for reporting.  This is a bit puzzling though, as this works for me
> under all the scenarios that I'll list below.
> 
> Kasts will try to save passwords first to the current keyring through the
> "secret service".  In that case you should see a popup from the keyring when
> you have entered the password the first time (e.g. kde wallet, gnome keyring
> or keepassxc).  Did you see such a popup?
> 
> If not, kasts will try to fall back to saving the password to a local file. 
> This should be in `~/.var/app/org.kde.kasts/data/KDE/kasts`.  The filename
> should be equal to the username and should contain the password.  Is this
> indeed the case?
> 
> (You mentioned that it does work as root.  Running as root will change the
> config and data directory for the flatpak.  So that might indicate that
> there is an issue with the configuration under `./var` of your regular user
> account.)
> 
> If not, you could enable debug for the sync routine to try and find out
> what's going on.  You can do this by e.g. running the following from the
> command line:
> `QT_LOGGING_RULES=org.kde.kasts.sync=true flatpak run org.kde.kasts`.
> Then look for lines on the stdout that mention keychain and/or password
> files.

Hey there,

I knew about the config files in .var - so I tried to delete the configuration (folder) and start over again. The folder and the configuration gets recreated as expected. But the result is the same. 

I even tried to copy the folder from the root user to my actual user (and chown folder and files), since I know, sync works on the root user. Unfortunately, that did not work either. 

After your reply, I once again deleted the folder and started kasts with logging enabled as you mentioned. 
The first time, I configure sync, this was the relevant part:

org.kde.kasts.sync: Save the password to the keychain for "my_nextcloud_username"
org.kde.kasts.sync: Password saved to keychain
org.kde.kasts.sync: Finished device update request
 (It syncs a first time)

After closing casts and reopening it, the password field is empty again and stdout says:

org.kde.kasts.sync: Save the password to the keychain for "my_nextcloud_username"

But sync keeps being disabled. Also, I got no prompt for the keychain (never happened in Kasts). 
Also, there is no file in '~/.var/app/org.kde.kasts/data/KDE/kasts' containing the password.

Is it correct, that "my_nextcloud_username" is used in the keyring and not my linux username?
Comment 4 bart 2022-03-24 12:40:06 UTC
Yes, that's correct: "my_nextcloud_username" is used to store the password in the keychain.

Anyway, the debug output clearly shows that you have a keychain service running in the background.  I have the impression that that service is not returning the stored password.  That would also explain why clearing .var or copying working .var directories doesn't work.

Do you know which keychain that is?  What would happen if you disable or remove that service?
Comment 5 bugs.kde@nordcomputer.de 2022-03-24 13:08:36 UTC
I am using the gnome-keyring and also keepass2 as my normal password storage, which shouldnt be involved in this (hopefully).
By "using gnome-keyring" I mean, its installed and it manages my ssh-keys etc. I think, its a bit to elementary baked into my system to uninstall it...
Comment 6 bart 2022-03-24 13:28:58 UTC
Ok, no problem.  I had KDE wallet interfere on my machine in the past, so I just uninstalled it since I wasn't using it at all.  (Now using keepassxc without any issues.)  I'm not suggesting removing stuff you actually use and/or require. :-)

At least it's clear now that it might be related to gnome-keyring.
Maybe a wild idea, but could you perhaps check the gnome-keyring settings to make sure that apps can connect to it to store/retrieve secrets.  Just thinking about potential permission settings...
Comment 7 bugs.kde@nordcomputer.de 2022-03-24 13:37:18 UTC
I found the entry for Kasts in the keyring earlier and deleted it. After deleting the Kasts folder in var and reopening Kasts, I entered my credentials again. The entry got created again in the keyring. Without any description. Its just the password and the app_id is org.kde.kasts.

Not sure, if it is maybe an xorg/wayland thing, although normally wayland is the problematic one. This time, the entry in the keyring exclusively gets created in wayland.

Neverless, the sync still doesnt work after restarting. I am installing debian testing in a VM (Gnome-boxes) now, and try to reproduce the bug.
Comment 8 bart 2022-03-24 14:06:21 UTC
It's correct that only the password is stored in the keychain along with the app name, and not the username.  That's intended behaviour (and I think also a limitation of the secret service protocol).

It's very curious that it's stored correctly, but can't be retrieved...

BTW all the secret service stuff in kasts goes through the qtkeychain library, which is a dependency.  It's really starting to look like an upstream issue in that library.  Or at least the combination of qtkeychain and gnome-keyring (and potentially flatpak as well).
Comment 9 bugs.kde@nordcomputer.de 2022-03-24 15:30:05 UTC
So, I was able to reproduce the behaviour in a fresh debian testing vm. Maybe thats the way, you can try to recreate it yourself?
Comment 10 ccamara 2022-03-25 08:28:35 UTC
I can confirm the same bug.
Using KDE Neon and Kasts 22.02. 

I no longer can sync any podcast via gpodder, even introducing credentials. 
It used to work before last update.
Comment 11 bart 2022-03-25 08:52:17 UTC
> I can confirm the same bug.
> Using KDE Neon and Kasts 22.02. 
> 
> I no longer can sync any podcast via gpodder, even introducing credentials. 
> It used to work before last update.

This is also with the flatpak version?

It seems like this issue is very much related: https://discourse.flathub.org/t/loading-of-passwords-via-libsecret-sometimes-not-working/2036

That could also explain why it stopped working, because libsecret was added (by another KDE maintainer) to the flatpak build about a month ago.  I guess that before that point in time, passwords were just stored as plaintext within the flatpaks.
Comment 12 ccamara 2022-03-25 10:26:40 UTC
(In reply to bart from comment #11)
> > I can confirm the same bug.
> > Using KDE Neon and Kasts 22.02. 
> > 
> > I no longer can sync any podcast via gpodder, even introducing credentials. 
> > It used to work before last update.
> 
> This is also with the flatpak version?

Yes, I can confirm that I'm using the flatpak version and I am experiencing that error.
Comment 13 ccamara 2022-04-07 20:02:20 UTC
Created attachment 148031 [details]
Screenshot: syncronisation is still disabled

After updating Kasts to 22.02 via flatpak, the problem still persists: the syncronisation is still disabled.
Comment 14 bart 2022-04-07 20:08:25 UTC
(In reply to ccamara from comment #13)
> Created attachment 148031 [details]
> Screenshot: syncronisation is still disabled
> 
> After updating Kasts to 22.02 via flatpak, the problem still persists: the
> syncronisation is still disabled.

I assume that you already tried again after removing the local settings in ~/.var/app/org.kde.kasts?

Do you have a keychain program running?  I tested this with keepassxc myself, and that works.  I didn't try (yet) without keychain app or with e.g. kde wallet.  I will try to do that next.

Could you perhaps try the commands mentioned above to get some debug info printed to stdout related to the sync procedure?
Comment 15 ccamara 2022-04-08 17:36:05 UTC
Created attachment 148055 [details]
publickey - ccamara@pm.me - 0xD439405D.asc

Thank you, it works now!

1. I removed ~/.var/app/org.kde.kasts
2. Ran kasts
3. Sync with gpodder is working!




Carlos Cámara-Menoyo
https://carloscamara.es/en
https://carloscamara.es


------- Original Message -------
El dijous, 7 de abril 2022 a les 21:08, <bugzilla_noreply@kde.org> va escriure:


> https://bugs.kde.org/show_bug.cgi?id=451836
> 

> --- Comment #14 from bart@mogwai.be ---
> (In reply to ccamara from comment #13)
> 

> > Created attachment 148031 [details]
> > Screenshot: syncronisation is still disabled
> > 

> > After updating Kasts to 22.02 via flatpak, the problem still persists: the
> > syncronisation is still disabled.
> 

> 

> I assume that you already tried again after removing the local settings in
> ~/.var/app/org.kde.kasts?
> 

> Do you have a keychain program running? I tested this with keepassxc myself,
> and that works. I didn't try (yet) without keychain app or with e.g. kde
> wallet. I will try to do that next.
> 

> Could you perhaps try the commands mentioned above to get some debug info
> printed to stdout related to the sync procedure?
> 

> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 16 ccamara 2022-04-08 17:36:05 UTC
Created attachment 148056 [details]
signature.asc
Comment 17 ccamara 2022-04-10 20:24:49 UTC
Hello again,

I'm afraid that I was too hasty. After starting Kasts again, the sync stopped working.

I'm not sure of having understood what you were mentioning about keychain and how to debug it further, but happy to do it.
Comment 18 bart 2022-04-20 06:09:56 UTC
(In reply to ccamara from comment #17)
> I'm not sure of having understood what you were mentioning about keychain
> and how to debug it further, but happy to do it.

You can enable debug by starting kasts through the following command from the CLI:
QT_LOGGING_RULES=org.kde.kasts.sync=true flatpak run org.kde.kasts

This will start the flatpak version of kasts and print debug info related to the sync procedure to stdout.

If you could paste the output of a sync that has succeeded (probably after deleting .var/app/org.kde.kasts and removing the entry from the keychain), and of a sync that has failed, that would hopefully help me find the root cause.

PS It could be that you have to censor sensitive info before pasting it here.
Comment 19 Bug Janitor Service 2022-05-05 04:35:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 20 ccamara 2022-05-07 14:13:53 UTC
Sorry it took me so long to answer.

I have updated kasts to latest version and the problem persists.

Please find the logs you requested (sorry, I didn't find a way to attach them here):

1. Working sync (I have redacted the urls): https://cloud.montera34.org/index.php/s/ayKQtjxZs398GKL
2. Failing sync: https://cloud.montera34.org/index.php/s/tHgY92ScCJ2awtr
Comment 21 ccamara 2022-05-07 14:14:52 UTC
Created attachment 148641 [details]
Log of successful sync (first setup)
Comment 22 ccamara 2022-05-07 14:15:13 UTC
Created attachment 148642 [details]
Log of failing sync
Comment 23 bart 2022-05-30 17:57:37 UTC
I think I've finally found the cause and a workaround.

I've submitted a PR to flathub to implement the workaround.  Once it's merged, the issue should be solved. :fingers_crossed:
https://github.com/flathub/org.kde.kasts/pull/7
Comment 24 ccamara 2022-05-30 18:24:22 UTC
Created attachment 149338 [details]
publickey - ccamara@pm.me - 0xD439405D.asc

Great news, Bart!

Thanks for dealing with it (and for developing kasts, which is great!)



Carlos Cámara-Menoyo
https://carloscamara.es/en
https://carloscamara.es


------- Original Message -------
El dilluns, 30 de maig 2022 a les 18:57, <bugzilla_noreply@kde.org> va escriure:


> https://bugs.kde.org/show_bug.cgi?id=451836
> 

> --- Comment #23 from bart@mogwai.be ---
> I think I've finally found the cause and a workaround.
> 

> I've submitted a PR to flathub to implement the workaround. Once it's merged,
> the issue should be solved. :fingers_crossed:
> https://github.com/flathub/org.kde.kasts/pull/7
> 

> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 25 ccamara 2022-05-30 18:24:22 UTC
Created attachment 149339 [details]
signature.asc
Comment 26 bart 2022-05-31 06:09:07 UTC
The issue should now be solved with the latest flathub package update.  (At least, it solved it for me.)
Can anyone please check and report back?
Comment 27 ccamara 2022-06-01 07:02:04 UTC
It is working now! Thanks Bart!
Comment 28 bart 2022-06-01 07:09:35 UTC
Thanks for the feedback!