Error since updating from 23.05.2 to 23.06.2 #3932

Closed
opened 2026-02-05 07:53:48 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @TineUser on GitHub (Jul 25, 2023).

Describe the Bug

After updating to 23.06.2 (from 23.05.2) Bookstack doesn't work anymore. I get a HTTP 500 error when accessing the start page. In Lavarel log I see the following error:

[2023-07-25 10:14:32] production.ERROR: BookStack\Permissions\PermissionApplicator::currentUser(): Return value must be of type BookStack\Users\Models\User, BookStack\Auth\User returned {"exception":"[object] (TypeError(code: 0): BookStack\\Permissions\\PermissionApplicator::currentUser(): Return value must be of type BookStack\\Users\\Models\\User, BookStack\\Auth\\User returned at C:\\xampp-dev\\htdocs\\bookstack\\app\\Permissions\\PermissionApplicator.php:176)

What can I do?

Steps to Reproduce

Accessing start page.

Expected Behaviour

Start page should be displayed.

Screenshots or Additional Context

No response

Browser Details

Microsoft Edge on Windows 10 22H2

Exact BookStack Version

23.06.02

PHP Version

8.0.19

Hosting Environment

Windows 10 22H2 with XAMPP

Originally created by @TineUser on GitHub (Jul 25, 2023). ### Describe the Bug After updating to 23.06.2 (from 23.05.2) Bookstack doesn't work anymore. I get a HTTP 500 error when accessing the start page. In Lavarel log I see the following error: `[2023-07-25 10:14:32] production.ERROR: BookStack\Permissions\PermissionApplicator::currentUser(): Return value must be of type BookStack\Users\Models\User, BookStack\Auth\User returned {"exception":"[object] (TypeError(code: 0): BookStack\\Permissions\\PermissionApplicator::currentUser(): Return value must be of type BookStack\\Users\\Models\\User, BookStack\\Auth\\User returned at C:\\xampp-dev\\htdocs\\bookstack\\app\\Permissions\\PermissionApplicator.php:176)` What can I do? ### Steps to Reproduce Accessing start page. ### Expected Behaviour Start page should be displayed. ### Screenshots or Additional Context _No response_ ### Browser Details Microsoft Edge on Windows 10 22H2 ### Exact BookStack Version 23.06.02 ### PHP Version 8.0.19 ### Hosting Environment Windows 10 22H2 with XAMPP
OVERLORD added the 🐛 Bug label 2026-02-05 07:53:48 +03:00
Author
Owner

@TineUser commented on GitHub (Jul 25, 2023):

With rolling back to 23.05.2 everything is working fine.

@TineUser commented on GitHub (Jul 25, 2023): With rolling back to 23.05.2 everything is working fine.
Author
Owner

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

Hi @TineUser,
It sounds like you're maybe getting a mix of old and new code.

Are you using the advised method via git to control the code and manage updates?
If so, what's the output of running git status after updating and running into this error?

@ssddanbrown commented on GitHub (Jul 25, 2023): Hi @TineUser, It sounds like you're maybe getting a mix of old and new code. Are you using the advised method via `git` to control the code and manage updates? If so, what's the output of running `git status` after updating and running into this error?
Author
Owner

@TineUser commented on GitHub (Jul 25, 2023):

No, I don't use GIT. I downloaded the ZIP file and extract the content to the folder where Bookstack is saved. I overwrite all files. Then I execute the following commands:

php artisan migrate
php artisan cache:clear
php artisan config:clear
php artisan view:clear

There were no error messages with these commands. For example:

php artisan migrate

                                               APPLICATION IN PRODUCTION

  Do you really wish to run this command? (yes/no) [no]
❯ yes

   INFO  Running migrations.

  2023_06_10_071823_remove_guest_user_secondary_roles ...................................................... 14ms DONE
  2023_06_25_181952_remove_bookshelf_create_entity_permissions .............................................. 0ms DONE
```

This worked fine with the last updates.
@TineUser commented on GitHub (Jul 25, 2023): No, I don't use GIT. I downloaded the ZIP file and extract the content to the folder where Bookstack is saved. I overwrite all files. Then I execute the following commands: ``` php artisan migrate php artisan cache:clear php artisan config:clear php artisan view:clear ``` There were no error messages with these commands. For example: ```` php artisan migrate APPLICATION IN PRODUCTION Do you really wish to run this command? (yes/no) [no] ❯ yes INFO Running migrations. 2023_06_10_071823_remove_guest_user_secondary_roles ...................................................... 14ms DONE 2023_06_25_181952_remove_bookshelf_create_entity_permissions .............................................. 0ms DONE ``` This worked fine with the last updates.
Author
Owner

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

No, I don't use GIT. I downloaded the ZIP file and extract the content to the folder where Bookstack is saved. I overwrite all files.

Okay, I really can't recommend this approach since this won't take into account everything (like removing files/folders which should be removed) and it makes it hard to see where issues are, like the scenario you're in now.

Backup all files first. Assuming you've made no custom changes in these locations, try fully deleting these folders within your install before copying over the new app files:

  • app
  • bootstrap
  • database
  • lang
  • resources
  • routes

Might not account for everything, but should do most.
Also, are you running the composer install --no-dev step? You should run that on each update too.

@ssddanbrown commented on GitHub (Jul 25, 2023): > No, I don't use GIT. I downloaded the ZIP file and extract the content to the folder where Bookstack is saved. I overwrite all files. Okay, I really can't recommend this approach since this won't take into account everything (like removing files/folders which should be removed) and it makes it hard to see where issues are, like the scenario you're in now. Backup all files first. Assuming you've made no custom changes in these locations, try fully deleting these folders within your install before copying over the new app files: - app - bootstrap - database - lang - resources - routes Might not account for everything, but should do most. Also, are you running the `composer install --no-dev` step? You should run that on each update too.
Author
Owner

@TineUser commented on GitHub (Jul 25, 2023):

I forgot to execute composer install --no-dev :-(. I wil try it once again.

@TineUser commented on GitHub (Jul 25, 2023): I forgot to execute `composer install --no-dev` :-(. I wil try it once again.
Author
Owner

@TineUser commented on GitHub (Jul 25, 2023):

Now it works. I didn't had to deleting these folders within my installation before copying over the new app files:

  • app
  • bootstrap
  • database
  • lang
  • resources
  • routes

But I saw in the ZIP file that there are some changes regarding these folders. So I cleaned up these folders manually.

Thank you for your help. And sorry for my failure by forgetting composer install --no-dev.

@TineUser commented on GitHub (Jul 25, 2023): Now it works. I didn't had to deleting these folders within my installation before copying over the new app files: - app - bootstrap - database - lang - resources - routes But I saw in the ZIP file that there are some changes regarding these folders. So I cleaned up these folders manually. Thank you for your help. And sorry for my failure by forgetting `composer install --no-dev`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3932