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

Control Panel stalls and eventually returns 500 error when trying to access tracking scripts settings #1132

Closed
ck060811 opened this issue May 5, 2022 · 9 comments
Labels

Comments

@ck060811
Copy link

ck060811 commented May 5, 2022

Describe the bug

I am experiencing a strange issue with the plugin that is causing the control panel to stall and eventually crash. I also notice a spike in our server resources, CPU Usage and physical memory usage. This occurs when I try to navigate through the tracking scripts options.

To reproduce

Steps to reproduce the behaviour:

  1. Go to SEOmatic in control panel
  2. Click on "tracking scripts"
  3. Select any of the available options

Expected behaviour

I expect to be able to change the settings of tracking scripts when clicking any option in the tracking scripts menu.

Stack trace from phperrors.log

[04-May-2022 17:53:29 America/Chicago] PHP Warning: include(/home/ungerb10/craftcms_prod/vendor/composer/../craftcms/cms/src/web/twig/CpExtension.php): failed to open stream: No such file or directory in /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php on line 444
[04-May-2022 17:53:29 America/Chicago] PHP Warning: include(): Failed opening '/home/ungerb10/craftcms_prod/vendor/composer/../craftcms/cms/src/web/twig/CpExtension.php' for inclusion (include_path='.:/opt/alt/php74/usr/share/pear') in /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php on line 444
[04-May-2022 17:53:29 America/Chicago] An Error occurred while handling another error:
Error: Class 'craft\web\twig\CpExtension' not found in /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php:320
Stack trace:
#0 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php(303): craft\web\View->createTwig()
#1 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php(408): craft\web\View->getTwig()
#2 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php(461): craft\web\View->renderTemplate('error', Array)
#3 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/Controller.php(201): craft\web\View->renderPageTemplate('error', Array, 'cp')
#4 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/controllers/TemplatesController.php(233): craft\web\Controller->renderTemplate('error', Array)
#5 [internal function]: craft\controllers\TemplatesController->actionRenderError()
#6 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#8 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('render-error', Array)
#9 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('templates/rende...', Array)
#10 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/web/ErrorHandler.php(109): craft\web\Application->runAction('templates/rende...')
#11 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/ErrorHandler.php(192): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException))
#12 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\base\ErrorException))
#13 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/ErrorHandler.php(71): yii\base\ErrorHandler->handleException(Object(yii\base\ErrorException))
#14 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\base\ErrorException))
#15 {main}
Previous exception:
yii\base\ErrorException: include(/home/ungerb10/craftcms_prod/vendor/composer/../craftcms/cms/lib/ar-softdelete/src/SoftDeleteBehavior.php): failed to open stream: No such file or directory in /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/ErrorHandler.php(84): yii\base\ErrorHandler->handleError(2, 'include(/home/u...', '/home/ungerb10/...', 444)
#1 /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php(444): craft\web\ErrorHandler->handleError(2, 'include(/home/u...', '/home/ungerb10/...', 444, Array)
#2 /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php(444): include()
#3 /home/ungerb10/craftcms_prod/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/ungerb10/...')
#4 [internal function]: Composer\Autoload\ClassLoader->loadClass('yii2tech\ar\sof...')
#5 [internal function]: spl_autoload_call('yii2tech\ar\sof...')
#6 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/di/Container.php(507): ReflectionClass->__construct('yii2tech\ar\sof...')
#7 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/di/Container.php(385): yii\di\Container->getDependencies('yii2tech\ar\sof...')
#8 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('yii2tech\ar\sof...', Array, Array)
#9 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('yii2tech\ar\sof...', Array, Array)
#10 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Component.php(756): yii\BaseYii::createObject(Array)
#11 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Component.php(740): yii\base\Component->attachBehaviorInternal('softDelete', Array)
#12 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Component.php(609): yii\base\Component->ensureBehaviors()
#13 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/BaseActiveRecord.php(931): yii\base\Component->trigger('init')
#14 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/BaseObject.php(109): yii\db\BaseActiveRecord->init()
#15 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/BaseActiveRecord.php(1213): yii\base\BaseObject->__construct()
#16 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/ActiveQueryTrait.php(121): yii\db\BaseActiveRecord::instantiate(Array)
#17 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/ActiveQuery.php(219): yii\db\ActiveQuery->createModels(Array)
#18 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/Query.php(251): yii\db\ActiveQuery->populate(Array)
#19 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/db/ActiveQuery.php(133): yii\db\Query->all(NULL)
#20 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/services/Categories.php(126): yii\db\ActiveQuery->all()
#21 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/services/Categories.php(145): craft\services\Categories->_groups()
#22 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/elements/Category.php(171): craft\services\Categories->getAllGroups()
#23 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/base/Element.php(653): craft\elements\Category::defineSources(NULL)
#24 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/helpers/ElementHelper.php(573): craft\base\Element::sources(NULL)
#25 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/fields/BaseRelationField.php(426): craft\helpers\ElementHelper::findSource('craft\elements\...', 'group:6845c36e-...')
#26 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/fields/Categories.php(127): craft\fields\BaseRelationField->normalizeValue(NULL, Object(craft\elements\Entry))
#27 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/base/Element.php(4291): craft\fields\Categories->normalizeValue(NULL, Object(craft\elements\Entry))
#28 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/base/Element.php(3350): craft\base\Element->normalizeFieldValue('resourceType')
#29 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/base/Element.php(1759): craft\base\Element->getFieldValue('resourceType')
#30 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/helpers/Template.php(90): craft\base\Element->__get('resourceType')
#31 /home/ungerb10/craftcms_prod/storage/runtime/compiled_templates/2c/2cf64b09138acc6b000d56d8cc06fcdf72f9fa78536f4b63a61ac905d459ec0d.php(47): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\elements\Entry), 'resourceType', Array, 'any', false, true)
#32 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Template.php(405): __TwigTemplate_be318e905f79f3a4bd9a2444afd2d37bb5150bdeb9f46f77c5072044883fe3f7->doDisplay(Array, Array)
#33 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#34 /home/ungerb10/craftcms_prod/storage/runtime/compiled_templates/f1/f100d823f55467456cbf970cb5a45ba5a0707ee425ecfe138a8e482214bc9f34.php(61): Twig\Template->display(Array)
#35 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Template.php(405): __TwigTemplate_0dee254fd4fc5d95b998d2e3c30126118ce53c05f903d917e6eeffb0910be81e->doDisplay(Array, Array)
#36 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#37 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#38 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/TemplateWrapper.php(45): Twig\Template->render(Array, Array)
#39 /home/ungerb10/craftcms_prod/vendor/twig/twig/src/Environment.php(318): Twig\TemplateWrapper->render(Array)
#40 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render('_partials/pages...', Array)
#41 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/View.php(461): craft\web\View->renderTemplate('_partials/pages...', Array)
#42 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/Controller.php(201): craft\web\View->renderPageTemplate('_partials/pages...', Array, 'site')
#43 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/controllers/TemplatesController.php(102): craft\web\Controller->renderTemplate('_partials/pages...', Array)
#44 [internal function]: craft\controllers\TemplatesController->actionRender('_partials/pages...', Array)
#45 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#46 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#47 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('render', Array)
#48 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('templates/rende...', Array)
#49 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('templates/rende...', Array)
#50 /home/ungerb10/craftcms_prod/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest(Object(craft\web\Request))
#51 /home/ungerb10/craftcms_prod/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#52 /home/ungerb10/public_html/index.php(21): yii\base\Application->run()
#53 {main}

NOTES

  • ../craftcms/cms/src/web/twig/CpExtension.php does exist
  • I've tried nuking the vendor folder and composer.lock then running composer install
  • Tried composer dump-autoload

Versions

  • Plugin version: 3.4.30
  • Craft version: Craft Pro 3.7.40.1

List of installed plugins

installed-plugins

@ck060811 ck060811 added the bug label May 5, 2022
@khalwat
Copy link
Collaborator

khalwat commented May 9, 2022

Are you saying that the site otherwise works? Because from that log, it appears to me that not much of anything should actually be working.

You've done what I would do, which is to nuke the vendor/ directory and the composer.lock and install from scratch.

I'm extremely confused how this has anything to do SEOmatic, though? SEOmatic or any nystudio107 plugins don't appear in any of the error logs you've provided...?

@khalwat
Copy link
Collaborator

khalwat commented May 10, 2022

Yeah after looking into this more, I can't see how this could be an issue with SEOmatic or Craft itself. It's more likely something to do with the install/setup. I'd suggest contacting support@CraftCMS.com if needed

@khalwat khalwat closed this as completed May 10, 2022
@ck060811
Copy link
Author

Thanks for taking a look. I'll keep digging through the logs and will reach out to support if I find anything.

@khalwat
Copy link
Collaborator

khalwat commented May 10, 2022

Can you clarify for me, though? You only ever see this when navigating to the Tracking Scripts page in SEOmatic? Nowhere else?

@ck060811
Copy link
Author

That is correct. I can navigate through our control panel with no issues. Even to SEOmatic Dashboard, Global SEO, Content SEO, and Site Settings. The problem occurs when hitting the Tracking Scripts in SEOmatic.

@khalwat
Copy link
Collaborator

khalwat commented May 10, 2022

That is just so strange... because the errors presented here have nothing to do with it.

Can you perhaps delete ALL of your logs in storage/logs/ and then navigate to SEOmatic -> Tracking Scripts and then don't do anything else, and look at the logs for anything pertinent?

@ck060811
Copy link
Author

ck060811 commented May 10, 2022

Deleted everything in storage/logs and went to SEOmatic -> Tracking Scripts. Only files generated are web.log and web-404s.log, neither show anything related to SEOmatic.

This screen grab is the only thing I can find related to the error. Not sure if it helps.
craft-debugger-capture

@khalwat
Copy link
Collaborator

khalwat commented May 10, 2022

Okay this is good however, we're seeing a 500 error from an SEOmatic page. Can you send me those logs to andrew@nystudio107.com ?

Specifically the web.log you just made

khalwat pushed a commit that referenced this issue May 20, 2022
khalwat pushed a commit that referenced this issue May 20, 2022
@khalwat
Copy link
Collaborator

khalwat commented May 20, 2022

Addressed in: 6d86b3c & 672fc02

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.31”,

Then do a composer clear-cache && composer update

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

No branches or pull requests

2 participants