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

Call to a member function bindTo() on null #51768

Closed
abhiburk opened this issue Jun 11, 2024 · 3 comments
Closed

Call to a member function bindTo() on null #51768

abhiburk opened this issue Jun 11, 2024 · 3 comments

Comments

@abhiburk
Copy link

abhiburk commented Jun 11, 2024

Laravel Version

10.0

PHP Version

8.1.2

Database Driver & Version

No response

Description

When dispatching a job I got the below error

Bus::batch((new ImportVirtualMachineJob()))->dispatch();

10 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Modules\\VirtualMachine\\Http\\Controllers\\ImportVMController->import()
#11 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#12 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#13 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#14 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#15 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#16 /home/stackconsole/cmp-app/app/Http/Middleware/AccessControlMiddleware.php(35): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\AccessControlMiddleware->handle()
#18 /home/stackconsole/cmp-app/app/Http/Middleware/EnsureTwoFactorAuthentication.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\EnsureTwoFactorAuthentication->handle()
#20 /home/stackconsole/cmp-app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
[2:53](https://stackconsole.slack.com/archives/D04D732AHS5/p1718097781087759)
[2024-06-11 11:20:18] production.ERROR: Call to a member function bindTo() on null {“userId”:“9b1d3aab-5367-46e5-811e-0e0b3e67c9d6",“exception”:“[object] (Error(code: 0): Call to a member function bindTo() on null at /home/stackconsole/cmp-app/vendor/laravel/serializable-closure/src/Serializers/Native.php:195)
[stacktrace]

Steps To Reproduce

This is when dispatching a job

@crynobone
Copy link
Member

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

@abhiburk
Copy link
Author

Well, to commit the code changes is a big task and comes with a lot of dependencies. If I could get the possible reasons for the errors I would be happy enough to debug the error from my end. The error usually occurs for this particular job and not else where. Also FYI the same code base works on the other environment. if this information can help to understand you please suggest what can be the possible reason for such errors.

@crynobone
Copy link
Member

Again as I said earlier, we unable to proceed without new information. Feel free to open new issue when you can create the requested repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants