Login on moved site is not working #1089

Closed
opened 2026-02-04 23:43:04 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @adminarf on GitHub (Mar 12, 2019).

Describe the bug

  1. Logging in returns to the login page without messages
  2. Password reset returns to the password reset page without messages

Steps To Reproduce
Steps to reproduce the first issue:

  1. Go to login page
  2. Do not click Remember me
  3. Enter credentials and submit

Steps to reproduce the second issue:

  1. Go to login page
  2. Enter email address and submit

Expected behavior

  1. Expected login and if not I expected an error message.
  2. Expected password reset email

Screenshots
If applicable, add screenshots to help explain your problem.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.20.0
  • PHP Version: 7.1.26
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
The site was copied to a new server and had worked properly on the old server.

.env was updated for new DB and email server details.

I added a new admin account with php artisan bookstack:create-admin. The result was the same.

I changed app_debug to true. This is the result from login:

Views

7 templates were rendered
auth.login (resources/views/auth/login.blade.php) 2 blade
auth.forms.login.standard (resources/views/auth/forms/login/standard.blade.php) 8 blade
form.text (resources/views/form/text.blade.php) 10 blade
form.password (resources/views/form/password.blade.php) 10 blade
public (resources/views/public.blade.php) 8 blade
partials.custom-styles (resources/views/partials/custom-styles.blade.php) 8 blade
partials.notifications (resources/views/partials/notifications.blade.php) 8 blade

Queries

select * from users where system_name = 'public' limit 1 3.02ms /app/User.php:45
select * from settings where setting_key = 'registration-confirmation' limit 1 420μs
/app/Services/SettingService.php:229
select * from users where system_name = 'public' limit 1 330μs /app/User.php:45
select * from settings where setting_key = 'registration-enabled' limit 1 330μs /app/Services/SettingService.php:229

Originally created by @adminarf on GitHub (Mar 12, 2019). **Describe the bug** 1. Logging in returns to the login page without messages 2. Password reset returns to the password reset page without messages **Steps To Reproduce** Steps to reproduce the first issue: 1. Go to login page 2. Do not click Remember me 3. Enter credentials and submit Steps to reproduce the second issue: 1. Go to login page 2. Enter email address and submit **Expected behavior** 1. Expected login and if not I expected an error message. 2. Expected password reset email **Screenshots** If applicable, add screenshots to help explain your problem. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.20.0 - PHP Version: 7.1.26 - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** The site was copied to a new server and had worked properly on the old server. .env was updated for new DB and email server details. I added a new admin account with `php artisan bookstack:create-admin`. The result was the same. I changed app_debug to true. This is the result from login: **Views** > 7 templates were rendered > auth.login (resources/views/auth/login.blade.php) 2 blade > auth.forms.login.standard (resources/views/auth/forms/login/standard.blade.php) 8 blade > form.text (resources/views/form/text.blade.php) 10 blade > form.password (resources/views/form/password.blade.php) 10 blade > public (resources/views/public.blade.php) 8 blade > partials.custom-styles (resources/views/partials/custom-styles.blade.php) 8 blade > partials.notifications (resources/views/partials/notifications.blade.php) 8 blade **Queries** > select * from `users` where `system_name` = 'public' limit 1 3.02ms /app/User.php:45 > select * from `settings` where `setting_key` = 'registration-confirmation' limit 1 420μs > /app/Services/SettingService.php:229 > select * from `users` where `system_name` = 'public' limit 1 330μs /app/User.php:45 > select * from `settings` where `setting_key` = 'registration-enabled' limit 1 330μs /app/Services/SettingService.php:229
OVERLORD added the 🐕 Support label 2026-02-04 23:43:04 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 13, 2019):

Hi @adminarf,
Sorry to hear you are facing issues.

Hard to know what's the issue here. This kind of thing can often occur if the browser does not save cookies for the site or if there's a change of domain during the login and post-login redirect.

Do you have the APP_URL option set in your .env file? Might be worth setting to force a domain. Also worth trying a different browser just to rule-out any overzealous cookie defences.

@ssddanbrown commented on GitHub (Mar 13, 2019): Hi @adminarf, Sorry to hear you are facing issues. Hard to know what's the issue here. This kind of thing can often occur if the browser does not save cookies for the site or if there's a change of domain during the login and post-login redirect. Do you have the `APP_URL` option set in your `.env` file? Might be worth setting to force a domain. Also worth trying a different browser just to rule-out any overzealous cookie defences.
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2019):

Due to the lack of response from the original issue author I will close this.
If this issue remains please feel free to open a new issue, referencing this one.

@ssddanbrown commented on GitHub (May 18, 2019): Due to the lack of response from the original issue author I will close this. If this issue remains please feel free to open a new issue, referencing this one.
Author
Owner

@Biepa commented on GitHub (Oct 21, 2021):

Just moved my installation.
APP_URL was set to the new domain.
Since this is just temporary i moved from https to http, if this is useful.
The login page loads fine, but login with two different accounts is not possible.

In the .env file is a note:
php artisan bookstack:update-url https://old.example.com https://new.example.com
The output is:
Could not open input file: artisan

I am using the linuxserver docker container.
I am not very familiar with php.
Is there a easy way to install artisan to complete the migration?

@Biepa commented on GitHub (Oct 21, 2021): Just moved my installation. APP_URL was set to the new domain. Since this is just temporary i moved from https to http, if this is useful. The login page loads fine, but login with two different accounts is not possible. In the .env file is a note: `php artisan bookstack:update-url https://old.example.com https://new.example.com` The output is: `Could not open input file: artisan` I am using the linuxserver docker container. I am not very familiar with php. Is there a easy way to install artisan to complete the migration?
Author
Owner

@ssddanbrown commented on GitHub (Oct 21, 2021):

Hi @Biepa,
Artisan will be within the container.

For a linuxserver.io container, artisan commands can be ran as per below assuming your main bookstack container is called bookstack:

docker exec -it bookstack /var/www/html/artisan

Running the above should output all commands. Then you just use the above as a base instead of php artisan.

@ssddanbrown commented on GitHub (Oct 21, 2021): Hi @Biepa, Artisan will be within the container. For a linuxserver.io container, artisan commands can be ran as per below assuming your main bookstack container is called `bookstack`: ```bash docker exec -it bookstack /var/www/html/artisan ``` Running the above should output all commands. Then you just use the above as a base instead of `php artisan`.
Author
Owner

@Biepa commented on GitHub (Oct 25, 2021):

@ssddanbrown
Hey,
thank you for the hint.
I've done it and this is the output

Updated 0 rows in attachments->path
Updated 0 rows in pages->html
Updated 0 rows in pages->text
Updated 0 rows in pages->markdown
Updated 0 rows in images->url
Updated 0 rows in settings->value
Updated 0 rows in comments->html
Updated 0 rows in comments->text
Updated 0 JSON encoded rows in settings->value
URL update procedure complete.
============================================================================
Be sure to run "php artisan cache:clear" to clear any old URLs in the cache.
============================================================================

Unfortunately I still can't login.

@Biepa commented on GitHub (Oct 25, 2021): @ssddanbrown Hey, thank you for the hint. I've done it and this is the output ``` Updated 0 rows in attachments->path Updated 0 rows in pages->html Updated 0 rows in pages->text Updated 0 rows in pages->markdown Updated 0 rows in images->url Updated 0 rows in settings->value Updated 0 rows in comments->html Updated 0 rows in comments->text Updated 0 JSON encoded rows in settings->value URL update procedure complete. ============================================================================ Be sure to run "php artisan cache:clear" to clear any old URLs in the cache. ============================================================================ ``` Unfortunately I still can't login.
Author
Owner

@ssddanbrown commented on GitHub (Oct 25, 2021):

Unfortunately I still can't login.

Any indicator of what occurs upon login? Are you redirected to the wrong location? Or do you see an error message?

@ssddanbrown commented on GitHub (Oct 25, 2021): > Unfortunately I still can't login. Any indicator of what occurs upon login? Are you redirected to the wrong location? Or do you see an error message?
Author
Owner

@Biepa commented on GitHub (Oct 25, 2021):

I get the error message, that the credentials are not correct. But they are still working on the "old" instance, so that cant be the problem.

@Biepa commented on GitHub (Oct 25, 2021): I get the error message, that the credentials are not correct. But they are still working on the "old" instance, so that cant be the problem.
Author
Owner

@ssddanbrown commented on GitHub (Oct 25, 2021):

@Biepa Okay, that'll have nothing to do with the command above. Are you sure your new database is populated at all? The system won't differentiate between a non-existing user and non-existing credentials in any way. Would think either the user does not exist in the system or the credentials are incorrect.

@ssddanbrown commented on GitHub (Oct 25, 2021): @Biepa Okay, that'll have nothing to do with the command above. Are you sure your new database is populated at all? The system won't differentiate between a non-existing user and non-existing credentials in any way. Would think either the user does not exist in the system or the credentials are incorrect.
Author
Owner

@Biepa commented on GitHub (Oct 25, 2021):

@ssddanbrown I first found, that i misscopied something.
Now everything should be in its place.
I can ping the db container from within the bookstack container. The credentials in the .env file are the right ones.
When opening my new url the debug error page shows:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from settingswheresetting_key = app-public limit 1)

The db container shows:

211025 19:46:50 mysqld_safe Logging to '/config/databases/f4488c06cd18.err'.
211025 19:46:50 mysqld_safe Starting mariadbd daemon with databases from /config/databases

In this log i found the following lines repeatingly:

2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-10-25 19:46:59 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-10-25 19:46:59 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-10-25 19:46:59 0 [ERROR] Aborting
211025 19:46:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
211025 19:46:59 mysqld_safe Starting mariadbd daemon with databases from /config/databases
2021-10-25 19:46:59 0 [Note] /usr/bin/mariadbd (mysqld 10.5.12-MariaDB-log) starting as process 10849 ...
2021-10-25 19:46:59 0 [Note] InnoDB: Uses event mutexes
2021-10-25 19:46:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-25 19:46:59 0 [Note] InnoDB: Number of pools: 1
2021-10-25 19:46:59 0 [Note] InnoDB: Using generic crc32 instructions
2021-10-25 19:46:59 0 [Note] mariadbd: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2021-10-25 19:46:59 0 [Note] InnoDB: Using Linux native AIO
2021-10-25 19:46:59 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2021-10-25 19:46:59 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-25 19:46:59 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.13.
2021-10-25 19:46:59 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-10-25 19:46:59 0 [Note] InnoDB: Starting shutdown...

The data should be the same on both hosts, since i made a tar file of each volume on the one side and extracted it on the other host for both containers.

@Biepa commented on GitHub (Oct 25, 2021): @ssddanbrown I first found, that i misscopied something. Now everything should be in its place. I can ping the db container from within the bookstack container. The credentials in the .env file are the right ones. When opening my new url the debug error page shows: `SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `settings` where `setting_key` = app-public limit 1)` The db container shows: ``` 211025 19:46:50 mysqld_safe Logging to '/config/databases/f4488c06cd18.err'. 211025 19:46:50 mysqld_safe Starting mariadbd daemon with databases from /config/databases ``` In this log i found the following lines repeatingly: ``` 2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' init function returned error. 2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2021-10-25 19:46:59 0 [Note] Plugin 'FEEDBACK' is disabled. 2021-10-25 19:46:59 0 [ERROR] Unknown/unsupported storage engine: InnoDB 2021-10-25 19:46:59 0 [ERROR] Aborting 211025 19:46:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 211025 19:46:59 mysqld_safe Starting mariadbd daemon with databases from /config/databases 2021-10-25 19:46:59 0 [Note] /usr/bin/mariadbd (mysqld 10.5.12-MariaDB-log) starting as process 10849 ... 2021-10-25 19:46:59 0 [Note] InnoDB: Uses event mutexes 2021-10-25 19:46:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2021-10-25 19:46:59 0 [Note] InnoDB: Number of pools: 1 2021-10-25 19:46:59 0 [Note] InnoDB: Using generic crc32 instructions 2021-10-25 19:46:59 0 [Note] mariadbd: O_TMPFILE is not supported on /var/tmp (disabling future attempts) 2021-10-25 19:46:59 0 [Note] InnoDB: Using Linux native AIO 2021-10-25 19:46:59 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728 2021-10-25 19:46:59 0 [Note] InnoDB: Completed initialization of buffer pool 2021-10-25 19:46:59 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.13. 2021-10-25 19:46:59 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2021-10-25 19:46:59 0 [Note] InnoDB: Starting shutdown... ``` The data should be the same on both hosts, since i made a tar file of each volume on the one side and extracted it on the other host for both containers.
Author
Owner

@ssddanbrown commented on GitHub (Oct 26, 2021):

2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

Sounds like quite a fundamental error on the DB side. How was the database copied in? If via mounted volume files you'd probably want to ensure the image used is exactly the same (Including exact same version/hash) otherwise a DB dump, then re-import from dump, may prove more reliable.

@ssddanbrown commented on GitHub (Oct 26, 2021): > 2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' init function returned error. 2021-10-25 19:46:59 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. Sounds like quite a fundamental error on the DB side. How was the database copied in? If via mounted volume files you'd probably want to ensure the image used is exactly the same (Including exact same version/hash) otherwise a DB dump, then re-import from dump, may prove more reliable.
Author
Owner

@Biepa commented on GitHub (Oct 29, 2021):

@ssddanbrown
You were right. I somehow made a mistake in transferring the data.
Login was possible now. Thanks for taking the time. 👍

@Biepa commented on GitHub (Oct 29, 2021): @ssddanbrown You were right. I somehow made a mistake in transferring the data. Login was possible now. Thanks for taking the time. :+1:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1089