Failed Stale Template Cache Delete Error…Analyzed…But No Answer

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












For some of the extremely static content on my site, I use caching to prevent multiple db queries during every single load. I also have multiple locale on my site with custom cache key names. The actual execution of cache is running perfectly at the moment on all the locales.



However, when I make changes to any entry which has cache enabled, I get stale template delete failed error. When I take look at the actual MySQL table, I see that the requisite cache row is deleted from the table upon making changes to an entry. So I don't quite understand why this error shows up.



Here is a typical cache directive I used in my templates



 % cache globally using key "www-features" for 24 hours %


When I look at the runtime logs, I see following error which I am assuming it to be associated with this problem




2018/11/03 19:10:42 [error] [application] Encountered an error running task 17 (DeleteStaleTemplateCaches), step 13 of 29: An exception was thrown:
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'dateCreated' in order clause is ambiguous.
The SQL statement executed was:
SELECT elements.id, entries.sectionId, entries.typeId, entries.authorId, entries.postDate, entries.expiryDate
FROM craft_elements elements
JOIN craft_elements_i18n elements_i18n ON elements_i18n.elementId = elements.id
JOIN craft_content content ON content.elementId = elements.id
JOIN craft_entries entries ON entries.id = elements.id
JOIN craft_sections sections ON sections.id = entries.sectionId
LEFT JOIN craft_structures structures ON structures.id = sections.structureId
LEFT JOIN craft_structureelements structureelements ON (structureelements.structureId = structures.id) AND (structureelements.elementId = entries.id)
WHERE ((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements_i18n.enabled = 1)) AND (sections.handle IN ('policies'))
GROUP BY elements.id
ORDER BY dateCreated. Bound with :locale='en_us'




Looks like you have dateCreated field in multiple tables used in the join and the statement is not explicitly defining the identity of the table ???



Can anyone help me to fix this?










share|improve this question



























    up vote
    1
    down vote

    favorite












    For some of the extremely static content on my site, I use caching to prevent multiple db queries during every single load. I also have multiple locale on my site with custom cache key names. The actual execution of cache is running perfectly at the moment on all the locales.



    However, when I make changes to any entry which has cache enabled, I get stale template delete failed error. When I take look at the actual MySQL table, I see that the requisite cache row is deleted from the table upon making changes to an entry. So I don't quite understand why this error shows up.



    Here is a typical cache directive I used in my templates



     % cache globally using key "www-features" for 24 hours %


    When I look at the runtime logs, I see following error which I am assuming it to be associated with this problem




    2018/11/03 19:10:42 [error] [application] Encountered an error running task 17 (DeleteStaleTemplateCaches), step 13 of 29: An exception was thrown:
    CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'dateCreated' in order clause is ambiguous.
    The SQL statement executed was:
    SELECT elements.id, entries.sectionId, entries.typeId, entries.authorId, entries.postDate, entries.expiryDate
    FROM craft_elements elements
    JOIN craft_elements_i18n elements_i18n ON elements_i18n.elementId = elements.id
    JOIN craft_content content ON content.elementId = elements.id
    JOIN craft_entries entries ON entries.id = elements.id
    JOIN craft_sections sections ON sections.id = entries.sectionId
    LEFT JOIN craft_structures structures ON structures.id = sections.structureId
    LEFT JOIN craft_structureelements structureelements ON (structureelements.structureId = structures.id) AND (structureelements.elementId = entries.id)
    WHERE ((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements_i18n.enabled = 1)) AND (sections.handle IN ('policies'))
    GROUP BY elements.id
    ORDER BY dateCreated. Bound with :locale='en_us'




    Looks like you have dateCreated field in multiple tables used in the join and the statement is not explicitly defining the identity of the table ???



    Can anyone help me to fix this?










    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      For some of the extremely static content on my site, I use caching to prevent multiple db queries during every single load. I also have multiple locale on my site with custom cache key names. The actual execution of cache is running perfectly at the moment on all the locales.



      However, when I make changes to any entry which has cache enabled, I get stale template delete failed error. When I take look at the actual MySQL table, I see that the requisite cache row is deleted from the table upon making changes to an entry. So I don't quite understand why this error shows up.



      Here is a typical cache directive I used in my templates



       % cache globally using key "www-features" for 24 hours %


      When I look at the runtime logs, I see following error which I am assuming it to be associated with this problem




      2018/11/03 19:10:42 [error] [application] Encountered an error running task 17 (DeleteStaleTemplateCaches), step 13 of 29: An exception was thrown:
      CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'dateCreated' in order clause is ambiguous.
      The SQL statement executed was:
      SELECT elements.id, entries.sectionId, entries.typeId, entries.authorId, entries.postDate, entries.expiryDate
      FROM craft_elements elements
      JOIN craft_elements_i18n elements_i18n ON elements_i18n.elementId = elements.id
      JOIN craft_content content ON content.elementId = elements.id
      JOIN craft_entries entries ON entries.id = elements.id
      JOIN craft_sections sections ON sections.id = entries.sectionId
      LEFT JOIN craft_structures structures ON structures.id = sections.structureId
      LEFT JOIN craft_structureelements structureelements ON (structureelements.structureId = structures.id) AND (structureelements.elementId = entries.id)
      WHERE ((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements_i18n.enabled = 1)) AND (sections.handle IN ('policies'))
      GROUP BY elements.id
      ORDER BY dateCreated. Bound with :locale='en_us'




      Looks like you have dateCreated field in multiple tables used in the join and the statement is not explicitly defining the identity of the table ???



      Can anyone help me to fix this?










      share|improve this question















      For some of the extremely static content on my site, I use caching to prevent multiple db queries during every single load. I also have multiple locale on my site with custom cache key names. The actual execution of cache is running perfectly at the moment on all the locales.



      However, when I make changes to any entry which has cache enabled, I get stale template delete failed error. When I take look at the actual MySQL table, I see that the requisite cache row is deleted from the table upon making changes to an entry. So I don't quite understand why this error shows up.



      Here is a typical cache directive I used in my templates



       % cache globally using key "www-features" for 24 hours %


      When I look at the runtime logs, I see following error which I am assuming it to be associated with this problem




      2018/11/03 19:10:42 [error] [application] Encountered an error running task 17 (DeleteStaleTemplateCaches), step 13 of 29: An exception was thrown:
      CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'dateCreated' in order clause is ambiguous.
      The SQL statement executed was:
      SELECT elements.id, entries.sectionId, entries.typeId, entries.authorId, entries.postDate, entries.expiryDate
      FROM craft_elements elements
      JOIN craft_elements_i18n elements_i18n ON elements_i18n.elementId = elements.id
      JOIN craft_content content ON content.elementId = elements.id
      JOIN craft_entries entries ON entries.id = elements.id
      JOIN craft_sections sections ON sections.id = entries.sectionId
      LEFT JOIN craft_structures structures ON structures.id = sections.structureId
      LEFT JOIN craft_structureelements structureelements ON (structureelements.structureId = structures.id) AND (structureelements.elementId = entries.id)
      WHERE ((((elements_i18n.locale = :locale) AND (content.locale = :locale)) AND (elements.archived = 0)) AND (elements_i18n.enabled = 1)) AND (sections.handle IN ('policies'))
      GROUP BY elements.id
      ORDER BY dateCreated. Bound with :locale='en_us'




      Looks like you have dateCreated field in multiple tables used in the join and the statement is not explicitly defining the identity of the table ???



      Can anyone help me to fix this?







      templating cache craft2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 10 mins ago









      Lindsey D♦

      20.3k43688




      20.3k43688










      asked 5 hours ago









      hvs

      956




      956




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          OK, I found the answer to this. Here is the correct answer.



          Basically change dateCreated to elements.dateCreated in my template.






          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "563"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcraftcms.stackexchange.com%2fquestions%2f28307%2ffailed-stale-template-cache-delete-error-analyzed-but-no-answer%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            OK, I found the answer to this. Here is the correct answer.



            Basically change dateCreated to elements.dateCreated in my template.






            share|improve this answer
























              up vote
              2
              down vote













              OK, I found the answer to this. Here is the correct answer.



              Basically change dateCreated to elements.dateCreated in my template.






              share|improve this answer






















                up vote
                2
                down vote










                up vote
                2
                down vote









                OK, I found the answer to this. Here is the correct answer.



                Basically change dateCreated to elements.dateCreated in my template.






                share|improve this answer












                OK, I found the answer to this. Here is the correct answer.



                Basically change dateCreated to elements.dateCreated in my template.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 5 hours ago









                hvs

                956




                956



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcraftcms.stackexchange.com%2fquestions%2f28307%2ffailed-stale-template-cache-delete-error-analyzed-but-no-answer%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery