[Support Request]: Bookstack crashed on Container #2490

Closed
opened 2026-02-05 04:18:44 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @reddexx on GitHub (Nov 16, 2021).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Problem after Update from Bookstack 21.10.3 to 21.11

Exact BookStack Version

21.11

Log Content

wait-for-db: waiting for bookstack_db:3306
wait-for-db: done
Generating Key...

Symfony\Component\Debug\Exception\FatalErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

at /var/www/bookstack/app/Uploads/Image.php:20
16| * @property int $uploaded_to
17| * @property int $created_by
18| * @property int $updated_by
19| */

20| class Image extends Model
21| {
22| use HasFactory;
23| use HasCreatorAndUpdater;
24|

Whoops\Exception\ErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

at /var/www/bookstack/app/Uploads/Image.php:20
16| * @property int $uploaded_to
17| * @property int $created_by
18| * @property int $updated_by
19| */

20| class Image extends Model
21| {
22| use HasFactory;
23| use HasCreatorAndUpdater;
24|

Exception trace:

1 Whoops\Run::handleError("Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found", "/var/www/bookstack/app/Uploads/Image.php")
/var/www/bookstack/vendor/filp/whoops/src/Whoops/Run.php:486

2 Whoops\Run::handleShutdown()
[internal]:0
wait-for-db: waiting for bookstack_db:3306
wait-for-db: done
Generating Key...

Symfony\Component\Debug\Exception\FatalErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

at /var/www/bookstack/app/Uploads/Image.php:20
16| * @property int $uploaded_to
17| * @property int $created_by
18| * @property int $updated_by
19| */

20| class Image extends Model
21| {
22| use HasFactory;
23| use HasCreatorAndUpdater;
24|

Whoops\Exception\ErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found

at /var/www/bookstack/app/Uploads/Image.php:20
16| * @property int $uploaded_to
17| * @property int $created_by
18| * @property int $updated_by
19| */

20| class Image extends Model
21| {
22| use HasFactory;
23| use HasCreatorAndUpdater;
24|

Exception trace:

1 Whoops\Run::handleError("Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found", "/var/www/bookstack/app/Uploads/Image.php")
/var/www/bookstack/vendor/filp/whoops/src/Whoops/Run.php:486

2 Whoops\Run::handleShutdown()
[internal]:0

PHP Version

7.4.21

Hosting Environment

Running on Docker Container

Originally created by @reddexx on GitHub (Nov 16, 2021). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Problem after Update from Bookstack 21.10.3 to 21.11 ### Exact BookStack Version 21.11 ### Log Content wait-for-db: waiting for bookstack_db:3306 wait-for-db: done Generating Key... Symfony\Component\Debug\Exception\FatalErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found at /var/www/bookstack/app/Uploads/Image.php:20 16| * @property int $uploaded_to 17| * @property int $created_by 18| * @property int $updated_by 19| */ > 20| class Image extends Model 21| { 22| use HasFactory; 23| use HasCreatorAndUpdater; 24| Whoops\Exception\ErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found at /var/www/bookstack/app/Uploads/Image.php:20 16| * @property int $uploaded_to 17| * @property int $created_by 18| * @property int $updated_by 19| */ > 20| class Image extends Model 21| { 22| use HasFactory; 23| use HasCreatorAndUpdater; 24| Exception trace: 1 Whoops\Run::handleError("Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found", "/var/www/bookstack/app/Uploads/Image.php") /var/www/bookstack/vendor/filp/whoops/src/Whoops/Run.php:486 2 Whoops\Run::handleShutdown() [internal]:0 wait-for-db: waiting for bookstack_db:3306 wait-for-db: done Generating Key... Symfony\Component\Debug\Exception\FatalErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found at /var/www/bookstack/app/Uploads/Image.php:20 16| * @property int $uploaded_to 17| * @property int $created_by 18| * @property int $updated_by 19| */ > 20| class Image extends Model 21| { 22| use HasFactory; 23| use HasCreatorAndUpdater; 24| Whoops\Exception\ErrorException : Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found at /var/www/bookstack/app/Uploads/Image.php:20 16| * @property int $uploaded_to 17| * @property int $created_by 18| * @property int $updated_by 19| */ > 20| class Image extends Model 21| { 22| use HasFactory; 23| use HasCreatorAndUpdater; 24| Exception trace: 1 Whoops\Run::handleError("Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found", "/var/www/bookstack/app/Uploads/Image.php") /var/www/bookstack/vendor/filp/whoops/src/Whoops/Run.php:486 2 Whoops\Run::handleShutdown() [internal]:0 ### PHP Version 7.4.21 ### Hosting Environment Running on Docker Container
OVERLORD added the 🐕 Support label 2026-02-05 04:18:44 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 16, 2021):

Hi @reddexx,
Can you provide any details on your container environment? As in what container you're using and how you're applying updates? Or do you have a complete docker-compose to reference or share?

Based on the shared information it doesn't seem like the PHP dependencies have been updated, via composer, in your environment.

@ssddanbrown commented on GitHub (Nov 16, 2021): Hi @reddexx, Can you provide any details on your container environment? As in what container you're using and how you're applying updates? Or do you have a complete docker-compose to reference or share? Based on the shared information it doesn't seem like the PHP dependencies have been updated, via composer, in your environment.
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

i have a modified Image from:
https://github.com/solidnerd/docker-bookstack

this image is manual Updated from me (Downloading)
curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/refs/tags/v(Versionnumber).tar.gz

solidnerd Image has Stable and not Removed Images Automatic

@reddexx commented on GitHub (Nov 16, 2021): i have a modified Image from: https://github.com/solidnerd/docker-bookstack this image is manual Updated from me (Downloading) curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/refs/tags/v(Versionnumber).tar.gz solidnerd Image has Stable and not Removed Images Automatic
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

PHP Version can't not updating
image
System from Container is Debian10

@reddexx commented on GitHub (Nov 16, 2021): PHP Version can't not updating ![image](https://user-images.githubusercontent.com/6242840/142015908-af12149a-2489-40ed-9d14-1304b7cfe5b4.png) System from Container is Debian10
Author
Owner

@ssddanbrown commented on GitHub (Nov 16, 2021):

PHP Version can't not updating

The PHP used in the solidernerd container is set to PHP7.4 which should be fine.
It's the project PHP dependencies that I'd guess are not installing correctly on your instance.
This might be related to an older composer verison being used here or it could be related to your other edits.

To be able to help any further I'd need to be able to see what you've changed. Without knowing what you're running I can only make guesses.

@ssddanbrown commented on GitHub (Nov 16, 2021): > PHP Version can't not updating The PHP used in the solidernerd container is set to PHP7.4 which should be fine. It's the project PHP dependencies that I'd guess are not installing correctly on your instance. This might be related to an older [composer verison being used here](https://github.com/solidnerd/docker-bookstack/blob/master/Dockerfile#L54) or it could be related to your other edits. To be able to help any further I'd need to be able to see what you've changed. Without knowing what you're running I can only make guesses.
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

What do you need?

I have only extracted the New archive Version in the bookstack directory and saved the Image

@reddexx commented on GitHub (Nov 16, 2021): What do you need? I have only extracted the New archive Version in the bookstack directory and saved the Image
Author
Owner

@ssddanbrown commented on GitHub (Nov 16, 2021):

I have only extracted the New archive Version in the bookstack directory and saved the Image

How are you doing this? By accessing a shell instance within the container?

If so you'd also need to use composer to install the latest project PHP dependencies within the /var/www/bookstack path.

It'd probably be easier to alter the version of BookStack used in the Dockerfile then rebuild the image.

@ssddanbrown commented on GitHub (Nov 16, 2021): > I have only extracted the New archive Version in the bookstack directory and saved the Image How are you doing this? By accessing a shell instance within the container? If so you'd also need to use [composer](https://getcomposer.org/download/) to install the latest project PHP dependencies within the `/var/www/bookstack` path. It'd probably be easier to alter the [version of BookStack used in the Dockerfile](https://github.com/solidnerd/docker-bookstack/blob/master/Dockerfile#L2) then rebuild the image.
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

I downloaded and extracted the bookstack files, then set the write permissions in /var/www/bookstack, then set the owner, after which I created the image via portainer. That always worked except for the version. :(

I was only able to use the solidnerds container because the container from linuxserver.io emptied the storage because it has no idea why.

@reddexx commented on GitHub (Nov 16, 2021): I downloaded and extracted the bookstack files, then set the write permissions in /var/www/bookstack, then set the owner, after which I created the image via portainer. That always worked except for the version. :( I was only able to use the solidnerds container because the container from linuxserver.io emptied the storage because it has no idea why.
Author
Owner

@ssddanbrown commented on GitHub (Nov 16, 2021):

the container from linuxserver.io emptied the storage because it has no idea why.

I've never had this. Could occur if you weren't mounting the volume.

That always worked except for the version.

That might work if there have been no major change in our dependencies but you could end up with an unstable system. BookStack v21.11 had a lot more underlying changes to the framework and hence it incompatible with old dependencies.

@ssddanbrown commented on GitHub (Nov 16, 2021): > the container from linuxserver.io emptied the storage because it has no idea why. I've never had this. Could occur if you weren't mounting the volume. > That always worked except for the version. That might work if there have been no major change in our dependencies but you could end up with an unstable system. BookStack v21.11 had a lot more underlying changes to the framework and hence it incompatible with old dependencies.
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

The volume has mounted xD

I make a restart an the container and the container purge the complete storage path

@reddexx commented on GitHub (Nov 16, 2021): The volume has mounted xD I make a restart an the container and the container purge the complete storage path
Author
Owner

@reddexx commented on GitHub (Nov 16, 2021):

I'm trying to adapt the Dockerfile to your requirements, so I need a little information about what bookstack needs

@reddexx commented on GitHub (Nov 16, 2021): I'm trying to adapt the Dockerfile to your requirements, so I need a little information about what bookstack needs
Author
Owner

@ssddanbrown commented on GitHub (Nov 17, 2021):

The rest of the Dockerfile is likely fine. As mentioned above, you probably need to just change the version on this line:
fe6e51f430/Dockerfile (L2)

Might needs to also change the version of composer to the latest on this line:
fe6e51f430/Dockerfile (L54)
but it might not be an issue.

@ssddanbrown commented on GitHub (Nov 17, 2021): The rest of the Dockerfile is likely fine. As mentioned above, you probably need to just change the version on this line: https://github.com/solidnerd/docker-bookstack/blob/fe6e51f430872b9aaffacfb84fda5c1dfca05126/Dockerfile#L2 Might needs to also change the version of composer to the latest on this line: https://github.com/solidnerd/docker-bookstack/blob/fe6e51f430872b9aaffacfb84fda5c1dfca05126/Dockerfile#L54 but it might not be an issue.
Author
Owner

@reddexx commented on GitHub (Nov 17, 2021):

its Working with then Git
https://github.com/reddexx/docker-bookstack/blob/master/Dockerfile

@reddexx commented on GitHub (Nov 17, 2021): its Working with then Git https://github.com/reddexx/docker-bookstack/blob/master/Dockerfile
Author
Owner

@ssddanbrown commented on GitHub (Nov 17, 2021):

Awesome! Will therefore close this off.

@ssddanbrown commented on GitHub (Nov 17, 2021): Awesome! Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2490