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

Content not longer loading for static pages #18

Closed
dathwa opened this issue Oct 19, 2021 · 3 comments
Closed

Content not longer loading for static pages #18

dathwa opened this issue Oct 19, 2021 · 3 comments

Comments

@dathwa
Copy link

dathwa commented Oct 19, 2021

Hi.
Content is no longer loading for static pages.
Failed to load resource: the server responded with a status of 500 (Internal Server Error) /inetis/snippets/list:1
OCMS 2 build 2.1.16
can you please advise?
Thank-you

@Fl0Cri
Copy link
Member

Fl0Cri commented Oct 21, 2021

Hi, I tried to reproduce the problem on my Windows dev machine, and I could indeed reproduce it around 80% of the time. If you have a look at your error log (in storage/logs/system-*.log), you will probably see a few errors like Unknown database 'database'. This is due to an issue explained here laravel/framework#24510 (comment) that happens when using Apache with mod_php and mpm_worker/mpm_winnt (which is a common config in most Wamp/Xampp/laragon setups). The environment variables from the .env file, which are unloaded at the end of a request, are also unloaded from other requests running in parallel in the same process.

There are multiple solutions to fix this issue: probably the best but the most complicated is to move to a FPM/fastcgi manager instead of using mod_php. Another may be to configure apache to use mpm_prefork instead (which is a multi-process instead of a multi-thread manager) but it may require to recompile apache. Or as an easy dirty hack, you can configure your database in config/database.php.

In my environment, I tweaked my Apache config to limit the amount of threads to 15 instead of 150, which reduces (but doesn't eliminate) the chance of getting the issue. Do do this, I uncomented Include conf/extra/httpd-mpm.conf in my httpd.conf and changed the value of mpm_winnt_module -> ThreadsPerChild in this included file.

If you have the same problem, you can close the issue. If it is something else, can you please post an error log so I can figure out what is going on ?

@dathwa
Copy link
Author

dathwa commented Oct 21, 2021

#18 (comment) - Thanks for your response. My issue has actually resolved itsself today. I checked the path in browser "/inetis/snippets/list" and it was in fact accessable.
Glitchy server day?

@dathwa dathwa closed this as completed Oct 21, 2021
@Fl0Cri
Copy link
Member

Fl0Cri commented Oct 21, 2021

Yes, it's completely a matter of glitchy server ;-)

On my dev machine I got the error close to everytime when using the backend, but absolutely never when accessing it directly. This probably has to do with the fact that some other requests are running in parallel.

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

2 participants