partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 401 forks source link

Database connect error 504: Timeout #941

Closed ladismrkolj closed 6 years ago

ladismrkolj commented 6 years ago

System Information

How to reproduce

partkeeprerror

Drachenkaetzchen commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

No idea, I never used nginx

Drachenkaetzchen commented 6 years ago

Checking the log files would probably be a good idea

ladismrkolj commented 6 years ago

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

Drachenkaetzchen commented 6 years ago

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

ladismrkolj commented 6 years ago

What file acctually does the mysqli query?

Drachenkaetzchen commented 6 years ago

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:

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

ladismrkolj commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

where are you installing this?

is it a raspy, a virtual machine some shared host?

2018-01-05 20:47 GMT+00:00 ladismrkolj notifications@github.com:

Also I am doing a clean install of everything now and will be testing soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355661223, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-nkzmeEEfRYVG2n7JuUJtVxw7KXRks5tHopKgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

X3msnake commented 6 years ago

try the docker image if you are using a Synology NAS

2018-01-06 5:20 GMT+00:00 Vinicius Silva x3msnake@gmail.com:

where are you installing this?

is it a raspy, a virtual machine some shared host?

2018-01-05 20:47 GMT+00:00 ladismrkolj notifications@github.com:

Also I am doing a clean install of everything now and will be testing soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355661223, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-nkzmeEEfRYVG2n7JuUJtVxw7KXRks5tHopKgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

-- Com os melhores cumprimentos, Vinicius Silva

X3msnake commented 6 years ago

https://github.com/mhubig/docker-partkeepr

2018-01-06 5:21 GMT+00:00 Vinicius Silva x3msnake@gmail.com:

try the docker image if you are using a Synology NAS

2018-01-06 5:20 GMT+00:00 Vinicius Silva x3msnake@gmail.com:

where are you installing this?

is it a raspy, a virtual machine some shared host?

2018-01-05 20:47 GMT+00:00 ladismrkolj notifications@github.com:

Also I am doing a clean install of everything now and will be testing soon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355661223, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-nkzmeEEfRYVG2n7JuUJtVxw7KXRks5tHopKgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

-- Com os melhores cumprimentos, Vinicius Silva

-- Com os melhores cumprimentos, Vinicius Silva

ladismrkolj commented 6 years ago

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 commented 6 years ago

Did you try the docker?

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355735855, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-vSxUeZsIkt6fa25gvseUYHVGK1gks5tH0FFgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

ladismrkolj commented 6 years ago

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

X3msnake commented 6 years ago

What version r u using?

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355746710, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-tlS9s0cWnJM6qqORN_uj1zWXqVJks5tH3OAgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

X3msnake commented 6 years ago

Did u try this?

https://tylermade.net/2017/09/28/how-to-install-docker-on-an-unsupported-synology-nas/

No dia sábado, 6 de janeiro de 2018, Vinicius Silva x3msnake@gmail.com escreveu:

What version r u using?

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355746710, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-tlS9s0cWnJM6qqORN_uj1zWXqVJks5tH3OAgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

-- Com os melhores cumprimentos, Vinicius Silva

ladismrkolj commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

So i assume you are using a virtual machine then?

With ssh? Do you know what version is the os?

You can try running partkeepr with nginx instead of apache.

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

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)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355759124, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-u6nea-epRXTaRInk5cdyFm4qV0mks5tH6NDgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

X3msnake commented 6 years ago

I think it will give a warning only but it can run

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355761251, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-sV_Q8_9ZP7DRkNVItc4C2rTgwFNks5tH6q0gaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

ladismrkolj commented 6 years ago

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 commented 6 years ago

I see thought you said you were trying with apache, my bad. Dont you have a raspberry pi that you can use?

Didnt knew dsm was the os. Sorry.

No dia sábado, 6 de janeiro de 2018, ladismrkolj notifications@github.com escreveu:

As I already posted, I ran it directly on nginx, 405 errors and alike, and os is DSM 6.1.4

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#issuecomment-355763296, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-k8V0pYJGhVlLLqbiZinCF3j2Uxrks5tH7JCgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva

ladismrkolj commented 6 years ago

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

ladismrkolj commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

ladismrkolj commented 6 years ago

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 commented 6 years ago

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

X3msnake commented 6 years ago

thanks for posting back

2018-01-17 17:04 GMT+00:00 ladismrkolj notifications@github.com:

Closed #941 https://github.com/partkeepr/PartKeepr/issues/941.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/partkeepr/PartKeepr/issues/941#event-1428717889, or mute the thread https://github.com/notifications/unsubscribe-auth/AKke-l4i4v0PzUOMXw6Tqx_LWhaMGQ_2ks5tLigCgaJpZM4RUu4q .

-- Com os melhores cumprimentos, Vinicius Silva