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

Error: Trying to get property 'id' of non-object #338

Closed
SerafimArts opened this issue Jul 17, 2019 · 4 comments
Closed

Error: Trying to get property 'id' of non-object #338

SerafimArts opened this issue Jul 17, 2019 · 4 comments

Comments

@SerafimArts
Copy link

SerafimArts commented Jul 17, 2019

An error Trying to get property 'id' of non-object occuring while clockwork:clean command launch.

Here:

$path = "{$this->path}/{$request->id}.json";

image

Raw Exception:

ErrorException: Trying to get property 'id' of non-object
#17 /vendor/itsgoingd/clockwork/Clockwork/Storage/FileStorage.php(106): Illuminate\Foundation\Bootstrap\HandleExceptions::handleError
#16 /vendor/sentry/sentry/src/ErrorHandler.php(361): Sentry\ErrorHandler::handleError
#15 /vendor/itsgoingd/clockwork/Clockwork/Storage/FileStorage.php(106): Clockwork\Storage\FileStorage::cleanup
#14 /vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkCleanCommand.php(32): Clockwork\Support\Laravel\ClockworkCleanCommand::handle
#13 [internal](0): call_user_func_array
#12 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
#11 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::callBoundMethod
#10 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::call
#9 /vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\Container\Container::call
#8 /vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Console\Command::execute
#7 /vendor/symfony/console/Command/Command.php(255): Symfony\Component\Console\Command\Command::run
#6 /vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Illuminate\Console\Command::run
#5 /vendor/symfony/console/Application.php(921): Symfony\Component\Console\Application::doRunCommand
#4 /vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application::doRun
#3 /vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application::run
#2 /vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Illuminate\Console\Application::run
#1 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\Foundation\Console\Kernel::handle
#0 /artisan(37): null

P.S.
Laravel: 5.8
Clockwork: 4.0

@SerafimArts
Copy link
Author

P.P.S. There are suspicions that this is due to the cache index file format, which is not compatible with the new one.

@itsgoingd
Copy link
Owner

Hey, the issue is we are currently not removing deleted entries from the index after removing the metadata itself, so on subsequent cleanup commands we find entries for which we no longer have any metadata. Looking into this now.

@SerafimArts
Copy link
Author

Is this index really necessary? In my opinion, deleting directly from the file system with checking by filetmtime was safer and more efficient.

@itsgoingd
Copy link
Owner

The index is mainly used in the requests search, since without an index file we would need to read and parse all the individual json files. It's also used in the web UI to find next/previous requests a little bit faster.

Single requests retrieved by id bypass the index. This is what happens in a typical usage in Chrome/Firefox extensions, so it's not less efficient in the most common case.

Cleanup itself is a little bit slower atm, but it runs only once in ~100 requests, so it shouldn't be too bad. I've got some ideas to improve it in future though.

I've tagged 4.0.5 with a whole bunch of FileStorage cleanup fixes including the crash 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

2 participants