-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
ProviderRepository::loadManifest assumes services.json is not empty #13590
Comments
Thanks for the report. I'll fix this shortly. ;) |
Please confirm #14030 works for you. ;) |
I don't think that fix will work because I tried something similar previously. The problem with that fix is that if I think the proper fix is to make sure |
Ah, ok. Thanks. I'll modify my PR. ;) |
Looks good now. Thank you! |
Thanks for reporting. :) |
I'm getting a similar error, which seems to happen randomly, when using
The issue is that, for some unclear reason, $manifest might not be an array, so it fails to merge.
Var values during an error:
I'm not sure if anyone else could be facing the same issue, but independently of my scenario, this might be a better check:
instead of
|
When server disk space fills up it is possible for an empty
services.json
to be written to disk. Subsequent requests will fail becauseProviderRepository::loadManifest
assumes thatservices.json
is never empty. The error in the log file will vary, but it usually looks something like this:That is not the real error though, because that error is caused by some application-level error handling code that expects
Auth::user()
to be defined. It is not defined because laravel's bootstrap process fails before services can be registered. The services aren't registered because of the actual error, which is contained in the inner exception:This is the
loadManifest()
method around line 174 ofProviderRepository.php
:$manifest
, which is passed as argument 2 toarray_merge
, is not an array becauseProviderRepository::loadManifest()
doesn't check the return value ofjson_decode()
, which isnull
whenservices.json
is empty.To fix this, I changed this code in
Illuminate/Foundation/ProviderRepository::loadManifest()
to:
The text was updated successfully, but these errors were encountered: