Update to v0.31.1 Killed My BookStack #2025

Closed
opened 2026-02-05 02:37:11 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @swizzle1 on GitHub (Jan 9, 2021).

Updated this morning. I was getting an error 500 when I try to load the site.

Error log showed:
[09-Jan-2021 14:22:17 UTC] PHP Warning: require(/home/ino1jdl5c9we/BookStack/bootstrap/init.php): failed to open stream: No such file or directory in /home/ino1jdl5c9we/public_html/bookstack/index.php on line 22

I see this file no longer exists. Not sure why/how the update process didn't update my index.php, but I found the copy in the source and made the necessary changes.

Now the site still fails to load and my new error is:
[09-Jan-2021 14:25:56 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67
Stack trace:
#0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count()...', Array)
#1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(
)...')
#2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database{closure}('select count()...', Array)
#3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(
)...', Array, Object(Closure))
#4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669
[09-Jan-2021 14:26:04 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67
Stack trace:
#0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count()...', Array)
#1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(
)...')
#2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database{closure}('select count()...', Array)
#3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(
)...', Array, Object(Closure))
#4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669
[09-Jan-2021 14:26:07 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67
Stack trace:
#0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count()...', Array)
#1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(
)...')
#2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database{closure}('select count()...', Array)
#3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(
)...', Array, Object(Closure))
#4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669

I had a previous bug/issue open in the past where when I would run an update and get this error

[2020-09-25 14:30:24] production.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'id'; check that column/key exists (SQL: alter table joint_permissions drop id) {"exception":"[object] (Illuminate\Database\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'id'; check that column/key exists (SQL: alter table joint_permissions drop id) at /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669)
[stacktrace]

I still get this error after changing this table to InnoDB but everything seemed to be working fine when I would update so I just ignored it. I'm assuming there were additional database changes after this part which didn't get applied to my installation?

Originally created by @swizzle1 on GitHub (Jan 9, 2021). Updated this morning. I was getting an error 500 when I try to load the site. Error log showed: [09-Jan-2021 14:22:17 UTC] PHP Warning: require(/home/ino1jdl5c9we/BookStack/bootstrap/init.php): failed to open stream: No such file or directory in /home/ino1jdl5c9we/public_html/bookstack/index.php on line 22 I see this file no longer exists. Not sure why/how the update process didn't update my index.php, but I found the copy in the source and made the necessary changes. **Now the site still fails to load and my new error is:** [09-Jan-2021 14:25:56 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67 Stack trace: #0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count(*)...', Array) #1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(*)...') #2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database\{closure}('select count(*)...', Array) #3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(*)...', Array, Object(Closure)) #4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669 [09-Jan-2021 14:26:04 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67 Stack trace: #0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count(*)...', Array) #1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(*)...') #2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database\{closure}('select count(*)...', Array) #3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(*)...', Array, Object(Closure)) #4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669 [09-Jan-2021 14:26:07 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'owned_by' in 'where clause' in /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:67 Stack trace: #0 /home/ino1jdl5c9we/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(67): PDO->prepare('select count(*)...', Array) #1 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Doctrine\DBAL\Driver\PDOConnection->prepare('select count(*)...') #2 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(662): Illuminate\Database\Connection->Illuminate\Database\{closure}('select count(*)...', Array) #3 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(629): Illuminate\Database\Connection->runQueryCallback('select count(*)...', Array, Object(Closure)) #4 /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(338): Il in /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 669 **I had a previous bug/issue open in the past where when I would run an update and get this error** [2020-09-25 14:30:24] production.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'id'; check that column/key exists (SQL: alter table `joint_permissions` drop `id`) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'id'; check that column/key exists (SQL: alter table `joint_permissions` drop `id`) at /home/ino1jdl5c9we/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669) [stacktrace] I still get this error after changing this table to InnoDB but everything seemed to be working fine when I would update so I just ignored it. I'm assuming there were additional database changes after this part which didn't get applied to my installation?
Author
Owner

@ssddanbrown commented on GitHub (Jan 9, 2021):

Hi @swizzle1,
Yeah, Your database migrations are behind due to a failed previous migration.

You can try following my comment here to restore the id column then re-attempt migrations.

@ssddanbrown commented on GitHub (Jan 9, 2021): Hi @swizzle1, Yeah, Your database migrations are behind due to a failed previous migration. You can try following [my comment here](https://github.com/BookStackApp/BookStack/issues/2317#issuecomment-707371525) to restore the id column then re-attempt migrations.
Author
Owner

@swizzle1 commented on GitHub (Jan 9, 2021):

Thank you!

That SQL code worked fine, the database change allowed the update process to complete with no errors, and my BookStack installation appears to be working perfectly fine.

@swizzle1 commented on GitHub (Jan 9, 2021): Thank you! That SQL code worked fine, the database change allowed the update process to complete with no errors, and my BookStack installation appears to be working perfectly fine.
Author
Owner

@ssddanbrown commented on GitHub (Jan 9, 2021):

Awesome, Glad to hear that worked!

@ssddanbrown commented on GitHub (Jan 9, 2021): Awesome, Glad to hear that worked!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2025