Report this

What is the reason for this report?

Search index command in pimcore 10.5.15 production gives error.

Posted on June 3, 2025

While executing search index command in pimcore 10.5 version on production gives below error

method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

Pimcore version: 10.5.15 Php version: 8.1 Mysql version: 8.0 Composer version 2.7.2

Please let me know the how to solve this issue.

Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there!

That error usually means Pimcore is trying to call method_exists() on a null value, it’s likely coming from a class or object that isn’t being set properly.

You should check if any of your custom data objects or classes might be returning null. Add a check like:

if ($obj && method_exists($obj, 'someMethod')) {
    // Safe to call the method
}

Also run this to rebuild your class definitions just in case something’s out of sync:

bin/console pimcore:deployment:classes-rebuild

And clear your cache too:

bin/console cache:clear

If you’re getting a stack trace or line number, that can help narrow it down; feel free to share it.

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.