Bug 315306 - Amarok forgets my last.fm user and password
Summary: Amarok forgets my last.fm user and password
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Services/Last.fm (show other bugs)
Version: 2.7.0
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords:
: 317391 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-17 07:45 UTC by Lutring Márk
Modified: 2013-07-29 23:46 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8


Attachments
file list (38.62 KB, text/plain)
2013-07-28 11:59 UTC, George Machitidze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lutring Márk 2013-02-17 07:45:17 UTC
When i quit from amarok it forgets my datas and i have to set it again. I tried to write it into the amarokrc file int ~/.kde/share/config/, but it didn't helped. I tried to compile amarok by own and it produced the same bug. And i tried to delete my old configurations but the same...

Reproducible: Always

Steps to Reproduce:
1.Write your user and passwrd into options/plugins/last.fm
2.restart amarok
3.it should be empty and amarok won't scroble
Actual Results:  
The fields are empty again

Expected Results:  
The fields should be filed, and amarok should scroble my datas without i have to rewrite my user/password

I'm using Kubuntu raring, AMD64
Comment 1 Matěj Laitl 2013-02-17 11:31:21 UTC
(In reply to comment #0)
> When i quit from amarok it forgets my datas and i have to set it again. I
> tried to write it into the amarokrc file int ~/.kde/share/config/, but it
> didn't helped.

Hi, amarokrc file is not designed to we written to by hand (unless otherwise noted). To save Last.fm password, just please enter it to Last.fm config dialog and hit OK. Amarok should try to save the credentials to KWallet, if it is not available, it should ask you whether to store the data in plain-text.

If this still doesn't work, please copy & paste the [Service_LastFm] section of the amarokrc here as written by Amarok (not you; feel free to replace any password by asterisks or whatever).
Comment 2 Lutring Márk 2013-02-17 15:53:00 UTC
I wrote user/password to amarokrc after i've tried to save with the program... i'm using kwallet with "empty password". can it be a problem?
Comment 3 Matěj Laitl 2013-02-17 16:08:07 UTC
(In reply to comment #2)
> I wrote user/password to amarokrc after i've tried to save with the
> program...

No need to reason your action, just please do what instructed to do in comment #2.

> i'm using kwallet with "empty password". can it be a problem?

No.
Comment 4 Lutring Márk 2013-02-17 16:10:31 UTC
i say again... it doesn't work...
Comment 5 Matěj Laitl 2013-02-17 16:12:46 UTC
(In reply to comment #4)
> i say again... it doesn't work...

I say again... If this still doesn't work, please copy & paste the [Service_LastFm] section of the amarokrc here as written by Amarok (not you; feel free to replace any password by asterisks or whatever).
Comment 6 Lutring Márk 2013-02-17 16:13:41 UTC
[Service_LastFm]
announceCorrections=true
fetchSimilar=true
kWalletUsage=0
scrobble=true
scrobbleComposer=true
sessionKey=57187419f27a86e2587bb2b1a0ca2254
useFancyRatingTags=true
Comment 7 Matěj Laitl 2013-02-17 16:47:43 UTC
(In reply to comment #6)
> [Service_LastFm]
> announceCorrections=true
> fetchSimilar=true
> kWalletUsage=0
> scrobble=true
> scrobbleComposer=true
> sessionKey=57187419f27a86e2587bb2b1a0ca2254
> useFancyRatingTags=true

This is strange and I totally cannot reproduce this. I quit Amarok, replace my [Service_LastFm] with yours, start Amarok, go to Last.fm configuration, enter login and password. KWallet asks me whether to allow Amarok access the Wallet,
 a) I allow -> the lastfm_password and lastfm_username appear in my walled under Amarok app and kWalletUsage chanes to 1 meaning that the password is in KWallet.
 b) I disallow -> Amarok asks me whether to save password in plain-text,
   b1) I allow -> kWalletUsage is changed to 2 and password and username entries appear
   b2) I disallow -> kWalletUsage remains at 0 (no password entered yet)

Where you start to differ above? Do you have allowed Amarok to access the Wallet? If you open the Wallet using KWallet manager, do you see the Amarok entry with username and password? What KDE (kdelibs) version do you have?
Comment 8 Lutring Márk 2013-02-17 18:13:01 UTC
Hmm it is strange, my wallet was disabled... But amarok didn't ask me where i want to store datas... i enabled kwallet and it's okay now... Thank you for your help (but another question, if kwallet doesn't allowed why didn't amarok ask me  the type of storage?)
Comment 9 Myriam Schweingruber 2013-02-23 10:00:27 UTC
(In reply to comment #8)
> Hmm it is strange, my wallet was disabled... But amarok didn't ask me where
> i want to store datas... i enabled kwallet and it's okay now... Thank you
> for your help (but another question, if kwallet doesn't allowed why didn't
> amarok ask me  the type of storage?)

No idea, but that question is better asked in the forum.
Comment 10 Matěj Laitl 2013-02-24 12:24:33 UTC
Git commit 2e5fc7d244afacc4020199b39b54b220fcd00946 by Matěj Laitl.
Committed on 24/02/2013 at 13:18.
Pushed by laitl into branch 'master'.

LastFmServiceConfig: allow going from pwd stored in ASCII to pwd stored in KWallet

...by entering empty username and password.

BUGFIXES:
 * Prevent inability to save Last.fm password in corner cases.
FIXED-IN: 2.8

M  +1    -0    ChangeLog
M  +10   -0    src/services/lastfm/LastFmServiceConfig.cpp

http://commits.kde.org/amarok/2e5fc7d244afacc4020199b39b54b220fcd00946
Comment 11 Matěj Laitl 2013-03-26 18:46:00 UTC
*** Bug 317391 has been marked as a duplicate of this bug. ***
Comment 12 George Machitidze 2013-07-27 17:29:54 UTC
Not fixed in 2.8 beta
I confirm the problem, same for me for 2.7.0 and 2.7.90 (2.8 beta).
Fedora 18, Fedora 19.
Comment 13 Myriam Schweingruber 2013-07-27 17:33:26 UTC
(In reply to comment #12)
> Not fixed in 2.8 beta
> I confirm the problem, same for me for 2.7.0 and 2.7.90 (2.8 beta).
> Fedora 18, Fedora 19.

Did you try with a new user on Amarok 2.8 beta? No need to confirm with 2.7.0, btw, as we do no backports anyway.
Comment 14 George Machitidze 2013-07-27 18:24:32 UTC
Yep, It works only with enabled Kwallet, if kwallet is disabled - it doesn't work.
If it is expected behavior, then I think this bug must be reopened as feature request or improvement. This behavior is very annoying - at least "last.fm" plugin must be disabled in this case somehow to inform user for a problem.
Comment 15 Matěj Laitl 2013-07-27 20:36:06 UTC
(In reply to comment #14)
> Yep, It works only with enabled Kwallet, if kwallet is disabled - it doesn't
> work.
> If it is expected behavior, then I think this bug must be reopened as
> feature request or improvement. This behavior is very annoying - at least
> "last.fm" plugin must be disabled in this case somehow to inform user for a
> problem.

It really should work, asking whether you want to save credentials in ASCII if KWallet isn't available.

 a) Are you really using Amarok 2.8 Beta? What version it says in the about dialog?
 b) what are the exact steps you perform? What is the actual behaviour and what is the expected behaviour?
 c) please paste the [Service_LastFm] section of your ~/.kde/share/config/amarokrc
Comment 16 George Machitidze 2013-07-28 08:39:29 UTC
It didn't ask anything

a) I had Fedora-original 2.7.1, then manually compiled RPM with 2.7.90 sources, installed all dependencies, same result:
[root@giomacdesk ~]# amarok -v
Qt: 4.8.4
KDE Development Platform: 4.10.5
Amarok: 2.7.90
b)
steps:
1. close amarok
2. disable kwallet
3. open amarok
4. close amarok
5. open amarok
6. write last.fm username/password in plugin settings
7. close amarok
8. open amarok
9. check configuration (file/plugin settings etc)
expected:
amarok must save last.fm username/password or ask whether to store it in rc file (if kwallet isn't available)
actual:
nothing is changed, username/password is not stored
c) content doesn't change when disabling wallet etc, kWalletUsage value is always 1
[Service_LastFm]
announceCorrections=false
fetchSimilar=true
filterByLabel=false
filteredLabel=
kWalletUsage=1
scrobble=true
scrobbleComposer=true
sessionKey=0691fd927e1a328354a9e9dec7507b44
useFancyRatingTags=true
Comment 17 Matěj Laitl 2013-07-28 09:59:30 UTC
(In reply to comment #16)
> It didn't ask anything
> 
> a) I had Fedora-original 2.7.1, then manually compiled RPM with 2.7.90
> sources, installed all dependencies, same result:

Hmm, did you first uninstall 2.7.1, or did you just replace 2.7.1 with 2.7.90? Did you install 2.7.90 to the same location as 2.7.1 was? When amarok is running, could you paste output of `lsof -p $(pidof amarok) | grep lastfm`?

I'm asking because it is technically possible (actually, it is quite common for people who have old system package and install the git version on top without tweaking environment variables) for 2.7.90 to pick up 2.7.1 plugins.

I'm totally unable to reproduce your bug and looking at the code, it should be *really* fixed by the commit above.
Comment 18 George Machitidze 2013-07-28 11:59:02 UTC
Created attachment 81401 [details]
file list

rpm -ql amarok output
Comment 19 George Machitidze 2013-07-28 12:03:26 UTC
There is no way to have old files in the system.
I'm not using git, never ever installing anything without RPM. There is _NO WAY_ to have old files.
[root@giomacdesk ~]# rpm -ql amarok >> rpmql-amarok.txt 
[root@giomacdesk ~]# rpm -V amarok
[root@giomacdesk ~]# rpm -q amarok
amarok-2.7.90-0.fc19.x86_64
[root@giomacdesk ~]# rpm -ql amarok|grep lastfm|grep "\.so"
/usr/lib64/kde4/amarok_service_lastfm.so
/usr/lib64/kde4/kcm_amarok_service_lastfm.so
Comment 20 George Machitidze 2013-07-28 12:06:24 UTC
i[root@giomacdesk ~]# lsof -p $(pidof amarok) | grep lastfm
amarok  4690 root  mem       REG              253,1    558096 11799458 /usr/lib64/liblastfm.so.1.0.3
amarok  4690 root  mem       REG              253,1     32264 11812075 /usr/lib64/libamarok_service_lastfm_shared.so
amarok  4690 root  mem       REG              253,1    425712 12462803 /usr/lib64/kde4/amarok_service_lastfm.so
[root@giomacdesk ~]# rpm -qf /usr/lib64/libamarok_service_lastfm_shared.so
amarok-libs-2.7.90-0.fc19.x86_64
[root@giomacdesk ~]# rpm -qf /usr/lib64/liblastfm.so.1.0.3
liblastfm-1.0.3-2.fc19.x86_64
[root@giomacdesk ~]# rpm -qa|grep amarok|sort
amarok-2.7.90-0.fc19.x86_64
amarok-libs-2.7.90-0.fc19.x86_64
amarok-utils-2.7.90-0.fc19.x86_64
[root@giomacdesk ~]#
Comment 21 George Machitidze 2013-07-28 12:09:46 UTC
Also, verified source tarball: LastFmServiceConfig.cpp is patched.
Comment 22 Matěj Laitl 2013-07-28 12:21:35 UTC
On 28. 7. 2013 George Machitidze wrote:
> Also, verified source tarball: LastFmServiceConfig.cpp is patched.

Okay, now I believe you, sorry for the mistrust. I've unfortunately spent 
quite some time debugging already fixed issues in past.

I'll prepare a debugging patch for you to apply. In the mean time, you may try 
running Amarok from console as `amarok --debug --nofork` and watch for any 
suspicious messages while you are saving the credentials.
Comment 23 George Machitidze 2013-07-28 12:45:22 UTC
This is only related part from the debug:
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
amarok(6365)/kdeui (Wallet): The kwalletd service has been disabled 
QObject::connect: Cannot connect (null)::walletOpened(bool) to LastFmServiceConfig::slotWalletOpenedToWrite(bool)
Comment 24 Matěj Laitl 2013-07-29 09:17:14 UTC
On 28. 7. 2013 George Machitidze wrote:
> QObject::connect: Cannot connect (null)::walletOpened(bool) to
> LastFmServiceConfig::slotWalletOpenedToWrite(bool)

That's it! I only tested with Amarok being denied access to KWallet and 
expected disabled KWallet would behave the same, but apparently not.

I think I can fix it pretty soon. Would you be able to test git version?
Comment 25 Matěj Laitl 2013-07-29 20:40:08 UTC
In fact, this is IMO a bug in KWallet (just reported as bug 322964). I'm going to work-around it anyway.
Comment 26 Matěj Laitl 2013-07-29 20:57:13 UTC
Git commit fe9628d596e7546b5526aed9d1dac81d350f75a5 by Matěj Laitl.
Committed on 29/07/2013 at 20:46.
Pushed by laitl into branch 'master'.

LastFmServiceConfig: prompt to save credentials in ASCII even if KWallet is disabled

I believe there is inconsistency in KWallet documentation/behaviour that
lead to assumptions not being fulfilled in credential-saving code. Lessen
the assumptions.

BUGFIXES:
 * Definitely fix a bug where storing Last.fm credentials in plain-text
   isn't offered when KWallet is disabled. (BR 315306)

@Vedant, you might need to incorporate this fix to your
https://git.reviewboard.kde.org/r/110426/
Related: bug 322964
FIXED-IN: 2.8
CCMAIL: Vedant Agarwala <vedant.kota@gmail.com>

M  +2    -0    ChangeLog
M  +20   -4    src/services/lastfm/LastFmServiceConfig.cpp

http://commits.kde.org/amarok/fe9628d596e7546b5526aed9d1dac81d350f75a5
Comment 27 George Machitidze 2013-07-29 23:17:18 UTC
I've added your patch - now everything is working fine - dialog appeared, file changed.
Great job, thanks! :)
p.s. if you'll ever need help in testing - just let me know. Always ready.
Comment 28 Matěj Laitl 2013-07-29 23:46:06 UTC
On 29. 7. 2013 George Machitidze wrote:
> I've added your patch - now everything is working fine - dialog appeared,
> file changed.
> Great job, thanks!
> p.s. if you'll ever need help in testing - just let me know. Always ready.

Oh, good. In fact, the thing you already do (testing betas and RCs as they are 
released and reporting bugs) is the greatest way to help us making Amarok 
greater than ever, so thank *you*.