BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.49k stars 1.95k forks source link

migrate to 24.05 fails with "Class "Barryvdh\DomPDF\ServiceProvider" not found" #4995

Closed dani closed 6 months ago

dani commented 6 months ago

Describe the Bug

Trying to upgrade my 23.02.3 install to 24.05. I'm using a custom alpine based Docker image (Dockerfile is here and its base image is here but it's quite trivial).

Composer is 2.7.4 and PHP 8.3.6

The php artisan migrate command fails with

In ProviderRepository.php line 206:

  Class "Barryvdh\DomPDF\ServiceProvider" not found  

Tried with PHP 8.2 and 8.3 with same result.

Steps to Reproduce

  1. Update to 24.05
  2. Try to run php artisan migrate

Expected Behaviour

Database should be upgraded

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

24.05

ssddanbrown commented 6 months ago

Hi @dani, From only a quick glance I'm not too sure what's in vs out of the container in your setup. That error indicates some caching exists build for the old version, being ran on the new version, which then errors since it's attempting to load a package that's no longer used.

Do you know if bootstrap/cache files are part of volume data stored out of the container, or are they in-container only?

dani commented 6 months ago

Indeed, my bootstrap/cache were stored in a persistent volume. Wiping it makes the migrate command run. First time I encounter this issue (in at least 4 years of BookStack upgrades ;-) ). Maybe the doc should mention it ?

ssddanbrown commented 6 months ago

Wiping it makes the migrate command run.

Good to hear, I'll therefore close this off.

Maybe the doc should mention it ?

To be honest it's not worth adding to the doc, and will only add confusion, since it's not relevant in the vast majority of cases unless you have a specific scenario like yours. Normally, the composer install command updates that cache as part of the update process.

dani commented 6 months ago

OK, thanks for your help, I've added a manual wipe of this cache before upgrades in my image

C0rn3j commented 6 months ago
[0] # ls -lah # alias of lsd
drwxrwxr-x http http  48 B  Wed Nov 22 22:40:57 2023  .
drwxr-xr-x root root 164 B  Mon Nov  7 09:32:35 2022  ..
.rwxr-xr-x root root 1.4 KB Mon Nov  7 09:39:51 2022  packages.php
.rwxr-xr-x http http  19 KB Wed Nov 22 22:40:57 2023  services.php

Same issue, deleting the files fixed it, wonder if it's because of the permissions?

virtadpt commented 6 months ago

@C0rn3j I ran into this problem as well, but the ownerships were me:me, so I don't think permissions had anything to do with it.