Could you post the contents of app/storage/meta/services.json?
Getting weird error in Laravel
Getting this annoying error below in Laravel 4
{"error":{"type":"ErrorException","message":"array_merge(): Argument #2 is not an array","file":"\/vagrant\/crowdlinker.com\/shortener\/shortenerapp\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":188}}
anyone know how to fix this issue?
You have to give us more information than that.
Following is my service.json @hromby
{
"providers": [
"Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"Illuminate\\Auth\\AuthServiceProvider",
"Illuminate\\Cache\\CacheServiceProvider",
"Illuminate\\Session\\CommandsServiceProvider",
"Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"Illuminate\\Routing\\ControllerServiceProvider",
"Illuminate\\Cookie\\CookieServiceProvider",
"Illuminate\\Database\\DatabaseServiceProvider",
"Illuminate\\Encryption\\EncryptionServiceProvider",
"Illuminate\\Filesystem\\FilesystemServiceProvider",
"Illuminate\\Hashing\\HashServiceProvider",
"Illuminate\\Html\\HtmlServiceProvider",
"Illuminate\\Log\\LogServiceProvider",
"Illuminate\\Mail\\MailServiceProvider",
"Illuminate\\Database\\MigrationServiceProvider",
"Illuminate\\Pagination\\PaginationServiceProvider",
"Illuminate\\Queue\\QueueServiceProvider",
"Illuminate\\Redis\\RedisServiceProvider",
"Illuminate\\Remote\\RemoteServiceProvider",
"Illuminate\\Auth\\Reminders\\ReminderServiceProvider",
"Illuminate\\Database\\SeedServiceProvider",
"Illuminate\\Session\\SessionServiceProvider",
"Illuminate\\Translation\\TranslationServiceProvider",
"Illuminate\\Validation\\ValidationServiceProvider",
"Illuminate\\View\\ViewServiceProvider",
"Illuminate\\Workbench\\WorkbenchServiceProvider",
"Way\\Generators\\GeneratorsServiceProvider",
"Laracasts\\Utilities\\UtilitiesServiceProvider",
"Laracasts\\Validation\\ValidationServiceProvider",
"Laracasts\\Commander\\CommanderServiceProvider",
"Artdarek\\OAuth\\OAuthServiceProvider",
"Crowdlinker\\Repositories\\BackendServiceProvider",
"Crowdlinker\\Twitter\\AuthenticatorsServiceProvider",
"Crowdlinker\\Shortener\\Repositories\\BackendServiceProvider",
"Crowdlinker\\Shortener\\ShortenerServiceProvider",
"Crowdlinker\\Shortener\\Utilities\\UtilitiesServiceProvider",
"Crowdlinker\\Events\\EventServiceProvider"
],
"eager": [
"Illuminate\\Cookie\\CookieServiceProvider",
"Illuminate\\Database\\DatabaseServiceProvider",
"Illuminate\\Encryption\\EncryptionServiceProvider",
"Illuminate\\Filesystem\\FilesystemServiceProvider",
"Illuminate\\Session\\SessionServiceProvider",
"Illuminate\\View\\ViewServiceProvider",
"Illuminate\\Workbench\\WorkbenchServiceProvider",
"Way\\Generators\\GeneratorsServiceProvider",
"Laracasts\\Utilities\\UtilitiesServiceProvider",
"Laracasts\\Validation\\ValidationServiceProvider",
"Laracasts\\Commander\\CommanderServiceProvider",
"Artdarek\\OAuth\\OAuthServiceProvider",
"Crowdlinker\\Repositories\\BackendServiceProvider",
"Crowdlinker\\Twitter\\AuthenticatorsServiceProvider",
"Crowdlinker\\Shortener\\Repositories\\BackendServiceProvider",
"Crowdlinker\\Shortener\\ShortenerServiceProvider",
"Crowdlinker\\Shortener\\Utilities\\UtilitiesServiceProvider",
"Crowdlinker\\Events\\EventServiceProvider"
],
"deferred": {
"artisan": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"command.changes": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"command.environment": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"auth": "Illuminate\\Auth\\AuthServiceProvider",
"cache": "Illuminate\\Cache\\CacheServiceProvider",
"cache.store": "Illuminate\\Cache\\CacheServiceProvider",
"memcached.connector": "Illuminate\\Cache\\CacheServiceProvider",
"command.cache.clear": "Illuminate\\Cache\\CacheServiceProvider",
"command.session.database": "Illuminate\\Session\\CommandsServiceProvider",
"command.command.make": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"composer": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.dump-autoload": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.key.generate": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.up": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.down": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.optimize": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.clear-compiled": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"asset.publisher": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.asset.publish": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"config.publisher": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.config.publish": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"view.publisher": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.view.publish": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"migration.publisher": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.migrate.publish": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.routes": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.serve": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.tinker": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.queue.failed": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.queue.retry": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.queue.forget": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.queue.flush": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.queue.failed-table": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"command.controller.make": "Illuminate\\Routing\\ControllerServiceProvider",
"hash": "Illuminate\\Hashing\\HashServiceProvider",
"html": "Illuminate\\Html\\HtmlServiceProvider",
"form": "Illuminate\\Html\\HtmlServiceProvider",
"log": "Illuminate\\Log\\LogServiceProvider",
"mailer": "Illuminate\\Mail\\MailServiceProvider",
"swift.mailer": "Illuminate\\Mail\\MailServiceProvider",
"swift.transport": "Illuminate\\Mail\\MailServiceProvider",
"migrator": "Illuminate\\Database\\MigrationServiceProvider",
"migration.repository": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate.rollback": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate.reset": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate.refresh": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate.install": "Illuminate\\Database\\MigrationServiceProvider",
"migration.creator": "Illuminate\\Database\\MigrationServiceProvider",
"command.migrate.make": "Illuminate\\Database\\MigrationServiceProvider",
"paginator": "Illuminate\\Pagination\\PaginationServiceProvider",
"queue": "Illuminate\\Queue\\QueueServiceProvider",
"queue.worker": "Illuminate\\Queue\\QueueServiceProvider",
"queue.listener": "Illuminate\\Queue\\QueueServiceProvider",
"queue.failer": "Illuminate\\Queue\\QueueServiceProvider",
"command.queue.work": "Illuminate\\Queue\\QueueServiceProvider",
"command.queue.listen": "Illuminate\\Queue\\QueueServiceProvider",
"command.queue.restart": "Illuminate\\Queue\\QueueServiceProvider",
"command.queue.subscribe": "Illuminate\\Queue\\QueueServiceProvider",
"redis": "Illuminate\\Redis\\RedisServiceProvider",
"remote": "Illuminate\\Remote\\RemoteServiceProvider",
"auth.reminder": "Illuminate\\Auth\\Reminders\\ReminderServiceProvider",
"auth.reminder.repository": "Illuminate\\Auth\\Reminders\\ReminderServiceProvider",
"command.auth.reminders": "Illuminate\\Auth\\Reminders\\ReminderServiceProvider",
"seeder": "Illuminate\\Database\\SeedServiceProvider",
"command.seed": "Illuminate\\Database\\SeedServiceProvider",
"translator": "Illuminate\\Translation\\TranslationServiceProvider",
"translation.loader": "Illuminate\\Translation\\TranslationServiceProvider",
"validator": "Illuminate\\Validation\\ValidationServiceProvider",
"validation.presence": "Illuminate\\Validation\\ValidationServiceProvider"
},
"when": {
"Illuminate\\Foundation\\Providers\\ArtisanServiceProvider": [],
"Illuminate\\Auth\\AuthServiceProvider": [],
"Illuminate\\Cache\\CacheServiceProvider": [],
"Illuminate\\Session\\CommandsServiceProvider": [],
"Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider": [],
"Illuminate\\Routing\\ControllerServiceProvider": [],
"Illuminate\\Hashing\\HashServiceProvider": [],
"Illuminate\\Html\\HtmlServiceProvider": [],
"Illuminate\\Log\\LogServiceProvider": [],
"Illuminate\\Mail\\MailServiceProvider": [],
"Illuminate\\Database\\MigrationServiceProvider": [],
"Illuminate\\Pagination\\PaginationServiceProvider": [],
"Illuminate\\Queue\\QueueServiceProvider": [],
"Illuminate\\Redis\\RedisServiceProvider": [],
"Illuminate\\Remote\\RemoteServiceProvider": [],
"Illuminate\\Auth\\Reminders\\ReminderServiceProvider": [],
"Illuminate\\Database\\SeedServiceProvider": [],
"Illuminate\\Translation\\TranslationServiceProvider": [],
"Illuminate\\Validation\\ValidationServiceProvider": []
}
}ServiceProvider": [
],
"Illuminate\\Translation\\TranslationServiceProvider": [
],
"Illuminate\\Validation\\ValidationServiceProvider": [
]
}
}
@jeffrey Here is the full error stack http://cl.ly/image/3N332s3n3Q0E
Have you been manually editing the services.json file? Because the bit at the end of that file seems wrong:
ServiceProvider": [
],
"Illuminate\\Translation\\TranslationServiceProvider": [
],
"Illuminate\\Validation\\ValidationServiceProvider": [
]
}
}
Try deleting the services.json file and reload your app on the browser to regenerate it.
this happened to me also. I am guessing you are using codeception?
This happens to when whenever I run codeception after a very long time(some 15-30 minutes interval or so..or after my pc wakes up). I am on homestead. Still cant say why exactly this happens.
Running codecept "corrupts" the services,json file. it re-adds last 2 providers you have in the json file again
Solution for me is I just nuke it, and let it rebuild.
I fixed it just by removing services.json and re running composer.
I'm getting this error for maybe like 1 in 20 requests - its not a permanent thing. Any idea what could be causing this?
Oh and once it throws an error, it doesn't throw the same error for every following request.
I've just tried dding the contents of the services.json file on requests that file, and its saying that there isn't anything in there. My theory is that maybe there are requests that are recreating the services.json file, while another request comes in 'asking' for the services.json file but receiving a blank one, because the first request is still writing to it? Because everynow and then I get a completely corrupt services.json file because the file has two json objects split in half and appended to each other (as if file writing was interrupted). Side note: (and please excuse my lack of expertise, but would it be possible to use the Cache system for services.json instead of the filesystem? would that be beneficial/faster?
I'm curious if anyone has solved this? I have the same problem. Here's the invalid section of my services.json file. Sure I can delete it and re-build. But it just happens again randomly later in the day. Any ideas?
"Indatus\\Facades\\ServiceProvider": [],
"Indatus\\Services\\RoleManagement\\RoleManagementServiceProvider": []
}
}er": [
],
"Indatus\\Services\\CallMonitor\\CallMonitorServiceProvider": [
],
"Indatus\\Dispatcher\\ServiceProvider": [
I am having the same trouble. Am looking forward to a fix for this.
I'm in this club too. My app has just started randomly falling over with the issue of a malformed services.json file. When I delete the initial file looks like this:
{
"providers": [
"Illuminate\\Cache\\CacheServiceProvider"
],
"eager": [],
"deferred": {
"cache": "Illuminate\\Cache\\CacheServiceProvider",
"cache.store": "Illuminate\\Cache\\CacheServiceProvider",
"memcached.connector": "Illuminate\\Cache\\CacheServiceProvider",
"command.cache.clear": "Illuminate\\Cache\\CacheServiceProvider",
"command.cache.table": "Illuminate\\Cache\\CacheServiceProvider"
},
"when": {
"Illuminate\\Cache\\CacheServiceProvider": []
}
}
After an indeterminate amount of time it turns into this and falls over:
{
"providers": [
"Illuminate\\Cache\\CacheServiceProvider"
],
"eager": [],
"deferred": {
"cache": "Illuminate\\Cache\\CacheServiceProvider",
"cache.store": "Illuminate\\Cache\\CacheServiceProvider",
"memcached.connector": "Illuminate\\Cache\\CacheServiceProvider",
"command.cache.clear": "Illuminate\\Cache\\CacheServiceProvider",
"command.cache.table": "Illuminate\\Cache\\CacheServiceProvider"
},
"when": {
"Illuminate\\Cache\\CacheServiceProvider": []
}
}ovider",
"Illuminate\\Filesystem\\FilesystemServiceProvider",
"Illuminate\\Hashing\\HashServiceProvider",
"Illuminate\\Html\\HtmlServiceProvider",
"Illuminate\\Log\\LogServiceProvider",
"Illuminate\\Mail\\MailServiceProvider",
//Lots more stuff below
It's a tricky one to debug as I can't find the trigger that makes this happen.
We had the same error because we shared our app/storage folder between our production web and our release candidate web. Now we separated the storage folder and just share app/storage/uploads between those two webs.
It just happened to me, after I added the indatus\dispatcher package to my app and the following line to my crontab (coincidentally or not):
* * * * * php artisan scheduled:run 1>> /dev/null 2>&1
@troyharvey, are you using indatus\dispatcher? I'm afraid it is related to the fact that the scheduler runs every minute.
I was able to reproduce this issue by running phpunit on multiple threads all trying to write to the services.json using:
$this->app->getProviderRepository()->load($this->app, array('Illuminate\Log\LogServiceProvider'));
$this->app->getProviderRepository()->load($this->app, array(
"Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"Illuminate\\Foundation\\Providers\\ArtisanServiceProvider"
));
$this->app->getProviderRepository()->load($this->app, array(
"Illuminate\\Auth\\AuthServiceProvider",
"Illuminate\\Cache\\CacheServiceProvider",
"Illuminate\\Validation\\ValidationServiceProvider",
"Illuminate\\Foundation\\Providers\\ArtisanServiceProvider",
"Illuminate\\Translation\\TranslationServiceProvider",
"Illuminate\\Auth\\AuthServiceProvider",
"Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider",
"Illuminate\\Translation\\TranslationServiceProvider",
));
$this->app->getProviderRepository()->load($this->app, array('Illuminate\Foundation\Providers\ArtisanServiceProvider'));
The block of code responsible for writing to the services.json file does not use a LOCK_EX flag and seems to open it up to corruption if you are writing to it on every request. We had the following line in our code base:
$this->app->getProviderRepository()->load($this->app, array('Illuminate\Log\LogServiceProvider'));
Which was causing the issue for us.
Hello,
We had the same problem, and fix it deleting the corrupted "services.json" file.
Our question is: this is a problem with Laravel 4.2 when 2 requests are received exactly at the same time? why this corruption happens?
Thanks!
Please or to participate in this conversation.