BookStackApp / BookStack

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

After migrating to another domain from intranet, pages are not showing up #2706

Closed maxzurawski closed 3 years ago

maxzurawski commented 3 years ago

Hi there,

After migrating from one domain to another, old pages (restored ones) are not accessible anymore. New pages inside old categories are created successfully and also accessible after logout/login.

Origin of issue

  1. Installed BookStack on raspberry Pi (IP: 192.168.1.47), bookstack was under: http://192.168.1.47/bookstack)
  2. Created one book + some chapters + pages inside chapters
  3. Since I liked the process of creating books, I've decided to move into "prod" domain.

Issue description

  1. Migration of database done successfully.
  2. Folders for migrating copied and deployed.
  3. Inside root of bookstack run 'php artisan bookstack:update-url http://192.168.1.47 '
  4. Login - successfull
  5. Bookview - works
  6. Entering book - works
  7. Viewing Categories - works
  8. Entering categories - works
  9. Listing pages in categories - works (I see all pages inside categories view, but cannot enter them - see next point)
  10. Entering old (restored from backup) pages - DOES NOT WORK ** url: /bookstack/books/mytodos/page/technical-overview shows "An Error Occured" page.
  11. Brand new page inside restored category was created successfully.
  12. After logout/login I can access this new page inside old (restored) category, but still not the pages I migrated from Raspberry Pi.

Details After enabling debug mode I've got something like this:

` [2021-04-22 18:13:28] production.ERROR: Class 'DOMDocument' not found {"userId":1,"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'DOMDocument' not found at /var/www/bookstack/app/Entities/Tools/PageContent.php:322) [stacktrace]

0 /var/www/bookstack/app/Entities/Tools/PageContent.php(172): BookStack\Entities\Tools\PageContent->escapeScripts('<h2 id=\"bkmrk-s...')

1 /var/www/bookstack/app/Http/Controllers/PageController.php(135): BookStack\Entities\Tools\PageContent->render()

2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\Http\Controllers\PageController->show('mytodos', 'technical-overv...')

3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('show', Array)

4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(BookStack\Http\Controllers\PageController), 'show')

5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()

6 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()

7 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(BookStack\Http\Request))

8 /var/www/bookstack/app/Http/Middleware/Authenticate.php(29): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

9 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\Authenticate->handle(Object(BookStack\Http\Request), Object(Closure))

10 /var/www/bookstack/app/Http/Middleware/Localization.php(75): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

11 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\Localization->handle(Object(BookStack\Http\Request), Object(Closure))

12 /var/www/bookstack/app/Http/Middleware/RunThemeActions.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

13 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\RunThemeActions->handle(Object(BookStack\Http\Request), Object(Closure))

14 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

15 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(BookStack\Http\Request), Object(Closure))

16 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

17 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(BookStack\Http\Request), Object(Closure))

18 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

19 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle(Object(BookStack\Http\Request), Object(Closure))

20 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

21 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(BookStack\Http\Request), Object(Closure))

22 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

23 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(BookStack\Http\Request), Object(Closure))

24 /var/www/bookstack/app/Http/Middleware/ControlIframeSecurity.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

25 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\ControlIframeSecurity->handle(Object(BookStack\Http\Request), Object(Closure))

26 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

27 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))

28 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(BookStack\Http\Request))

29 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute(Object(BookStack\Http\Request), Object(Illuminate\Routing\Route))

30 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute(Object(BookStack\Http\Request))

31 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch(Object(BookStack\Http\Request))

32 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(BookStack\Http\Request))

33 /var/www/bookstack/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

34 /var/www/bookstack/app/Http/Middleware/TrustProxies.php(39): Fideloper\Proxy\TrustProxies->handle(Object(BookStack\Http\Request), Object(Closure))

35 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\TrustProxies->handle(Object(BookStack\Http\Request), Object(Closure))

36 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

37 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(BookStack\Http\Request), Object(Closure))

38 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

39 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(BookStack\Http\Request), Object(Closure))

40 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

41 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(BookStack\Http\Request), Object(Closure))

42 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

43 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then(Object(Closure))

44 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(BookStack\Http\Request))

45 /var/www/bookstack/public/index.php(56): Illuminate\Foundation\Http\Kernel->handle(Object(BookStack\Http\Request))

46 {main}

"} `

Since I don't speak php, I don't really know what's wrong there. Do you have any hint, how to access my old (but restored with mysql pages) ?

Thx for hints, help, suggestions in advance! Best regards Max

maxzurawski commented 3 years ago

Ha!

Found solution. Installing php's "xml" & "gd" package fixed the issue.

Sorry for the trouble Cheers, Max