User cannot modify their profile info or picture

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

One user cannot update his profile information. In fact, when this user watches their own profile it looks like they are watching the profile of another user.

When the user tries to change their profile picture, the operation fails and the following appears in the atlassian-confluence.log:

java.lang.IllegalArgumentException: Profile picture belongs to a different user. Needed user: EmbeddedCrowdUser{name='username', displayName='User Name', directoryId=123456} attachment belongs to username 
	at com.atlassian.confluence.user.DefaultUserAccessor.setUserProfilePicture(DefaultUserAccessor.java:726)
	at sun.reflect.GeneratedMethodAccessor12011.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
...

診断

Check that the username in the cwd_user table fully matches the one in the entry for the USERINFO of that particular user in the content table. Be aware that MySQL may trim spaces at the end of the fields before doing comparisons (i.e., ... where username = 'peter' will match username 'peter ').

原因

This is caused by an extra space at the end of the username field in the content table for the entry of the user's USERINFO.

ソリューション

  • Remove the extra spaces from the username for the USERINFO in the content table. Remember to take a backup of your database before applying the changes.

    SELECT CONTENTID FROM CONTENT WHERE USERNAME = '<username>' AND CONTENTTYPE = 'USERINFO';
    
    UPDATE CONTENT
    SET USERNAME='<username>'
    WHERE CONTENTID = <content id for the USERINFO>;
    

    データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

Last modified on Mar 30, 2016

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.