Closed CamKem closed 1 month ago
@CamKem thank you for reporting this.
It seems like your herd configuration file is empty, as the fill
method gets called with an empty string.
Do you have a way to reproduce this issue?
We are looking for the configuration file at this location:
$_SERVER['HOME'] . '/Library/Application Support/Herd/config/herd.json';
Could it be that the HOME
variable is modified in your nginx configuration or something similar? I assume that you have an existing herd.json config file, right?
Hey Marcel, Yeah I certainly have the herd config in the default location, I haven't played around with anything other than to do a little looking around re: this issue.
I opened the file just to confirm that it wasn't empty & it's certainly got values.
I haven't touched the herd.conf or nginx.conf in the nginx directory, heres the home settings.
That was why I assumed it was related to the super globals, because I knew the herd.json was present where it was expected to be & the file contents were as you would expect them to be.
The only server configuration changes on this machine are to the default macos apache install, httpd.conf, where I have set the server root the following settings, for serving sites on my local network.
DocumentRoot "/Users/cam/Sites/"
<Directory "/Users/cam/Sites">
I doubt that would have any effect on config values...
@CamKem this will be fixed in the next release
This is now fixed in Herd 1.11.1
Platform
macOS
Operating system version
macOS Sonoma 14.5 (23F79)
System architecture
ARM64 (M1, M2, etc)
Herd Version
1.11.0
PHP Version
PHP 8.3.11
Bug description
I have noticed several times I am getting an error that
null
is being passed intoarray_key_exists()
in theHerdConfiguration
causing the request to die before hitting the Laravel app. It's happening maybe once a week or something.Looking under the hood it seems like its not parsing the config values.
As its not throwing an exception here:
throw new Exception("Herd configuration file not found at {$path}");
So I assume that it's probably related to here:
I guess its possible that the
'HERD_CONFIG_JSON
key is not being correctly set somewhere else in the application, as you can see in the stack trace it's trying to pass an empty string to fill, which means that the$config = json_decode($json, true);
is parsed as null.Maybe a further conditional
! empty($_SERVER['HERD_CONFIG_JSON'])
Really hard to say without knowing more about the underlying architecture of Herd, so I'll leave it to your team for further debugging.
Steps to reproduce
I haven't been able to find any action that is producing the result consistently.
Relevant log output