Having similar issues (in Laravel, not Lumen) -- the very low failure-rate makes it difficult to reproduce and debug.
Long shot: Did you ever make progress on this?
I'm getting a seemingly random 500 error getting logged as "Database hosts array is empty" in the error logs.
I'm seeing this maybe once out of 300 requests (guess). Repeating the request is successful. Other requests initiated at the same time are also successful. So I will have 4/5 requests work and one fail with the aforementioned error.
I am working with a config/database.php with 5 connections specified. The bulk of the connection details are pulled from .env via getenv. I received this in both Lumen 7 and now Lumen 8. I'm at a bit of a loss as to why this is randomly occurring. It has occurred on multiple boxes talking to different databases.
Searching around indicated this is usually related to configuration issues, but I'm not sure why it would work the majority of the time. Are there any particular PHP or Apache configuration parameters I should look out for with this?
Any help would be appreciated.
Please or to participate in this conversation.