Fresh install broken #1366

Closed
opened 2026-02-05 00:42:43 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @wahlis on GitHub (Sep 15, 2019).

After a fresh install I cannot create pages.

I installed according to the steps in https://www.bookstackapp.com/docs/admin/installation/

I can log in, I can create a new user, I can create a book and chapters, but when I try to create pages I get the meessage
"An Error Occurred
An unknown error occurred"

Looking in the laravel log I can see:
[2019-09-15 06:38:21] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from `pages` where (`draft` = 0 or (`draft` = 1 and `created_by` = 3)) 32 and (exists (select * from `joint_permissions` where `pages`.`id` = `joint_permissions`.`entity_id` and `joint_permissions`.`entity_type` = BookStack\Page and `role_id` in (1, 2) and `action` = view and (`has_permission` = 1 or (` 32 has_permission_own` = 1 and `created_by` = 3)))) and `draft` = 0 and `template` = 1) {"userId":3,"email":"fredrik@wahlberg.se","exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not f 32 ound: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from `pages` where (`draft` = 0 or (`draft` = 1 and `created_by` = 3)) and (exists (select * from `joint_permissions` where `pages`.`id` = ` 32 joint_permissions`.`entity_id` and `joint_permissions`.`entity_type` = BookStack\\Page and `role_id` in (1, 2) and `action` = view and (`has_permission` = 1 or (`has_permission_own` = 1 and `created_by` = 3)))) and `draft` = 0 and 32 `template` = 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 'template' in 'w 32 here clause' 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 'template' in 'where clause' at /var/www/book 32 stack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77)

If I add the column template I come to the create page, but when I try to save a get a new error. This time it's
Column not found: 1054 Unknown column 'revision_count' in 'field list'

Originally created by @wahlis on GitHub (Sep 15, 2019). After a fresh install I cannot create pages. I installed according to the steps in https://www.bookstackapp.com/docs/admin/installation/ I can log in, I can create a new user, I can create a book and chapters, but when I try to create pages I get the meessage "An Error Occurred An unknown error occurred" Looking in the laravel log I can see: ``` [2019-09-15 06:38:21] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from `pages` where (`draft` = 0 or (`draft` = 1 and `created_by` = 3)) 32 and (exists (select * from `joint_permissions` where `pages`.`id` = `joint_permissions`.`entity_id` and `joint_permissions`.`entity_type` = BookStack\Page and `role_id` in (1, 2) and `action` = view and (`has_permission` = 1 or (` 32 has_permission_own` = 1 and `created_by` = 3)))) and `draft` = 0 and `template` = 1) {"userId":3,"email":"fredrik@wahlberg.se","exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not f 32 ound: 1054 Unknown column 'template' in 'where clause' (SQL: select count(*) as aggregate from `pages` where (`draft` = 0 or (`draft` = 1 and `created_by` = 3)) and (exists (select * from `joint_permissions` where `pages`.`id` = ` 32 joint_permissions`.`entity_id` and `joint_permissions`.`entity_type` = BookStack\\Page and `role_id` in (1, 2) and `action` = view and (`has_permission` = 1 or (`has_permission_own` = 1 and `created_by` = 3)))) and `draft` = 0 and 32 `template` = 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 'template' in 'w 32 here clause' 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 'template' in 'where clause' at /var/www/book 32 stack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77)``` If I add the column template I come to the create page, but when I try to save a get a new error. This time it's `Column not found: 1054 Unknown column 'revision_count' in 'field list'`
Author
Owner

@wahlis commented on GitHub (Sep 15, 2019):

Solved! The issue was incorrect collations on the database. I run MariaDB and need to change the server config for Laravel to work

Adding the following to my.cnf sorted the issue

innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
innodb_default_row_format=dynamic
innodb_large_prefix=true
@wahlis commented on GitHub (Sep 15, 2019): Solved! The issue was incorrect collations on the database. I run MariaDB and need to change the server config for Laravel to work Adding the following to my.cnf sorted the issue ``` innodb_large_prefix=true innodb_file_format=barracuda innodb_file_per_table=1 innodb_default_row_format=dynamic innodb_large_prefix=true ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1366