Elasticsearch "Uncaught Error"

I moved my SuiteCRM install to a new server and I believe I have managed to screw something up in the process. I noticed that my Elasticsearch was posting old results in search, so I hit the CLI to test a manual index and got the error below. I can’t figure out what I broke:

[12:35] [server1.xxxx ~] # /var/www/html/suitecrm/vendor/bin/robo elastic:index 0
PHP Notice:  Trying to get property 'app_strings.en_us' of non-object in /var/www/html/suitecrm/include/SugarCache/SugarCache.php on line 176
PHP Fatal error:  Uncaught Error: Call to a member function set() on null in /var/www/html/suitecrm/include/SugarCache/SugarCache.php:187
Stack trace:
#0 /var/www/html/suitecrm/include/utils.php(1237): sugar_cache_put('app_strings.en_...', Array)
#1 /var/www/html/suitecrm/include/MVC/SugarApplication.php(351): return_application_language('en_us')
#2 /var/www/html/suitecrm/include/entryPoint.php(173): SugarApplication::preLoadLanguages()
#3 /var/www/html/suitecrm/lib/Robo/Traits/CliRunnerTrait.php(72): require_once('/var/www/html/s...')
#4 /var/www/html/suitecrm/lib/Robo/Plugin/Commands/ApiCommands.php(82): SuiteCRM\Robo\Plugin\Commands\ApiCommands->bootstrap()
#5 [internal function]: SuiteCRM\Robo\Plugin\Commands\ApiCommands->__construct()
#6 /var/www/html/suitecrm/vendor/league/container/src/Definition/ClassDefinition.php(47): ReflectionClass->newInstanceArgs(Array)
#7 /var/www/html/suitecrm/vendor/league/container/src/Container.php(290): League\Container\Definition\ClassDefinition->build()
#8 /var/www/html/suitecrm/vendor/le in /var/www/html/suitecrm/include/SugarCache/SugarCache.php on line 187

Did you change versions or anything during the move? Have you updated and ensured your elasticsearch service is still reachable from your new server etc?

I dont believe there were any version changes. If there was one by accident, it was minor - 7.11.12 to .13, but I think that occurred after the transition to the new box.

I do get a successful connection test to the elasticsearch docker in the Admin panel. Running 5.6.10…

To be honest, Im haven’t been able to figure out when it stopped working, so Im struggling to figure out how far back I need to roll back.

Further evidence I broke her. Tried to do a command line search - received a more interesting error:

PHP Fatal error:  Uncaught Exception: SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first. in /var/www/html/suitecrm/include/entryPoint.php:59

Do you have a config.php file at your root?

Is your SuiteCRM app working normally, and only the Robo task fails? Or are they both broken?

If it’s only the Robo task, make sure you run it from the root, with

vendor/bin/robo task

instead of going into the Robo directory and calling it from there.

I presume you mean system root, which would be negative. SuiteCRM is operational otherwise.

And yes, I was running the command from the root…

When I said root I meant where SuiteCRM resides, like this for example:

/var/html/www/

This would be the directory where you have index.php, typically suitecrm.log, etc. There should also be a config.php in the directory.

Exactly which robo command are you running?

Sorry for the ghost - the A.D.D. is real over here.

Im running both robo commands from the /var/www/html/suitecrm/ folder.

Thinking I might need to get an “expert” in to help clean up some of this mess…

" both" commands? What is the second one?

If you can please specify exactly what you’re doing so I can try the same here. I am an engineer, so by exactly I mean an unambiguous copy-paste of the directory where you are currently, and the full commands given

The OCD is real over here… :eyes:

:smiley:

Well said.

from /var/www/html/suitecrm/

Tried instructing robo to task as well as index… Best I can tell, errors are the same:

PHP Warning:  include(custom/metadata/sugarchimpactivity_MetaData.php): failed to open stream: No such file or directory in /var/www/html/suitecrm/custom/application/Ext/TableDictionary/tabledictionary.ext.php on line 6
PHP Warning:  include(): Failed opening 'custom/metadata/sugarchimpactivity_MetaData.php' for inclusion (include_path='/var/www/html/suitecrm/include/..:.:/usr/share/pear:/usr/share/php') in /var/www/html/suitecrm/custom/application/Ext/TableDictionary/tabledictionary.ext.php on line 6
PHP Fatal error:  Uncaught Error: Undefined class constant 'Api\Core\Config\ApiConfig::OAUTH2_ENCRYPTION_KEY' in /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php:704
Stack trace:
#0 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(704): ReflectionParameter->getDefaultValue()
#1 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(147): Consolidation\AnnotatedCommand\Parser\CommandInfo->determineOptionsFromParameters()
#2 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(120): Consolidation\AnnotatedCommand\Parser\CommandInfo->constructFromClassAndMethod(Object(SuiteCRM\Robo\Plugin\Commands\ApiCommands), 'apiUpdateEncryp...')
#3 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(126): Consolidation\AnnotatedCommand\Parser\CommandInfo->__construct(Object(SuiteCRM\Robo\Plugin\Commands\ApiCommands), 'apiUpdateEncryp...')
#4 /var/www/html/sui in /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php on line 704
ERROR: Uncaught Error: Undefined class constant 'Api\Core\Config\ApiConfig::OAUTH2_ENCRYPTION_KEY' in /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php:704
Stack trace:
#0 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(704): ReflectionParameter->getDefaultValue()
#1 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(147): Consolidation\AnnotatedCommand\Parser\CommandInfo->determineOptionsFromParameters()
#2 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(120): Consolidation\AnnotatedCommand\Parser\CommandInfo->constructFromClassAndMethod(Object(SuiteCRM\Robo\Plugin\Commands\ApiCommands), 'apiUpdateEncryp...')
#3 /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php(126): Consolidation\AnnotatedCommand\Parser\CommandInfo->__construct(Object(SuiteCRM\Robo\Plugin\Commands\ApiCommands), 'apiUpdateEncryp...')
#4 /var/www/html/sui
in /var/www/html/suitecrm/vendor/consolidation/annotated-command/src/Parser/CommandInfo.php:704

May I suggest…

  1. Install composer if you haven’t already. Search online for instructions specific to your operating system

  2. Rename SuiteCRM’s vendor directory to something else, as a way to remove it (later you can delete that old copy entirely if everything goes well)

  3. From SuiteCRM’s root folder, run command composer install --no-dev

This should create a fully refreshed vendor directory. Your seems faulty.

Went through this and did get the new vendor directory, but robo task still pops off errors.

The problem seems to be coming from this custom module, sugarchimpactivity, is that an add-on, or something you made yourself?

I’ve suspected there’s “gunk” in there… If I didn’t know any better, that’s coming off a Mailchimp addon that has been uninstalled and (should have been) removed.

I guess the really good question is how do I go about finding and cleaning the gunk out?

Start with removing the reference to it in

custom/application/Ext/TableDictionary/tabledictionary.ext.php

that might be enough. If not, go into your SuiteCRM root directory and run

grep -irn sugarchimp custom

This will show you all instances of that string inside any text file in custom dir.

That did clear up the reference error to sugarchimp, but the Parser errors after still exist.

I don’t know, then…

Which version are you running?

I see this recent commit:

it might fix your problem. Or it might be causing your problem. It’s very likely that the Robo task is used so rarely that it isn’t really tested properly…

7.11.13 at the moment. I love solving problems, but this one might be a little over my head.

That fix is in 7.11.15, maybe you can simply try the upgrade, it might work…