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

The script tried to call a method on an incomplete object... #101

Closed
SarunasVenvow opened this issue Mar 16, 2022 · 3 comments
Closed

The script tried to call a method on an incomplete object... #101

SarunasVenvow opened this issue Mar 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@SarunasVenvow
Copy link

SarunasVenvow commented Mar 16, 2022

Hello,
thank you for amazing package.
I have started getting lots of sentry errors with internal exceptions. Here is the trace:

Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "App\Notifications\ReminderOnboard" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
#19 /vendor/thomasjohnkane/snooze/src/Models/ScheduledNotification.php(103): method_exists
#18 /vendor/thomasjohnkane/snooze/src/Models/ScheduledNotification.php(103): Thomasjohnkane\Snooze\Models\ScheduledNotification::shouldInterrupt
#17 /vendor/thomasjohnkane/snooze/src/Models/ScheduledNotification.php(73): Thomasjohnkane\Snooze\Models\ScheduledNotification::send
#16 /vendor/thomasjohnkane/snooze/src/Console/Commands/SendScheduledNotifications.php(58): Thomasjohnkane\Snooze\Console\Commands\SendScheduledNotifications::Thomasjohnkane\Snooze\Console\Commands\{closure}
#15 /vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(244): Illuminate\Support\Collection::each
#14 /vendor/thomasjohnkane/snooze/src/Console/Commands/SendScheduledNotifications.php(63): Thomasjohnkane\Snooze\Console\Commands\SendScheduledNotifications::handle
#13 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
#12 /vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\Util::unwrapIfClosure
#11 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\BoundMethod::callBoundMethod
#10 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::call
#9 /vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\Container::call
#8 /vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Console\Command::execute
#7 /vendor/symfony/console/Command/Command.php(298): Symfony\Component\Console\Command\Command::run
#6 /vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Illuminate\Console\Command::run
#5 /vendor/symfony/console/Application.php(1015): Symfony\Component\Console\Application::doRunCommand
#4 /vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application::doRun
#3 /vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application::run
#2 /vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Illuminate\Console\Application::run
#1 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Foundation\Console\Kernel::handle
#0 /artisan(37): null

UPDATE:
Found the problem. The notification file was moved to another folder, but the records in scheduled_notifications database table had old file path.
How this case could be solved?

@thong89x
Copy link

i have the same issue

@atymic
Copy link
Collaborator

atymic commented Mar 20, 2024

Hey @SarunasVenvow

In the case where you rename/move a notification to a different namespace, you'll have to update the database. We should handle that error though, PR welcome.

@atymic atymic added the bug Something isn't working label Mar 20, 2024
@atymic
Copy link
Collaborator

atymic commented Mar 20, 2024

Ok, looking at the code that exception is handled. Maybe we should add a note to the docs tho?

@atymic atymic closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants