Skip to content
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

Database connect error 504: Timeout #941

Closed
ladismrkolj opened this issue Jan 5, 2018 · 32 comments
Closed

Database connect error 504: Timeout #941

ladismrkolj opened this issue Jan 5, 2018 · 32 comments

Comments

@ladismrkolj
Copy link

System Information

  • PartKeepr Version: 1.3.0
  • Reproducible on the demo system: No.
  • Apache 2.4
  • PHP 7
  • Synology NAS

How to reproduce

partkeeprerror

  • When I fill in the mysql data (which works, since I tested the conection in a separate script) and click next, I expect to successfully connect to mysql DB (in my case MariaDB 5 also tried 10), but after 60 sec it says Invalid response from server and when I open popup it says 504 Gateway Time out error.
@Drachenkaetzchen
Copy link
Member

Most likely scenario: The system is too slow and runs into a timeout. Try to increase the php max_execution_time. However, most likely PartKeepr will run very slowly on a NAS.

@ladismrkolj
Copy link
Author

ladismrkolj commented Jan 5, 2018

Yes what I found out is that it stops after 60 seconds, even though the default max_execution_time is 240, but still I raised it to 300, and nothing changed (still errors after 60s)
Is there any other parameter to change to delay the timeout?

@Drachenkaetzchen
Copy link
Member

No idea, I never used nginx

@Drachenkaetzchen
Copy link
Member

Checking the log files would probably be a good idea

@ladismrkolj
Copy link
Author

Yes but I don't use nginx (strange, that the error is nginx, eve though I use Apache 2.4)

@Drachenkaetzchen
Copy link
Member

Well the error message is clearly issued by nginx, so I suggest you look into that. Nothing much I can do here

@ladismrkolj
Copy link
Author

What file acctually does the mysqli query?

@Drachenkaetzchen
Copy link
Member

Queries are done by the Doctrine framework. I can assure you, it's not a database problem. PartKeepr creates a cache prior any database connection, and that takes too much time on your system.

Try to find out:

  • Why you receive error messages from nginx
  • Figure out why nginx runs into a timeout

It makes no sense to debug on the wrong end..

@ladismrkolj
Copy link
Author

I have already tried to figure out both of them. I assumed that the nginx error was something with proxies but after testing I've ruled it out, and the second one I thought it was because it never reached the DB. But now that I understand a bit better how it works, at least the first thought is completely wrong. I've searched the Internet, but was dissapointed with the number of valid results, actually I am still reading forum threads.

@ladismrkolj
Copy link
Author

ladismrkolj commented Jan 5, 2018

Also I am doing a clean install of everything now and will be testing soon.
And do you maybe now how to call php 7 from ssh, since there are more php installed on server and I only know that the server's php is "php", my php5.6 is "php56", but for my php7 idk.

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@ladismrkolj
Copy link
Author

Drachenkaetzchen the error is issued by nginx because Synology uses reverse-proxy to forward to Apache. All web-site trafic goes through nginx and is then respectively either linked to Apache or procesed by nginx. SO I tried to run the webpage with nginx, but I get a 405 Not Allowed error. khm

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@ladismrkolj
Copy link
Author

Well the problem is that my nas isn't supported by docker.

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@ladismrkolj
Copy link
Author

Yes, and I get an error, that this package (tried different versions and architectures) isn't compatible with my dsm version or device. BTW: I am using Synology NAS ds216se (not the best out there)

@ladismrkolj
Copy link
Author

Is it possible to run it without LDAP extension, since I have hosting for my other website and sadly it doesn't support it?

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@ladismrkolj
Copy link
Author

ladismrkolj commented Jan 6, 2018

As I already posted, I ran it directly on nginx, 405 errors and alike, and os is DSM 6.1.4.
And for LDAP, I cannot proceede without it, I could edit the .php file to ignore the error but I don't know if than all would function properly.
EDIT: I tested the setup without LDAP and with bypassing the check, I stop at mysql query that requires LDAP.

@X3msnake
Copy link

X3msnake commented Jan 6, 2018 via email

@ladismrkolj
Copy link
Author

There is my bad, DSM is just a linux distro.

@ladismrkolj
Copy link
Author

yes I have a RPI, but I don't want to have a dedicated server, I want to put this webpage on something I would use anyway.

@X3msnake
Copy link

X3msnake commented Jan 7, 2018

If i read right you have a shared web server. What is the company? Try there.

You can try running the setup and emailing the company with a printscreen of the warnings and ask them to enable ldap.

They did this for me on a shared account I have and it is working great.

@ladismrkolj
Copy link
Author

I have already tried on live chat support (they said no), I suppose I could also take a print screen and email that to them. I am on one.com .

@keton
Copy link

keton commented Jan 10, 2018

ext-all.js in partkeepr has hard coded timeout value. More here: #914

@ladismrkolj
Copy link
Author

ladismrkolj commented Jan 11, 2018

After the last post I tried again with nginx as a back-end server. I went through error.log and systematicly solved issue by issue, until nginx stopped giving errors. But still sometimes (or many times) I would get an error without code (Invalid response from server), and the return status code was 0. So I added fastcgi timeout 300 to my nginx configuration file for the website. It solved some issues, but still it returned the error after 60s but I got up to setup 2/2. Than at warming up again the "Invalid response from server" error. So I refreshed the site and now I got the same error at checking php configuration. Obviously it was because my poor server was overloaded. I hope that the #914 solution solves it.

@ladismrkolj
Copy link
Author

You may close this issue, It is hardware problem (too slow). I disabled LDAP and installed it on my web-hosting.

@X3msnake
Copy link

X3msnake commented Jan 17, 2018 via email

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

No branches or pull requests

4 participants