Roles page fails to load on certain sort options #3890

Closed
opened 2026-02-05 07:46:34 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @jgriffithsuk on GitHub (Jun 29, 2023).

Describe the Bug

When we try to go to the Role page we get a page saying

An Error Occured
An unknown error occured.

When disabling Ldap and logging in locally I still get the issue.

I basically want to create some LDAP groups so they sync the users,

Weirdly it did work once then we I press roles again I go tthe issue,

I have cleared cache and tried a different browser, (also another Pc)

is this a bug?

I am on verion v23.05.1

thanks

Steps to Reproduce

Go to settings then roles

Expected Behaviour

See the roles page

Screenshots or Additional Context

No response

Browser Details

Firefox, Chrome

Exact BookStack Version

v23.05.1

PHP Version

8.1

Hosting Environment

Ubuntu 22.04 LTS

Originally created by @jgriffithsuk on GitHub (Jun 29, 2023). ### Describe the Bug When we try to go to the Role page we get a page saying An Error Occured An unknown error occured. When disabling Ldap and logging in locally I still get the issue. I basically want to create some LDAP groups so they sync the users, Weirdly it did work once then we I press roles again I go tthe issue, I have cleared cache and tried a different browser, (also another Pc) is this a bug? I am on verion v23.05.1 thanks ### Steps to Reproduce Go to settings then roles ### Expected Behaviour See the roles page ### Screenshots or Additional Context _No response_ ### Browser Details Firefox, Chrome ### Exact BookStack Version v23.05.1 ### PHP Version 8.1 ### Hosting Environment Ubuntu 22.04 LTS
OVERLORD added the 🐛 Bug label 2026-02-05 07:46:34 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 29, 2023):

Hi @jgriffithsuk,
Please follow our debugging guidance to gain more detail for the error from your logs:
https://www.bookstackapp.com/docs/admin/debugging/

@ssddanbrown commented on GitHub (Jun 29, 2023): Hi @jgriffithsuk, Please follow our debugging guidance to gain more detail for the error from your logs: https://www.bookstackapp.com/docs/admin/debugging/
Author
Owner

@jgriffithsuk commented on GitHub (Jun 30, 2023):

Hi Dan

With Debug enabled I get this error

Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.created_at' in 'order clause' (SQL: select , (select count() from users inner join role_user on users.id = role_user.user_id where roles.id = role_user.role_id) as users_count, (select count(*) from role_permissions inner join permission_role on role_permissions.id = permission_role.permission_id where roles.id = permission_role.role_id) as permissions_count from roles order by users.created_at desc limit 20 offset 0)

Thanks

From: Dan Brown @.>
Sent: 29 June 2023 17:16
To: BookStackApp/BookStack @.
>
Cc: Jamie Griffiths @.>; Mention @.>
Subject: Re: [BookStackApp/BookStack] LDAP and standard login error on Roles page (Issue #4350)

** This mail originated from OUTSIDE the Oakford corporate network. Treat hyperlinks and attachments in this email with caution. **

Hi @jgriffithsukhttps://github.com/jgriffithsuk,
Please follow our debugging guidance to gain more detail for the error from your logs:
https://www.bookstackapp.com/docs/admin/debugging/


Reply to this email directly, view it on GitHubhttps://github.com/BookStackApp/BookStack/issues/4350#issuecomment-1613479835, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BAIPNJPOZYZDIMCOFGM5OSLXNWS2JANCNFSM6AAAAAAZYPTN6Q.
You are receiving this because you were mentioned.Message ID: @.@.>>

Disclaimer Notice:
This email has been sent by Oakford Technology Limited, while we have checked this e-mail and any attachments for viruses, we can not guarantee that they are virus-free. You must therefore take full responsibility for virus checking.
This message and any attachments are confidential and should only be read by those to whom they are addressed. If you are not the intended recipient, please contact us, delete the message from your computer and destroy any copies. Any distribution or copying without our prior permission is prohibited.
Internet communications are not always secure and therefore Oakford Technology Limited does not accept legal responsibility for this message. The recipient is responsible for verifying its authenticity before acting on the contents. Any views or opinions presented are solely those of the author and do not necessarily represent those of Oakford Technology Limited.
Registered address: Oakford Technology Limited, The Manor House, Potterne, Wiltshire. SN10 5PN.
Registered in England and Wales No. 5971519

@jgriffithsuk commented on GitHub (Jun 30, 2023): Hi Dan With Debug enabled I get this error Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.created_at' in 'order clause' (SQL: select *, (select count(*) from `users` inner join `role_user` on `users`.`id` = `role_user`.`user_id` where `roles`.`id` = `role_user`.`role_id`) as `users_count`, (select count(*) from `role_permissions` inner join `permission_role` on `role_permissions`.`id` = `permission_role`.`permission_id` where `roles`.`id` = `permission_role`.`role_id`) as `permissions_count` from `roles` order by `users`.`created_at` desc limit 20 offset 0) Thanks From: Dan Brown ***@***.***> Sent: 29 June 2023 17:16 To: BookStackApp/BookStack ***@***.***> Cc: Jamie Griffiths ***@***.***>; Mention ***@***.***> Subject: Re: [BookStackApp/BookStack] LDAP and standard login error on Roles page (Issue #4350) ** This mail originated from OUTSIDE the Oakford corporate network. Treat hyperlinks and attachments in this email with caution. ** Hi @jgriffithsuk<https://github.com/jgriffithsuk>, Please follow our debugging guidance to gain more detail for the error from your logs: https://www.bookstackapp.com/docs/admin/debugging/ — Reply to this email directly, view it on GitHub<https://github.com/BookStackApp/BookStack/issues/4350#issuecomment-1613479835>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BAIPNJPOZYZDIMCOFGM5OSLXNWS2JANCNFSM6AAAAAAZYPTN6Q>. You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>> Disclaimer Notice: This email has been sent by Oakford Technology Limited, while we have checked this e-mail and any attachments for viruses, we can not guarantee that they are virus-free. You must therefore take full responsibility for virus checking. This message and any attachments are confidential and should only be read by those to whom they are addressed. If you are not the intended recipient, please contact us, delete the message from your computer and destroy any copies. Any distribution or copying without our prior permission is prohibited. Internet communications are not always secure and therefore Oakford Technology Limited does not accept legal responsibility for this message. The recipient is responsible for verifying its authenticity before acting on the contents. Any views or opinions presented are solely those of the author and do not necessarily represent those of Oakford Technology Limited. Registered address: Oakford Technology Limited, The Manor House, Potterne, Wiltshire. SN10 5PN. Registered in England and Wales No. 5971519
Author
Owner

@ssddanbrown commented on GitHub (Jun 30, 2023):

Thanks for the extra detail @jgriffithsuk,
Can confirm this occurs when sorting roles by created date.
I've assigned this to be addressed for the next patch release.

I believe the sorting preference is saved per-user, so other admin user accounts may have working access to the roles list if that helps.

@ssddanbrown commented on GitHub (Jun 30, 2023): Thanks for the extra detail @jgriffithsuk, Can confirm this occurs when sorting roles by created date. I've assigned this to be addressed for the next patch release. I believe the sorting preference is saved per-user, so other admin user accounts may have working access to the roles list if that helps.
Author
Owner

@ssddanbrown commented on GitHub (Jul 4, 2023):

This has now been patched within 18ee80a743, and will be part of the next BookStack release.
Thanks again @jgriffithsuk for reporting.

@ssddanbrown commented on GitHub (Jul 4, 2023): This has now been patched within 18ee80a743cc54869a7b0f9c5e00527c62539ecd, and will be part of the next BookStack release. Thanks again @jgriffithsuk for reporting.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3890