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

array_combine(): Both parameters should have an equal number of elements #356

Closed
nsbucky opened this issue Oct 10, 2019 · 4 comments
Closed

Comments

@nsbucky
Copy link

nsbucky commented Oct 10, 2019

I keep getting this error somewhat randomly. Not sure if it is my config setup - which is default - or its just something with my system. Below is the exception:

`ErrorException thrown with message "array_combine(): Both parameters should have an equal number of elements"

Stacktrace:
#15 ErrorException in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:249
#14 array_combine in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:249
#13 Clockwork\Storage\FileStorage:makeRequestFromIndex in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:210
#12 Clockwork\Storage\FileStorage:readPreviousIndex in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:175
#11 Clockwork\Storage\FileStorage:readIndex in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:151
#10 Clockwork\Storage\FileStorage:searchIndex in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:131
#9 Clockwork\Storage\FileStorage:searchIndexBackward in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:103
#8 Clockwork\Storage\FileStorage:cleanup in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Storage\FileStorage.php:93
#7 Clockwork\Storage\FileStorage:store in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Clockwork.php:140
#6 Clockwork\Clockwork:storeRequest in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Support\Laravel\ClockworkSupport.php:129
#5 Clockwork\Support\Laravel\ClockworkSupport:process in D:\work\pesq-post-inno\vendor\itsgoingd\clockwork\Clockwork\Support\Laravel\ClockworkMiddleware.php:33
#4 Clockwork\Support\Laravel\ClockworkMiddleware:handle in D:\work\pesq-post-inno\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#3 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in D:\work\pesq-post-inno\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:105
#2 Illuminate\Pipeline\Pipeline:then in D:\work\pesq-post-inno\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:151
#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in D:\work\pesq-post-inno\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:116
#0 Illuminate\Foundation\Http\Kernel:handle in D:\work\pesq-post-inno\public\index.php:55
`

@LastDragon-ru
Copy link

I see this error too (php v7.2.15, laravel v5.8.35)

Workaround

	protected function makeRequestFromIndex($record)
	{
		return new Request(array_combine(
			[ 'id', 'time', 'method', 'uri', 'controller', 'responseStatus', 'responseDuration' ], $record + [null, null, null, null, null, null, null]
		)); 
	}

@itsgoingd
Copy link
Owner

Hey, can you please send me your storage/clockwork/index file? info@underground.works

@itsgoingd
Copy link
Owner

Tagged 4.0.12 with a better handling of invalid index data (similar to the workaround above) and possible fix for the invalid data as well.

@nsbucky thanks for helping out with the sample index file!

@nsbucky
Copy link
Author

nsbucky commented Oct 14, 2019

rock solid thx for quick fix!

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

3 participants