Lost Admin Access on xwiki

Hello,

I wanna reorganize the pages for more visibility in the XWiki “Domain”.

I decided to ‘tidy up’ all profiles under a ‘Profiles’ page (which I created) in XWiki. I was doing this with the Admin account, but now I can not log in to the admin account, no possibility to rollback

Is there a solution ?

(Why this option to move profiles is not blocked to avoid this kind of error by the way ???)

Thank you :slight_smile:

The thing is profile are not just profile but the actual users (yes users are wiki pages too) to moving them broke them (the real id of Admin is is actually XWiki.Admin, login allow Admin in input just as a helper).

Yep it should.

So when all seems lost you can call superadmin to the rescue: see http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Configuration/#HEnablesuperadminaccount to get more detail on how to enable it.

You will need to move the profiles back to XWiki space and restore the groups where those users were listed (usually at least XWiki.XWikiAllGroup and XWiki.XWikiAdminGroup groups). The easiest to fix a group usually is to go to the group page, look at the history and Rollback to the version before your move.

Thanks @tmortagne

It works fine now :tada:. Hope this feature will be more safe in the next updates :slight_smile:

none of the admin pages work. I can’t rollback. Seems like the same problem. Superuser also doesn’t seem to have access to the needed macros.

I guess you have an issue with the owner setting of the xwiki. Each macro can only work if the owner and creator of that page has programming rights. If there is any problem with the owner account these macros stop working, which sadly also means the administration macros that would allow you to change the xwiki owner stops working.
This is issue is something that quite regularly get asked in the forum. As far as I can tell it happens when the owner of the xwiki account gets deleted or an complete xwiki export is imported and the accounts get overwritten. With the export / import I had gotten myself into the issue 2 times, luckily I had made snapshots of the Debian VMs before.

Sadly I don‘t know any fix for when it occurs.

An automatism that checks when xwiki gets restarted if there is any issue with the current owner account and if so transfer the ownership to the superadmin would be great, or at least an command line way to manually transfer ownership.

1 Like

I moved the admin user and it didn’t add their group memberships back except for the XWikiAll group. I was trying to get the admin user to overlap with the user I ended up as when I’d login with LDAP. It seems like it actually deleted the admin user and then tried to recreate them (maybe???).

I found in the database backup script (mariadbdump creates sql) where a different user did have access to the admin group. It looked like to create membership there were 3 tables that would need updated, but rather than do that I just stole the permissions for the other user.

Sooooo. In my backup script (replacing usernames with anonymous descriptive names) I had

INSERT INTO `xwikistrings` VALUES
...
(-8529148758944720439,'member','XWiki.TheWikiOwner'),
...
(-7797394894295619824,'member','XWiki.AUserWithGroupAccess'),
(-6335560550745377651,'member','XWiki.AUserWithGroupAccess'),
(-4988087795715508939,'member','XWiki.AUserWithGroupAccess'),
(2311550985183023812,'member','XWiki.AUserWithGroupAccess'),
(3685452955967028165,'member','XWiki.AUserWithGroupAccess'),
(4857828472612607965,'member','XWiki.AUserWithGroupAccess'),
(6517588045560455647,'member','XWiki.AUserWithGroupAccess'),
...

These were all the group memberships for the user and my wiki owner. So just swapped the usernames and restored it. Now my owner was in all the groups the user was, but the user was only in XWikiAll. Once the wiki was working again I could just add the other user’s group memberships back.

INSERT INTO `xwikistrings` VALUES
...
(-8529148758944720439,'member','XWiki.AUserWithGroupAccess'),
...
(-7797394894295619824,'member','XWiki.TheWikiOwner'),
(-6335560550745377651,'member','XWiki.TheWikiOwner'),
(-4988087795715508939,'member','XWiki.TheWikiOwner'),
(2311550985183023812,'member','XWiki.TheWikiOwner'),
(3685452955967028165,'member','XWiki.TheWikiOwner'),
(4857828472612607965,'member','XWiki.TheWikiOwner'),
(6517588045560455647,'member','XWiki.TheWikiOwner'),
1 Like