504 Gateway Time-out Error after login to Bookstack portal #3520

Closed
opened 2026-02-05 06:58:16 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @sachinvishwakarma26 on GitHub (Feb 21, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi,

We have implemented Bookstack on Amazon Linux2 OS platform and we are able to login portal using local username and password. Also we have configured LDAP after LDAP configuration we are unable to login to poral using our domain username and password its giving error 504 Gateway Time-out.

Could you please advise to fix this problem.

Note: We are using Nginx web service for bookstack.

Exact BookStack Version

v22.11.1

Log Content

No response

PHP Version

7.4

Hosting Environment

Amazon Linux 2

Originally created by @sachinvishwakarma26 on GitHub (Feb 21, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Hi, We have implemented Bookstack on Amazon Linux2 OS platform and we are able to login portal using local username and password. Also we have configured LDAP after LDAP configuration we are unable to login to poral using our domain username and password its giving error 504 Gateway Time-out. Could you please advise to fix this problem. Note: We are using Nginx web service for bookstack. ### Exact BookStack Version v22.11.1 ### Log Content _No response_ ### PHP Version 7.4 ### Hosting Environment Amazon Linux 2
OVERLORD added the 🐕 Support label 2026-02-05 06:58:16 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 21, 2023):

Also we have configured LDAP after LDAP configuration we are unable to login to poral using our domain username and password its giving error 504 Gateway Time-out.

When does the error occur? Is it upon submitting the login form within BookStack or does it occur when simply attempting to load the login form or homepage?

PHP Version: 7.4

Just a note, the next release will be dropping PHP7.4 support so you'd need to upgrade that before upgrading to the any future releases.

@ssddanbrown commented on GitHub (Feb 21, 2023): > Also we have configured LDAP after LDAP configuration we are unable to login to poral using our domain username and password its giving error 504 Gateway Time-out. When does the error occur? Is it upon submitting the login form within BookStack or does it occur when simply attempting to load the login form or homepage? > PHP Version: 7.4 Just a note, the next release will be dropping PHP7.4 support so you'd need to upgrade that before upgrading to the any future releases.
Author
Owner

@sachinvishwakarma26 commented on GitHub (Feb 22, 2023):

@ssddanbrown After login bookstack portal its giving error.

image

@sachinvishwakarma26 commented on GitHub (Feb 22, 2023): @ssddanbrown After login bookstack portal its giving error. ![image](https://user-images.githubusercontent.com/43565381/220570492-b40e9f26-d8e9-4efd-80c0-a65d44d62d9f.png)
Author
Owner

@ssddanbrown commented on GitHub (Feb 22, 2023):

@sachinvishwakarma26 When you say "After login", does that mean you see the login form beforehand and this error shows on submit?
Or does this error show on first access (You never see the form)?

@ssddanbrown commented on GitHub (Feb 22, 2023): @sachinvishwakarma26 When you say "After login", does that mean you see the login form beforehand and this error shows on submit? Or does this error show on first access (You never see the form)?
Author
Owner

@sachinvishwakarma26 commented on GitHub (Feb 22, 2023):

@ssddanbrown Yes this error giving on after click on submit option.

@sachinvishwakarma26 commented on GitHub (Feb 22, 2023): @ssddanbrown Yes this error giving on after click on submit option.
Author
Owner

@ssddanbrown commented on GitHub (Feb 22, 2023):

Okay, in that case I'd look at the nginx error logs, for messages logged around the same time as when the error shows.

@ssddanbrown commented on GitHub (Feb 22, 2023): Okay, in that case I'd look at the nginx error logs, for messages logged around the same time as when the error shows.
Author
Owner

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023):

@ssddanbrown Please find the attached logs files.

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023): @ssddanbrown Please find the attached logs files.
Author
Owner

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023):

bookstack_2.zip

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023): [bookstack_2.zip](https://github.com/BookStackApp/BookStack/files/10811649/bookstack_2.zip)
Author
Owner

@ssddanbrown commented on GitHub (Feb 23, 2023):

Can't see anything specific regarding that error in those logs. It may be that the error has not occurred in the time range of the logs, or it's not clear if there may be another http layer at play.
Ideally you need to reproduce the error then find the error logs for that specific time that the error occurred for.

@ssddanbrown commented on GitHub (Feb 23, 2023): Can't see anything specific regarding that error in those logs. It may be that the error has not occurred in the time range of the logs, or it's not clear if there may be another http layer at play. Ideally you need to reproduce the error then find the error logs for that specific time that the error occurred for.
Author
Owner

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023):

@ssddanbrown If possible shall i go and schedule a call with you.

@sachinvishwakarma26 commented on GitHub (Feb 23, 2023): @ssddanbrown If possible shall i go and schedule a call with you.
Author
Owner

@ssddanbrown commented on GitHub (Feb 23, 2023):

@sachinvishwakarma26 That is not something I'm willing to do on this free support channel.

@ssddanbrown commented on GitHub (Feb 23, 2023): @sachinvishwakarma26 That is not something I'm willing to do on this free support channel.
Author
Owner

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023):

@ssddanbrown Its seems gateway error due to not able to reach the bookstack using AD Authentication. Can please help us setting up reverse proxy(Redirection) for bookstack running on nginx.

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023): @ssddanbrown Its seems gateway error due to not able to reach the bookstack using AD Authentication. Can please help us setting up reverse proxy(Redirection) for bookstack running on nginx.
Author
Owner

@ssddanbrown commented on GitHub (Mar 6, 2023):

@sachinvishwakarma26 I can try to assist on the BookStack side of things but from the above I'm not convinced requests are reaching your server upon that error message being shown.

How are you handling HTTPS? When you see the BookStack login form, is the page loaded over http or https?

@ssddanbrown commented on GitHub (Mar 6, 2023): @sachinvishwakarma26 I can try to assist on the BookStack side of things but from the above I'm not convinced requests are reaching your server upon that error message being shown. How are you handling HTTPS? When you see the BookStack login form, is the page loaded over http or https?
Author
Owner

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023):

@ssddanbrown

We are using https.

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023): @ssddanbrown We are using https.
Author
Owner

@ssddanbrown commented on GitHub (Mar 6, 2023):

@sachinvishwakarma26 How are you handling HTTPS? How exactly have you set it up in relation to the server that BookStack is used on?

@ssddanbrown commented on GitHub (Mar 6, 2023): @sachinvishwakarma26 How are you handling HTTPS? How exactly have you set it up in relation to the server that BookStack is used on?
Author
Owner

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023):

@ssddanbrown We have followed the below blog to set it up Bookstack and nginx configuration fine we have made listen port 443.

https://www.howtoforge.com/tutorial/centos-bookstack-nginx/

@sachinvishwakarma26 commented on GitHub (Mar 6, 2023): @ssddanbrown We have followed the below blog to set it up Bookstack and nginx configuration fine we have made listen port 443. https://www.howtoforge.com/tutorial/centos-bookstack-nginx/
Author
Owner

@ssddanbrown commented on GitHub (Mar 6, 2023):

Okay, setting 443 alone does not enable valid https.

By going to your URL, I can see it's on HTTPS with a valid amazon certificate, so I presume there's some level of AWS proxy system at play handling HTTPS.
That proxy is probably the origin of the error shown above (but not the cause).

If I had to guess what the error is, I'd say the configured LDAP_SERVER is inaccessible or does not resolve from the server system.
Check that you can ping the domain for your LDAP_SERVER from the host system.

Errors should be logged to the /var/log/nginx/bookstack_error.log file, but you'd need to watch/check that file right after getting the error to show.

@ssddanbrown commented on GitHub (Mar 6, 2023): Okay, setting 443 alone does not enable valid https. By going to your URL, I can see it's on HTTPS with a valid amazon certificate, so I presume there's some level of AWS proxy system at play handling HTTPS. That proxy is probably the origin of the error shown above (but not the cause). If I had to guess what the error is, I'd say the configured `LDAP_SERVER` is inaccessible or does not resolve from the server system. Check that you can `ping` the domain for your `LDAP_SERVER` from the host system. Errors should be logged to the `/var/log/nginx/bookstack_error.log` file, but you'd need to watch/check that file right after getting the error to show.
Author
Owner

@ssddanbrown commented on GitHub (Apr 28, 2023):

Since there's been no follow-up I'm going to close this off.

@ssddanbrown commented on GitHub (Apr 28, 2023): Since there's been no follow-up I'm going to close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3520