Giter Site home page Giter Site logo

Internal Server Error about seo HOT 17 CLOSED

darylknight avatar darylknight commented on July 1, 2024
Internal Server Error

from seo.

Comments (17)

Tam avatar Tam commented on July 1, 2024

Could you let me know what version of Craft you're running and whether this is a fresh install or an update?

Also, and extra details you can get from your logs / devMode would be great!

from seo.

darylknight avatar darylknight commented on July 1, 2024

Thanks for getting back to me so quickly Tam! It's a site I've recently taken over, not a fresh install. Craft version 2.6.2991. PHP 7.1.12 on DigitalOcean.

Stack trace:

Next Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Craft\Seo_SitemapRecord and its behaviors do not have a method or closure named "enabled".") in "seo/sitemap" at line 86. in /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php:230
Stack trace:
#0 /srv/users/serverpilot/apps/appname/craft/storage/runtime/compiled_templates/40/4067161133a49915097fb83244090b551f25c3ce0b9aa4cbec73d14f58d98c6f.php(740): Twig_Template->displayBlock('content', Array, Array)
#1 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(215): __TwigTemplate_d42e4b425195cdcabf22f971b584ede74542d0a0cf6df392820180189839d64f->block_body(Array, Array)
#2 /srv/users/serverpilot/apps/appname/craft/storage/runtime/compiled_templates/53/531e484b9108f0c902222391cdedafa979899e24f996783437b82b5f1d06501c.php(45): Twig_Template->displayBlock('body', Array, Array)
#3 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_be966d9ddf0c3323fb35201abadc46b781d2145b65316e4dfc96aa08dd39c177->doDisplay(Array, Array)
#4 /srv/users/serverpilot/apps/appname/craft/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(Array, Array)
#5 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(Array, Array)
#6 /srv/users/serverpilot/apps/appname/craft/storage/runtime/compiled_templates/87/872ac43537ea01039c11db94577ee8cbe0f14eeff35f3fba4cb70d8b0629ed1a.php(131): Twig_Template->display(Array, Array)
#7 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_c22b4e9af641498b0c4d890d09f61c371745e5007d0af8cf5ec7f5c22f0b8bd7->doDisplay(Array, Array)
#8 /srv/users/serverpilot/apps/appname/craft/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(Array, Array)
#9 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(Array, Array)
#10 /srv/users/serverpilot/apps/appname/craft/storage/runtime/compiled_templates/40/4067161133a49915097fb83244090b551f25c3ce0b9aa4cbec73d14f58d98c6f.php(169): Twig_Template->display(Array, Array)
#11 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_d42e4b425195cdcabf22f971b584ede74542d0a0cf6df392820180189839d64f->doDisplay(Array, Array)
#12 /srv/users/serverpilot/apps/appname/craft/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(Array, Array)
#13 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(Array, Array)
#14 /srv/users/serverpilot/apps/appname/craft/storage/runtime/compiled_templates/f9/f92921d206b2db16ecd9448ed7bab6c71620cc7fbbe3b6551088e288b27dbfbe.php(36): Twig_Template->display(Array, Array)
#15 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_06c12da64c481cf48895f25d62d4c9b7399ae911a891ab96e1012aacb562fb25->doDisplay(Array, Array)
#16 /srv/users/serverpilot/apps/appname/craft/app/etc/templating/BaseTemplate.php(26): Twig_Template->displayWithErrorHandling(Array, Array)
#17 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(403): Craft\BaseTemplate->displayWithErrorHandling(Array, Array)
#18 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#19 /srv/users/serverpilot/apps/appname/craft/app/vendor/twig/twig/lib/Twig/Environment.php(362): Twig_Template->render(Array)
#20 /srv/users/serverpilot/apps/appname/craft/app/services/TemplatesService.php(256): Twig_Environment->render('seo/sitemap', Array)
#21 /srv/users/serverpilot/apps/appname/craft/app/controllers/BaseController.php(74): Craft\TemplatesService->render('seo/sitemap', Array)
#22 /srv/users/serverpilot/apps/appname/craft/plugins/seo/controllers/SeoController.php(82): Craft\BaseController->renderTemplate('seo/sitemap', Array)
#23 /srv/users/serverpilot/apps/appname/craft/app/framework/web/actions/CInlineAction.php(49): Craft\SeoController->actionSitemapPage()
#24 /srv/users/serverpilot/apps/appname/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#25 /srv/users/serverpilot/apps/appname/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#26 /srv/users/serverpilot/apps/appname/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#27 /srv/users/serverpilot/apps/appname/craft/app/framework/web/CWebApplication.php(282): CController->run('sitemapPage')
#28 /srv/users/serverpilot/apps/appname/craft/app/framework/web/CWebApplication.php(141): CWebApplication->runController('seo/sitemapPage')
#29 /srv/users/serverpilot/apps/appname/craft/app/etc/web/WebApp.php(290): CWebApplication->processRequest()
#30 /srv/users/serverpilot/apps/appname/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#31 /srv/users/serverpilot/apps/appname/craft/app/index.php(62): CApplication->run()
#32 /srv/users/serverpilot/apps/appname/public/index.php(19): require_once('/srv/users/serv...')
#33 {main}
REQUEST_URI=/admin/seo/sitemap
HTTP_REFERER=https://www.[website].com/admin/seo/redirects

from seo.

Tam avatar Tam commented on July 1, 2024

Can you replace the all the files for the plugin with a fresh download (you shouldn't need to reinstall the plugin)? You might also need to delete the craft/storage/runtime/compiled_templates directory.

from seo.

darylknight avatar darylknight commented on July 1, 2024

Yep - I've uploaded the files manually. Additionally, git didn't recognise any files as changed or added.

from seo.

Tam avatar Tam commented on July 1, 2024

Is it still erroring even with after the compiled_templates directory has been deleted?

Could you also confirm that this line exists in craft/plugins/seo/records/Seo_SitemapRecord.php on your server?

'enabled' => array(AttributeType::Bool, 'default' => true),

from seo.

darylknight avatar darylknight commented on July 1, 2024

Yes - still happens after clearing that folder. Line 29 is in there same as the source.

from seo.

Tam avatar Tam commented on July 1, 2024

Weird. Are you able to replicate the issue in a local environment?

from seo.

darylknight avatar darylknight commented on July 1, 2024

Yep - happens on my local machine too!

image

from seo.

Tam avatar Tam commented on July 1, 2024

Are you able to send me (tam at ethercreative.co.uk) your site files and a database dump?

from seo.

darylknight avatar darylknight commented on July 1, 2024

Unfortunately not, sorry! Aside from the fact that the database is 300mb, it contains a lot of customer data.

from seo.

Tam avatar Tam commented on July 1, 2024

No worries! Hearing about your 300mb database is making me feel a LOT better about some of my sites 🤣

Could you check that the structure of the craft_seo_sitemaps has the enabled column? It might also be worth backing up that table and emptying it to see if it's an issue with the data.

from seo.

darylknight avatar darylknight commented on July 1, 2024

Thanks for prompting me to look at the database - it did have the enabled column, but three of the sections were set to NULL. Here's the situation.

Originally the table in the db looked like this:

image

Then I changed the NULL values to 0, and the plugin started working again, but it didn't bear any resemblance to the values in the table (19 rows in the db, 13 sections):

image

Then I clicked Save from within the plugin in Craft, and the database table updated to this:

image

Which DOES seem to relate to the correct sections etc. So I couldn't tell you how, but it looks like that table got corrupted at some point?

from seo.

darylknight avatar darylknight commented on July 1, 2024

Having said that, it looks like the actual sitemap still isn't working: https://www.sitename.com/sitemap.xml

from seo.

Tam avatar Tam commented on July 1, 2024

The only section which doesn't seem to be appearing in the sitemap is, I believe, the Programs section. The URL 404s so which leads me to believe there aren't any enabled entries? The latest v2 release fixed #52 where the sitemap was including entries that were disabled, so this seems like the reason why that section isn't showing up.

from seo.

darylknight avatar darylknight commented on July 1, 2024

Thanks Tam - sorry, I've inherited this project and this plugin so I may not be expecting the right thing... but shouldn't the sitemap be listing pages inside those sections? I shouldn't be seeing this in the sitemap.xml:

<sitemap>
    <loc>
        https://www.sitename.com/sitemap_sections_12_0.xml
    </loc>
    <lastmod>2017-10-17</lastmod>
</sitemap>

I'm expecting to see a list of pages inside whatever that section is?

from seo.

Tam avatar Tam commented on July 1, 2024

To help reduce server load the sitemap is split into separate files, each file containing the entries for that files section (try going to https://www.guidedogs.com/sitemap_sections_12_0.xml). These files can be separated into even more files, depending on the total number of entries and the page limit specified in the plugin settings (defaults to 1000, but can be lowered for servers with fewer resources).

from seo.

darylknight avatar darylknight commented on July 1, 2024

Ah! Ok, that makes sense - thank you for all the investigating.

from seo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.