Permissions not working #1061

Closed
opened 2026-02-04 23:38:45 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @madsmka on GitHub (Feb 22, 2019).

Describe the bug
When we are trying to give a role perimssions it will fail to save with the error "An unknown error occurred".

Steps To Reproduce

  1. Go to 'Settings'
  2. Click on 'Roles'
  3. Choose any of the roles
  4. Check one/or all of the permissions
  5. Click on 'Save Role'

Expected behavior
I expected it to save the role with the new permission setup.

Screenshots
If applicable, add screenshots to help explain your problem.
image

image

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.25.1
  • PHP Version: PHP 7.2.15-0ubuntu0.18.04.1
  • Hosting Method (Nginx/Apache/Docker): Apache (Bookstack installation script)

Additional context
After trying to upgrade our bookstack from version 0.21 to version 0.25.1 it failed after not being able to use/get composer. I did a restore from our backup, spinned up a new ubuntu 18.04.1 did a sqldump from the old server and restored it into the new server with bookstack version 0.25.1 installed.

We use LDAP to authenticate into our AD.

Error found in Laravel.log:
"[2019-02-22 08:12:08] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' (SQL: update rolessetupdated_at= 2019-02-22 08:12:08,external_auth_id= whereid= 1) {"userId":9,"email":"<my mail>","exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' (SQL: updaterolessetupdated_at= 2019-02-22 08:12:08,external_auth_id= whereid = 1) at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77) [stacktrace]"

Originally created by @madsmka on GitHub (Feb 22, 2019). **Describe the bug** When we are trying to give a role perimssions it will fail to save with the error "An unknown error occurred". **Steps To Reproduce** 1. Go to 'Settings' 2. Click on 'Roles' 3. Choose any of the roles 4. Check one/or all of the permissions 5. Click on 'Save Role' **Expected behavior** I expected it to save the role with the new permission setup. **Screenshots** If applicable, add screenshots to help explain your problem. ![image](https://user-images.githubusercontent.com/47882801/53229597-f70e4000-3684-11e9-94b5-e7368be868a0.png) ![image](https://user-images.githubusercontent.com/47882801/53229614-01c8d500-3685-11e9-94b3-5f08f70d2605.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.25.1 - PHP Version: PHP 7.2.15-0ubuntu0.18.04.1 - Hosting Method (Nginx/Apache/Docker): Apache (Bookstack installation script) **Additional context** After trying to upgrade our bookstack from version 0.21 to version 0.25.1 it failed after not being able to use/get composer. I did a restore from our backup, spinned up a new ubuntu 18.04.1 did a sqldump from the old server and restored it into the new server with bookstack version 0.25.1 installed. We use LDAP to authenticate into our AD. Error found in Laravel.log: `"[2019-02-22 08:12:08] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' (SQL: update `roles` set `updated_at` = 2019-02-22 08:12:08, `external_auth_id` = where `id` = 1) {"userId":9,"email":"<my mail>","exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' (SQL: update `roles` set `updated_at` = 2019-02-22 08:12:08, `external_auth_id` = where `id` = 1) at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\DBAL\\Driver\\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'external_auth_id' in 'field list' at /var/www/bookstack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77) [stacktrace]"`
OVERLORD added the 🐕 Support label 2026-02-04 23:38:45 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 22, 2019):

Hi @madsmka,
Sorry to hear you're having issues.

From the issue posted about it looks like your database is not up-to-date.

Have you migrated the database as per the upgrade instructions by running php artisan migrate.
Do you get any errors when running that?

@ssddanbrown commented on GitHub (Feb 22, 2019): Hi @madsmka, Sorry to hear you're having issues. From the issue posted about it looks like your database is not up-to-date. Have you migrated the database as per the upgrade instructions by running `php artisan migrate`. Do you get any errors when running that?
Author
Owner

@madsmka commented on GitHub (Feb 25, 2019):

Hello @ssddanbrown

I ran the command and it fixed everything. After reading the restore documentation again I can see that it actually says to run that commmand... I must have missed it. So thank you! :)

@madsmka commented on GitHub (Feb 25, 2019): Hello @ssddanbrown I ran the command and it fixed everything. After reading the restore documentation again I can see that it actually says to run that commmand... I must have missed it. So thank you! :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1061