v0.25.1 // Cannot log in with standard or LDAP auth, debug not showing up... #1022

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

Originally created by @derek-shnosh on GitHub (Feb 2, 2019).

Describe the bug
A user reported that they could not log in, I was logged in and was able to view the site fine. I logged out and am now unable to log back in; I'm simply given a message stating, An unknown error occurred, return to home.

I set AUTH_METHOD=standard in my .env and attempted to log in using the local account but was presented with the same message.

I then ran php artisan bookstack:create-admin to create a new account, which reportedly succeeded, but I'm getting the same message with this new account as well.

I set APP_DEBUG=true in my .env and refreshed the page, but the debug bar did not show.

Screenshots
image

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.25.1
  • PHP Version: PHP 7.2.10-0ubuntu0.18.04.1
  • Hosting Method (Nginx/Apache/Docker): Apache/2.4.29 (Ubuntu)

Additional context
This is one of two servers in the environment, the other seems to be working fine on the same version.

Originally created by @derek-shnosh on GitHub (Feb 2, 2019). **Describe the bug** A user reported that they could not log in, I was logged in and was able to view the site fine. I logged out and am now unable to log back in; I'm simply given a message stating, _An unknown error occurred, return to home_. I set `AUTH_METHOD=standard` in my **.env** and attempted to log in using the local account but was presented with the same message. I then ran `php artisan bookstack:create-admin` to create a new account, which reportedly succeeded, but I'm getting the same message with this new account as well. I set `APP_DEBUG=true` in my **.env** and refreshed the page, but the debug bar did not show. **Screenshots** ![image](https://user-images.githubusercontent.com/21090563/52160543-4e178b00-266c-11e9-8866-fda82cc47c40.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): v0.25.1 - PHP Version: PHP 7.2.10-0ubuntu0.18.04.1 - Hosting Method (Nginx/Apache/Docker): Apache/2.4.29 (Ubuntu) **Additional context** This is one of two servers in the environment, the other seems to be working fine on the same version.
OVERLORD added the 🐕 Support label 2026-02-04 23:25:43 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 4, 2019):

Hi @derek-shnosh,

It's really odd that APP_DEBUG=true does not seem to be taking effect.
When you change the AUTH_METHOD to standard do you see the login inputs change (From username to email)?

Just wondering if any of your .env options are taking effect or just the debug one. Could possible be caching of some kind.

@ssddanbrown commented on GitHub (Feb 4, 2019): Hi @derek-shnosh, It's really odd that `APP_DEBUG=true` does not seem to be taking effect. When you change the `AUTH_METHOD` to `standard` do you see the login inputs change (From username to email)? Just wondering if any of your .env options are taking effect or just the debug one. Could possible be caching of some kind.
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown - interesting, seems my .env file is being ignored because changing the AUTH_METHOD doesn't reflect a change to the login screen. Any ideas?

There are a few .env files in my bookstack dir;

docs@docs:~$ ll /var/www/docs/synergy/.env*
-rw-r--r-- 1 root root 2.8K Feb  4 13:19 /var/www/docs/synergy/.env
-rw-r--r-- 1 root root 2.2K Aug 18 01:50 /var/www/docs/synergy/.env.bak
-rw-r--r-- 1 root root  832 Jan 27 16:26 /var/www/docs/synergy/.env.example
-rw-r--r-- 1 root root 5.9K Jan 27 16:26 /var/www/docs/synergy/.env.example.complete
-rw-r--r-- 1 root root 2.3K Aug 18 02:18 /var/www/docs/synergy/.env.orig
-rw-r--r-- 1 root root 2.9K Aug 21 07:49 /var/www/docs/synergy/.env.save
@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown - interesting, seems my .env file is being ignored because changing the `AUTH_METHOD` doesn't reflect a change to the login screen. Any ideas? There are a few `.env` files in my bookstack dir; ``` docs@docs:~$ ll /var/www/docs/synergy/.env* -rw-r--r-- 1 root root 2.8K Feb 4 13:19 /var/www/docs/synergy/.env -rw-r--r-- 1 root root 2.2K Aug 18 01:50 /var/www/docs/synergy/.env.bak -rw-r--r-- 1 root root 832 Jan 27 16:26 /var/www/docs/synergy/.env.example -rw-r--r-- 1 root root 5.9K Jan 27 16:26 /var/www/docs/synergy/.env.example.complete -rw-r--r-- 1 root root 2.3K Aug 18 02:18 /var/www/docs/synergy/.env.orig -rw-r--r-- 1 root root 2.9K Aug 21 07:49 /var/www/docs/synergy/.env.save ```
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2019):

@derek-shnosh Hmm, Could possibly be the application cache.

You could try running:

php artisan config:clear
php artisan cache:clear

in the BookStack dir, See if that clears things

@ssddanbrown commented on GitHub (Feb 5, 2019): @derek-shnosh Hmm, Could possibly be the application cache. You could try running: ``` php artisan config:clear php artisan cache:clear ``` in the BookStack dir, See if that clears things
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown unfortunately that didn't help as I'm experiencing the same symptoms.

@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown unfortunately that didn't help as I'm experiencing the same symptoms.
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2019):

@derek-shnosh Really odd 😕

If you temporarily move all the .env files out of the default location (backup first 😨) does it break BookStack or does it still work?

@ssddanbrown commented on GitHub (Feb 5, 2019): @derek-shnosh Really odd :confused: If you temporarily move all the `.env` files out of the default location (backup first :fearful:) does it break BookStack or does it still work?
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown I was previously running through a reverse proxy (even internally) but I've disabled that to troubleshoot/validate; also because I kept getting redirected back to its https URL (https://docs.domain.com) when accessing the local host name (http://docs.domain.local)... even after changing the APP_URL to the local host name.

Now, whether the .env files exist in the root directory or not, I get nothing when I try to go to http://docs.domain.local. I ran NMAP against the host (before and after moving .env files) and found this interesting;

80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-favicon: Unknown favicon MD5: <omitted>
| http-methods: 
|_  Supported Methods: GET HEAD OPTIONS
| http-robots.txt: 1 disallowed entry 
|_/
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Did not follow redirect to https://docs.domain.com/login

That last line Did not follow redirect to https://docs.domain.com/login (actual TLD omitted) is weird. I checked my apache2 config (/etc/apache2/sites-enabled/docs-synergy.conf) file and there is no redirect configured there.

<VirtualHost *:80>
        ServerName docs.synergy.local

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/docs/synergy/public/

    <Directory /var/www/docs/synergy/public/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_rewrite.c>
            <IfModule mod_negotiation.c>
                Options -MultiViews -Indexes
            </IfModule>

            RewriteEngine On

            # Handle Authorization Header
            RewriteCond %{HTTP:Authorization} .
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

            # Redirect Trailing Slashes If Not A Folder...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_URI} (.+)/$
            RewriteRule ^ %1 [L,R=301]

            # Handle Front Controller...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ index.php [L]
        </IfModule>
    </Directory>

        ErrorLog /error.log
        CustomLog /access.log combined

</VirtualHost>
@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown I was previously running through a reverse proxy (even internally) but I've disabled that to troubleshoot/validate; also because I kept getting redirected back to its https URL (https://docs.domain.com) when accessing the local host name (http://docs.domain.local)... even after changing the `APP_URL` to the local host name. Now, whether the `.env` files exist in the root directory or not, I get nothing when I try to go to http://docs.domain.local. I ran NMAP against the host (before and after moving `.env` files) and found this interesting; ``` 80/tcp open http Apache httpd 2.4.29 ((Ubuntu)) |_http-favicon: Unknown favicon MD5: <omitted> | http-methods: |_ Supported Methods: GET HEAD OPTIONS | http-robots.txt: 1 disallowed entry |_/ |_http-server-header: Apache/2.4.29 (Ubuntu) |_http-title: Did not follow redirect to https://docs.domain.com/login ``` That last line **Did not follow redirect to https://docs.domain.com/login** (actual TLD omitted) is weird. I checked my apache2 config (`/etc/apache2/sites-enabled/docs-synergy.conf`) file and there is no redirect configured there. ``` <VirtualHost *:80> ServerName docs.synergy.local ServerAdmin webmaster@localhost DocumentRoot /var/www/docs/synergy/public/ <Directory /var/www/docs/synergy/public/> Options Indexes FollowSymLinks AllowOverride None Require all granted <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> </Directory> ErrorLog /error.log CustomLog /access.log combined </VirtualHost> ```
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2019):

@derek-shnosh Pretty sure that redirect is performed by BookStack since it's to the /login page. I get the same on my local dev instance (Requesting bookstack.local, but bookstack currently configured for bookstackdev.com, both domains point to same place, BookStack redirecting based on APP_URL):

dan@desktop:~|⇒  nmap --script http-title bookstack.local      

Starting Nmap 7.60 ( https://nmap.org ) at 2019-02-04 22:01 GMT
Nmap scan report for bookstack.local (127.0.0.1)
Host is up (0.000063s latency).
rDNS record for 127.0.0.1: localhost
Not shown: 996 closed ports
PORT     STATE SERVICE
80/tcp   open  http
|_http-title: Did not follow redirect to http://bookstackdev.com/login
631/tcp  open  ipp
|_http-title: Bad Request - CUPS v2.2.8
3306/tcp open  mysql
8080/tcp open  http-proxy
|_http-title: Welcome to nginx!

Is the redirect URL, that nmap does not follow, the one you expect bookstack to be on?

@ssddanbrown commented on GitHub (Feb 5, 2019): @derek-shnosh Pretty sure that redirect is performed by BookStack since it's to the /login page. I get the same on my local dev instance (Requesting bookstack.local, but bookstack currently configured for bookstackdev.com, both domains point to same place, BookStack redirecting based on APP_URL): ``` dan@desktop:~|⇒ nmap --script http-title bookstack.local Starting Nmap 7.60 ( https://nmap.org ) at 2019-02-04 22:01 GMT Nmap scan report for bookstack.local (127.0.0.1) Host is up (0.000063s latency). rDNS record for 127.0.0.1: localhost Not shown: 996 closed ports PORT STATE SERVICE 80/tcp open http |_http-title: Did not follow redirect to http://bookstackdev.com/login 631/tcp open ipp |_http-title: Bad Request - CUPS v2.2.8 3306/tcp open mysql 8080/tcp open http-proxy |_http-title: Welcome to nginx! ``` Is the redirect URL, that nmap does not follow, the one you expect bookstack to be on?
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown It seems that bookstack is completely ignoring my .env file as you previously suspected.

My APP_URL is currently configured to http://docs.synergy.local, which is the server the site is hosted on. So if anything it should just redirect to http://docs.synergy.local/login.

I manually entered that http URL and am presented with a broken site; i.e. huge fonts/symbols.

If I scroll down to the login fields (which ask for a username and password) and enter my credentials, it tries to log in via redirect to https://docs.domain.com.

@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown It seems that bookstack is completely ignoring my `.env` file as you previously suspected. My `APP_URL` is currently configured to `http://docs.synergy.local`, which is the server the site is hosted on. So if anything it should just redirect to http://docs.synergy.local/login. I manually entered that http URL and am presented with a broken site; i.e. huge fonts/symbols. If I scroll down to the login fields (which ask for a **username** and **password**) and enter my credentials, it tries to log in via redirect to https://docs.domain.com.
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown unsure if this helps, but of the three bookstack deployments (different servers) that I've got on v0.25.1, this is the only one that doesn't use the default DocumentRoot for apache; i.e. instead of /var/www/bookstack, I'm hosting from /var/www/docs/synergy/. Coincidentally, this is also the only server having an issue.

Definitely not throwing stones, just curious if any changes were made between the previous v0.24.3 release and v0.25.1 that may impact how .env is parsed, at least pertaining to its location.

@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown unsure if this helps, but of the three bookstack deployments (different servers) that I've got on v0.25.1, this is the only one that doesn't use the default `DocumentRoot` for apache; i.e. instead of `/var/www/bookstack`, I'm hosting from `/var/www/docs/synergy/`. Coincidentally, this is also the only server having an issue. Definitely not throwing stones, just curious if any changes were made between the previous v0.24.3 release and v0.25.1 that may impact how `.env` is parsed, at least pertaining to its location.
Author
Owner

@derek-shnosh commented on GitHub (Feb 5, 2019):

@ssddanbrown things are working, here's what I did.

  1. Copied folder structure from /var/www/docs/synergy/ to /var/www/bookstack/, set permissions on bootstrap/cache, public/uploads and storage (as the install script does), edited apache config to point to this directory instead and restarted the apache service.

    Accessing http://docs.synergy.local still tries to redirect to https://docs.domain.com.

  2. Ran php artistan cache:clear, php artistan view:clear, and php artistan config:clear.

    Everything works! i.e; .env file is honored again, Standard and LDAP auth as well as Debug working.

  3. Edited apache config to point to /var/www/docs/synergy/ again and restarted services, ran the php artisan x commands.

    Broken again; i.e. trying to redirect to https://docs.domain.com.

In all honesty, I don't know what the php artisan commands do, but I found the view:clear in the update guide and figured I'd give it a shot. Being that I ran those commands against both directories, It seems that maybe something gets hosed up when using a non-standard working directory.

I'm back working though, now that I've changed apache to point to /var/www/bookstack.

@derek-shnosh commented on GitHub (Feb 5, 2019): @ssddanbrown things are working, here's what I did. 1. Copied folder structure from `/var/www/docs/synergy/` to `/var/www/bookstack/`, set permissions on `bootstrap/cache`, `public/uploads` and `storage` (as the install script does), edited apache config to point to this directory instead and restarted the apache service. > Accessing http://docs.synergy.local still tries to redirect to https://docs.domain.com. 2. Ran `php artistan cache:clear`, `php artistan view:clear`, and `php artistan config:clear`. > **Everything works!** i.e; `.env` file is honored again, Standard and LDAP auth as well as Debug working. 3. Edited apache config to point to `/var/www/docs/synergy/` again and restarted services, ran the `php artisan x` commands. > Broken again; i.e. trying to redirect to https://docs.domain.com. In all honesty, I don't know what the `php artisan` commands do, but I found the `view:clear` in the [update guide](https://www.bookstackapp.com/docs/admin/updates/) and figured I'd give it a shot. Being that I ran those commands against both directories, It seems that _maybe_ something gets hosed up when using a non-standard working directory. I'm back working though, now that I've changed apache to point to `/var/www/bookstack`.
Author
Owner

@ssddanbrown commented on GitHub (Feb 6, 2019):

@derek-shnosh Awesome, Glade to hear things are working now and thanks for providing the info.

Sounds like just some extra-sticky caching at play, possibly could be affected by file permissions (Since they can effect ability to clear the cache).

Will now close this since it sounds like things are good now.

@ssddanbrown commented on GitHub (Feb 6, 2019): @derek-shnosh Awesome, Glade to hear things are working now and thanks for providing the info. Sounds like just some extra-sticky caching at play, possibly could be affected by file permissions (Since they can effect ability to clear the cache). Will now close this since it sounds like things are good now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1022