Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred when saving pages\books, etc after upgrading to 21.12 #3124

Closed
southeasterntech opened this issue Dec 27, 2021 · 5 comments

Comments

@southeasterntech
Copy link

I believe I'm getting a similar error after upgrading to 21.12, with no webhooks enabled.

"So for example, create a new page, hit save and I get an internal error. The upside is that the new page does get created, same as any other operation (delete, move, comment) but all happen after the internal error."

This is what I'm getting on our own self-hosted server on our LAN running Ubuntu 20.04

image

Originally posted by @southeasterntech in #3122 (comment)

@southeasterntech southeasterntech changed the title An error occurred when saving pages\books, etc after upgrading to 21.12, with no webhooks enabled. An error occurred when saving pages\books, etc after upgrading to 21.12 Dec 27, 2021
@southeasterntech
Copy link
Author

southeasterntech commented Dec 27, 2021

Here's the debug:
Error

Illuminate\Database\QueryException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bookstack.webhooks' doesn't exist (SQL: select * from webhooks where exists (select * from webhook_tracked_events where webhooks.id = webhook_tracked_events.webhook_id and (event = book_update or event = all)) and active = 1)

image

=============stack trace===============

#0 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(663): Illuminate\Database\Connection->runQueryCallback()
#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(367): Illuminate\Database\Connection->run()
#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2352): Illuminate\Database\Connection->select()
#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2340): Illuminate\Database\Query\Builder->runSelect()
#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2874): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2341): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(615): Illuminate\Database\Query\Builder->get()
#7 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(599): Illuminate\Database\Eloquent\Builder->getModels()
#8 /var/www/bookstack/app/Actions/ActivityLogger.php(93): Illuminate\Database\Eloquent\Builder->get()
#9 /var/www/bookstack/app/Actions/ActivityLogger.php(39): BookStack\Actions\ActivityLogger->dispatchWebhooks()
#10 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): BookStack\Actions\ActivityLogger->add()
#11 /var/www/bookstack/app/Entities/Repos/BookRepo.php(105): Illuminate\Support\Facades\Facade::__callStatic()
#12 /var/www/bookstack/app/Http/Controllers/BookController.php(167): BookStack\Entities\Repos\BookRepo->update()
#13 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\Http\Controllers\BookController->update()
#14 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#15 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch()
#16 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#17 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()
#18 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}()
#19 /var/www/bookstack/app/Http/Middleware/Authenticate.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#20 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\Authenticate->handle()
#21 /var/www/bookstack/app/Http/Middleware/Localization.php(82): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#22 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\Localization->handle()
#23 /var/www/bookstack/app/Http/Middleware/RunThemeActions.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#24 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\RunThemeActions->handle()
#25 /var/www/bookstack/app/Http/Middleware/CheckEmailConfirmed.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#26 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\CheckEmailConfirmed->handle()
#27 /var/www/bookstack/app/Http/Middleware/PreventAuthenticatedResponseCaching.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#28 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\PreventAuthenticatedResponseCaching->handle()
#29 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#30 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#31 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#32 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#33 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#34 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#35 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle()
#36 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#37 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#38 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#39 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#40 /var/www/bookstack/app/Http/Middleware/ApplyCspRules.php(36): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#41 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\ApplyCspRules->handle()
#42 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#43 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then()
#44 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack()
#45 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute()
#46 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute()
#47 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch()
#48 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}()
#49 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#50 /var/www/bookstack/app/Http/Middleware/TrustProxies.php(41): Illuminate\Http\Middleware\TrustProxies->handle()
#51 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BookStack\Http\Middleware\TrustProxies->handle()
#52 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#53 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#54 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#55 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#56 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#57 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#58 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#59 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}()
#60 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#61 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#62 /var/www/bookstack/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle()
#63 {main}

@ssddanbrown
Copy link
Member

Hi @southeasterntech,
Based upon that error it looks like the database migrations have not ran for the webhooks table.

Can you confirm the output of the php artisan migrate step of the BookStack update process?

@southeasterntech
Copy link
Author

I did run the command originally from the documentation:
"git pull origin release && composer install --no-dev && php artisan migrate"

But, don't recall if it was successful or not. I did create a snapshot of this server, so I can roll back if necessary. I went ahead and ran the following again:

"php artisan migrate" and got the following result.
image

After attempting to recreate the issue now, the error message has now gone away and saving of the book was successful without error.

What about the above jobs table error though?

Thanks Dan for your help
Shane

@southeasterntech
Copy link
Author

Thanks for the very awesome bookstack and the rapid support. Sending $$ your way via sponsor. Keep up the good work

@ssddanbrown
Copy link
Member

Thanks @southeasterntech, Happy to hear things are now working and thanks for the sponsor! Will therefore close this off.

What about the above jobs table error though?

There are no errors in your screenshot in the last message. The create_failed_jobs_table parts are in reference to a new table called failed_jobs which are just part of the system to support the new webhook abilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants