Skip to content

Code instead of wiki pages #5628

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

Open
2 tasks done
Jens-TGS opened this issue May 26, 2025 · 11 comments
Open
2 tasks done

Code instead of wiki pages #5628

Jens-TGS opened this issue May 26, 2025 · 11 comments

Comments

@Jens-TGS
Copy link

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I already did several updates of my nice bookstack installation, but this time when updating to 25.02.5 things went wrong. If I now open my wiki URL, I'm getting redirected to

https://wiki.my-domain.com/login

and this page looks like this:

`@extends('layouts.simple') @section('content')

{{ Str::title(trans('auth.log_in')) }}
@include('auth.parts.login-message') @include('auth.parts.login-form-' . $authMethod) @if(count($socialDrivers) > 0) @foreach($socialDrivers as $driver => $name)
@ICON('auth/' . $driver) {{ trans('auth.log_in_with', ['socialDriver' => $name]) }}
@Endforeach @endif @if(setting('registration-enabled') && config('auth.method') === 'standard')
{{ trans('auth.dont_have_account') }}
@endif
@stop`

Any idea how to restore my wiki?

If not: it's not a major issue. I do have a plenty of backups of the VM running the wiki.

Exact BookStack Version

25.02.5

Log Content

No helpful entries

Hosting Environment

Debian 12 (bookworm) VM served by Proxmox
apache 2.4.62
php 8.3.21
Proxy: Nginx Proxy Manager

@ssddanbrown
Copy link
Member

Hi @Jens-TGS,
This usually occurs when there's an issue with file permissions of certain files/folders.
I've advise:

@Jens-TGS
Copy link
Author

Jens-TGS commented May 27, 2025

Dear Dan,

thanks a lot for the quick advices. I did follow them, unfortunately they did not solve my issue.

Here is how the /var/www/bookstack folder looks like at the moment:

root@mywiki:/var/www/bookstack# ls -al
total 2063
drwxr-xr-x 16 www-data www-data      42 May 26 22:33 .
drwxr-xr-x  5 root     root           5 May 27 06:23 ..
-rw-r--r--  1 www-data www-data    5928 May 26 22:28 .env
-rwxr-xr-x  1 www-data www-data    4904 Dec  3  2022 .env.bak
-rwxr-xr-x  1 www-data www-data    1665 May 26 22:33 .env.example
-rwxr-xr-x  1 www-data www-data   13938 May 26 22:33 .env.example.complete
-rwxr-xr-x  1 www-data www-data    4988 Aug 27  2024 .env.lmn-ldap
drwxr-xr-x  8 www-data www-data      15 May 26 22:33 .git
-rwxr-xr-x  1 www-data www-data      61 May 26 22:33 .gitattributes
drwxr-xr-x  4 www-data www-data       8 May 26 22:33 .github
-rwxr-xr-x  1 www-data www-data     461 May 26 22:33 .gitignore
-rwxr-xr-x  1 www-data www-data    1122 May 26 22:33 LICENSE
drwxr-xr-x 23 www-data www-data      23 Mar  3 20:14 app
-rwxr-xr-x  1 www-data www-data    1685 May 26 22:33 artisan
-rwxr-xr-x  1 www-data www-data  388792 May 26 22:33 bookstack-system-cli
drwxr-xr-x  3 www-data www-data       5 May 26 22:33 bootstrap
-rwxr-xr-x  1 www-data www-data    3656 May 26 22:33 composer.json
-rwxr-xr-x  1 www-data www-data  380388 May 26 22:33 composer.lock
-rwxr-xr-x  1 www-data www-data 2799637 Aug 21  2022 composer.phar
-rwxr-xr-x  1 www-data www-data     304 May 26 22:33 crowdin.yml
drwxr-xr-x  5 www-data www-data       6 May 26 22:33 database
drwxr-xr-x  8 www-data www-data       8 Apr 14 23:07 dev
-rwxr-xr-x  1 www-data www-data    1370 May 26 22:33 docker-compose.yml
-rwxr-xr-x  1 www-data www-data    1689 May 26 22:33 eslint.config.mjs
-rwxr-xr-x  1 www-data www-data    6833 May 26 22:33 jest.config.ts
drwxr-xr-x 53 www-data www-data      53 Mar  3 20:14 lang
-rwxr-xr-x  1 www-data www-data  333307 May 26 22:33 package-lock.json
-rwxr-xr-x  1 www-data www-data    2439 May 26 22:33 package.json
-rwxr-xr-x  1 www-data www-data    1967 Apr  5  2024 pakete-nicht-debian.txt
-rwxr-xr-x  1 www-data www-data    1045 May 26 22:33 phpcs.xml
-rwxr-xr-x  1 www-data www-data     465 May 26 22:33 phpstan.neon.dist
-rwxr-xr-x  1 www-data www-data    3154 May 26 22:33 phpunit.xml
drwxr-xr-x  5 www-data www-data      20 May 26 22:33 public
-rwxr-xr-x  1 www-data www-data   14569 May 26 22:33 readme.md
drwxr-xr-x  6 www-data www-data       6 Mar 26  2023 resources
drwxr-xr-x  2 www-data www-data       4 May 26 22:33 routes
drwxrwxr-x  9 www-data www-data       9 May  6  2023 storage
drwxr-xr-x 19 www-data www-data      31 May 26 22:33 tests
drwxr-xr-x  2 www-data www-data       3 May 26 22:33 themes
-rwxr-xr-x  1 www-data www-data     640 May 26 22:33 tsconfig.json
drwxr-xr-x 48 www-data www-data      49 May 26 22:33 vendor
-rwxr-xr-x  1 www-data www-data       9 May 26 22:33 version

Any other ideas about the root cause?

BR, Jens

@ssddanbrown
Copy link
Member

ssddanbrown commented May 27, 2025

Ah, okay.

  • What is the full output of running git status from your BookStack install folder?
  • What is the full output of running git log -n 1 from your BookStack install folder?
  • What is the full output of running ls -alh bootstrap/cache from your BookStack install folder?
  • What is the full output of running ls -alh storage/framework/views | head from your BookStack install folder?
  • Can you re-run each of the update commands, and share the full output of each?

@ssddanbrown
Copy link
Member

Also, possibly related to #5433.
Worth checking your PHP packages are updated and aligned, as from that thread the finding was that differing package versions could lead to this. Could be likely in this case since it looks like you're not just using standard debian packages for PHP (I'm assuming deb sury packages?).

@Jens-TGS
Copy link
Author

Thanks a lot for your posts. I really do appreciate your support.

I did read #5433, but did not get any advice how to proceed here. Yes, my PHP packages are deb sury packages:

root@wiki:/var/www/bookstack# cat /etc/apt/sources.list.d/sury-php.list
deb https://packages.sury.org/php/ bookworm main

And everything is up to date (and was also before):

root@wiki:/var/www/bookstack# apt update
Hit:1 http://security.debian.org bookworm-security InRelease
Hit:2 http://ftp.debian.org/debian bookworm InRelease
Hit:3 http://ftp.debian.org/debian bookworm-updates InRelease
Hit:4 https://packages.sury.org/php bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

Coming to your first post from today. Here are the requested outputs:

From git status I believe all files are modified (output truncated):

root@wiki:/var/www/bookstack# sudo -u www-data git status
On branch release
Your branch is up to date with 'origin/release'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .env.example
        modified:   .env.example.complete
        modified:   .gitattributes
        modified:   .github/CODE_OF_CONDUCT.md
        modified:   .github/FUNDING.yml
        modified:   .github/ISSUE_TEMPLATE/api_request.yml
        modified:   .github/ISSUE_TEMPLATE/bug_report.yml
        modified:   .github/ISSUE_TEMPLATE/config.yml
        modified:   .github/ISSUE_TEMPLATE/feature_request.yml
        modified:   .github/ISSUE_TEMPLATE/language_request.yml
        modified:   .github/ISSUE_TEMPLATE/support_request.yml
        modified:   .github/SECURITY.md
        modified:   .github/translators.txt
        modified:   .github/workflows/analyse-php.yml
        modified:   .github/workflows/lint-js.yml
        modified:   .github/workflows/lint-php.yml
        modified:   .github/workflows/test-js.yml
        modified:   .github/workflows/test-migrations.yml
        modified:   .github/workflows/test-php.yml
        modified:   .gitignore
        modified:   LICENSE
        modified:   app/Access/Controllers/ConfirmEmailController.php
        modified:   app/Access/Controllers/ForgotPasswordController.php
        modified:   app/Access/Controllers/HandlesPartialLogins.php
        modified:   app/Access/Controllers/LoginController.php
        modified:   app/Access/Controllers/MfaBackupCodesController.php
        modified:   app/Access/Controllers/MfaController.php
        modified:   app/Access/Controllers/MfaTotpController.php
        modified:   app/Access/Controllers/OidcController.php
        modified:   app/Access/Controllers/RegisterController.php
...

But if I do have a look at the details, just the access rights are modified:

root@wiki:/var/www/bookstack# sudo -u www-data git diff app/Access/Controllers/ConfirmEmailController.php
diff --git a/app/Access/Controllers/ConfirmEmailController.php b/app/Access/Controllers/ConfirmEmailController.php
old mode 100644
new mode 100755

Other requested outputs:

root@wiki:/var/www/bookstack# sudo -u www-data git log -n 1
commit 73f9834e6f591cd61115a31a44ba9a684c136390 (HEAD -> release, origin/release)
Author: Dan Brown <ssddanbrown@googlemail.com>
Date:   Sat May 17 12:16:55 2025 +0100

    Updated version and assets for release v25.02.5
root@wiki:/var/www/bookstack# ls -alh bootstrap/cache
total 15K
drwxrwxr-x 2 www-data www-data   5 May 27 06:24 .
drwxr-xr-x 3 www-data www-data   5 May 26 22:33 ..
-rwxrwxr-x 1 www-data www-data  14 May 26 22:33 .gitignore
-rwxrwxr-x 1 www-data www-data 802 May 27 06:24 packages.php
-rwxrwxr-x 1 www-data www-data 22K May 27 06:24 services.php
root@wiki:/var/www/bookstack# ls -alh storage/framework/views | head
total 51K
drwxrwxr-x 2 www-data www-data    7 May 27 15:49 .
drwxrwxr-x 5 www-data www-data    6 May 26 22:33 ..
-rwxrwxr-x 1 www-data www-data   14 May 26 22:33 .gitignore
-rwxrwxr-x 1 www-data www-data 2.8K May 26 22:34 546f2f1017bec334b37dedb3f82bcfa3.php
-rw-r--r-- 1 www-data www-data 2.5K May 27 15:49 a0effcbb5c1d35baf0ecb90d3e862545.php
-rwxrwxr-x 1 www-data www-data 1.3K May 26 22:34 ae53f06791072e4f2e88a01c5fb6687b.php
-rwxrwxr-x 1 www-data www-data 1.4K May 26 22:35 e7236d2133250d3904f9a5019cd545f6.php

Run again update process:

root@wiki:/var/www/bookstack# sudo -u www-data git pull origin release
From https://github.com/BookStackApp/BookStack
 * branch                release    -> FETCH_HEAD
Already up to date.
root@wiki:/var/www/bookstack# sudo -u www-data composer install --no-dev
> @php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');"
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  laravel/socialite ........................................................................................................................... DONE
  laravel/tinker .............................................................................................................................. DONE
  nesbot/carbon ............................................................................................................................... DONE
  nunomaduro/termwind ......................................................................................................................... DONE
  socialiteproviders/manager .................................................................................................................. DONE

58 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan cache:clear

   INFO  Application cache cleared successfully.

> @php artisan view:clear

   INFO  Compiled views cleared successfully.

root@wiki:/var/www/bookstack# sudo -u www-data php artisan migrate


                                                                                APPLICATION IN PRODUCTION.


 ┌ Are you sure you want to run this command? ──────────────────┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

   INFO  Nothing to migrate.

@ssddanbrown
Copy link
Member

Thanks @Jens-TGS for the detail.
That's all looking generally fine though, no surprises. Gonna have to dig into things a little more.

  • What's the output of running php -r "echo token_get_all('cat')[0][0] === T_INLINE_HTML ? 'pass' : 'fail';"?
  • Are you confident that PHP running via apache is running via the same version as reported (which I assumed was confirmed via command line)?
    • Just asking as multiple versions of PHP could potentially be in play in a scenario like this.
    • How is PHP being ran via apache? PHP module, or via separate php-fpm process, or unknown?
  • In the BookStack folder, can you run git config core.fileMode false to ignore file permission changes then re-confirm the git status output. Should be much reduced in output lines.

@Jens-TGS
Copy link
Author

Of course, here are the requested additional details:

root@wiki:/var/www/bookstack# sudo -u www-data php -r "echo token_get_all('cat')[0][0] === T_INLINE_HTML ? 'pass' : 'fail';"
pass

I'm not the biggest expert in apache2 and which version it is running, but I believe, it is the reported version, since nothing else is installed:

root@wiki:/var/www/bookstack# dpkg -l | grep php
ii  libapache2-mod-php8.3          8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                     2:96+0~20250402.56+debian12~1.gbp84a5b7     all          Common files for PHP packages
ii  php8.3                         8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.3-cli                     8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        command-line interpreter for the PHP scripting language
ii  php8.3-common                  8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        documentation, examples and common module for PHP
ii  php8.3-curl                    8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        CURL module for PHP
ii  php8.3-gd                      8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        GD module for PHP
ii  php8.3-ldap                    8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        LDAP module for PHP
ii  php8.3-mbstring                8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        MBSTRING module for PHP
ii  php8.3-mysql                   8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        MySQL module for PHP
ii  php8.3-opcache                 8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        Zend OpCache module for PHP
ii  php8.3-readline                8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        readline module for PHP
ii  php8.3-xml                     8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.3-zip                     8.3.21-1+0~20250509.62+debian12~1.gbpd2ac5c amd64        Zip module for PHP
root@wiki:/var/www/bookstack# sudo -u www-data git config core.fileMode false
root@wiki:/var/www/bookstack# sudo -u www-data git status
On branch release
Your branch is up to date with 'origin/release'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .env.bak
        .env.lmn-ldap
        composer.phar

nothing added to commit but untracked files present (use "git add" to track)

Thanks a lot for looking into my issue!

@ssddanbrown
Copy link
Member

Thanks @Jens-TGS again for the clear responses.

All looks okay there too!
I was initially a bit suspicious of that different php-common package info, but looking at deb sury repo that looks fine.

I'm at a loss, not sure what further to (reasonably) check.
At this stage, I might need to attempt replication of the same environment.

What architecture are you running here? Based upon being a proxmox based VM I'd assume standard x86_64?
Just want to check though in case I'm assuming wrong.

@Jens-TGS
Copy link
Author

Hi @ssddanbrown,

thanks again for having a look on my issue!

Yes, it is standard x86_64. What do you need?

BR Jens

@ssddanbrown
Copy link
Member

Okay, I just tried to replicate this environment.
Debian 12 LXC container on proxmox with deb sury repo using apache and mod-php, with the exact same dpkg -l | grep php output.
No noticeable issues. Can't reproduce.

Makes me think it's more likely something specific to this environment and configuration.
Not sure what to check next though.

@Jens-TGS
Copy link
Author

Jens-TGS commented Jun 6, 2025

Dear Dan,
thanks for replicating my environment and rolling out the tests.
In the meantime I reverted my wiki VM back to a state of an older backup and updated the bookstack app again. Now everything is working again. Data loss is small, since the wiki was not used often in the affected time slot.
If you are interested to narrow down the issue ether way, I might be able to provide you a backup of the VM including the issue.

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

No branches or pull requests

2 participants