Responsive Banner Slider PHP exceptions.

Our logs are getting hammered with the following PHP exceptions, which appear to involve the responsive banner slider:

A PHP Exception occurred on your site. Here you can find the stack trace:

Exception Type: JException
File: /home/mydomain/public_html/libraries/legacy/error/error.php
Line: 200
Message: Duplicate entry '2021-02-17 22:58:20-1-44' for key 'PRIMARY'

#0 /home/mydomain/public_html/libraries/legacy/error/error.php(277): JError::raise(1, 500, 'Duplicate entry...', NULL, true)
#1 /home/mydomain/public_html/components/com_banners/models/banners.php(333): JError::raiseError(500, 'Duplicate entry...')
#2 /home/mydomain/public_html/modules/mod_responsivebannerslider/helper.php(70): BannersModelBanners->impress()
#3 /home/mydomain/public_html/modules/mod_responsivebannerslider/mod_responsivebannerslider.php(389): modResponsiveBannerSliderHelper::getList(Object(Joomla\Registry\Registry))
#4 /home/mydomain/public_html/libraries/src/Helper/ModuleHelper.php(200): include('/home/mydomain/...')
#5 /home/mydomain/public_html/libraries/src/Document/Renderer/Html/ModuleRenderer.php(98): Joomla\CMS\Helper\ModuleHelper::renderModule(Object(stdClass), Array)
#6 /home/mydomain/public_html/libraries/src/Document/Renderer/Html/ModulesRenderer.php(47): Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render(Object(stdClass), Array, NULL)
#7 /home/mydomain/public_html/libraries/src/Document/HtmlDocument.php(501): Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render('mod_sponsors01', Array, NULL)
#8 /home/mydomain/public_html/libraries/src/Document/HtmlDocument.php(793): Joomla\CMS\Document\HtmlDocument->getBuffer('modules', 'mod_sponsors01', Array)
#9 /home/mydomain/public_html/libraries/src/Document/HtmlDocument.php(567): Joomla\CMS\Document\HtmlDocument->_renderTemplate()
#10 /home/mydomain/public_html/libraries/src/Application/CMSApplication.php(1044): Joomla\CMS\Document\HtmlDocument->render(false, Array)
#11 /home/mydomain/public_html/libraries/src/Application/SiteApplication.php(778): Joomla\CMS\Application\CMSApplication->render()
#12 /home/mydomain/public_html/libraries/src/Application/CMSApplication.php(202): Joomla\CMS\Application\SiteApplication->render()
#13 /home/mydomain/public_html/index.php(49): Joomla\CMS\Application\CMSApplication->execute()
#14 {main}[/code]


Any advice to solve this?
21 responses Add Yours
       
  • Replied by admin on Thursday, February 18 2021, 01:25 AM · Hide· #1
    Hi,
    - Can you tell me what joomla version do you use?
    - Can try to publish only one banner and see whether the same issue happened?
    - Can you try to publish multiple standard joomla banner module and check whether the same issue happened?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Thursday, February 18 2021, 04:31 AM · Hide· #2
    Hi
    Thanks for the response

    We're always on the current 3.9 stable. At this moment 3.9.24. PHP version 7.4

    I shall reduce the banners to 1 and test. Will report back.
  •  
  • Replied by CCANSW on Thursday, February 18 2021, 04:50 AM · Hide· #3
    With just one banner image slide published and one responsive banner module published the exceptions disappear.
    Once I activated more banner slides and modules the frequency of the exceptions increased.

    The frequency of the exceptions seems to correlate with the number of active modules.
  •  
  • Replied by admin on Thursday, February 18 2021, 07:12 AM · Hide· #4
    Can you try to publish multiple standard joomla banner module and check whether the same issue happened?
    Can you try this one too?
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Thursday, February 18 2021, 10:51 PM · Hide· #5

    Can you try this one too?


    Sorry, missed that, but will do...
  •  
  • Replied by CCANSW on Friday, February 19 2021, 11:40 PM · Hide· #6
    I disabled all Responsive Banner Modules and introduced the native Joomla banner module, using the same range of banners.

    The native banner module did not throw any exceptions.

    On re-activatng the Responsive Banner Modules the PHP exceptions started almost immediately and are occurring at a frequency of a minute or less.
  •  
  • Replied by admin on Saturday, February 20 2021, 09:44 AM · Hide· #7
    Hmm strange .. Responsive Banner slider uses the same codebase with the native Joomla banner module. I'll check it thoroughly and back to you soon.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Saturday, February 20 2021, 10:32 PM · Hide· #8
    FYI, this one https://www.templateplazza.com/forum/responsive-banner-slider-3-1-1-slide-transition-issues-in-firefox was solved by disabling Avira Browser Safety.

    What's the likelihood of tracker blockers on clients' browsers contributing to the PHP exceptions?
  •  
  • Replied by admin on Saturday, February 20 2021, 10:39 PM · Hide· #9
    What's the likelihood of tracker blockers on clients' browsers contributing to the PHP exceptions?
    I don't think it's related
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Saturday, February 20 2021, 10:55 PM · Hide· #10
    OK

    I'm going to turn debugging on on Joomla and have a closer look at the VPS logs this morning (AU time).

    Will post back
  •  
  • Replied by CCANSW on Tuesday, February 23 2021, 01:10 AM · Hide· #11
    The problem continues
  •  
  • Replied by CCANSW on Tuesday, February 23 2021, 03:09 AM · Hide· #12
    Thinking aloud, two weeks ago we upgraded PHP 7.2 to PHP 7.4 - I don't recall getting the exceptions on 7.2.

    Could that impact?
    • admin - more than a month ago
      That could be
  •  
  • Replied by CCANSW on Wednesday, March 03 2021, 12:00 AM · Hide· #13
    I have checked the #_banner_track records and cannot find duplicates, so at least we know the table is robust.

    I have al;so confirmed that the standard core Joomla banner module does not throw a similar exception.

    	Type	Unique	Packed	Column	Cardinality	Collation	Null	Comment
    Edit Edit 	Drop Drop 	PRIMARY	BTREE	Yes	No	track_date	6779552	A	No	
    track_type	10009908	A	No
    banner_id	71655176	A	No
    Edit Edit 	Drop Drop 	idx_track_date	BTREE	No	No	track_date	6810127	A	No	
    Edit Edit 	Drop Drop 	idx_track_type	BTREE	No	No	track_type	712	A	No	
    Edit Edit 	Drop Drop 	idx_banner_id	BTREE	No	No	banner_id	7392	A	No	


    As you can see the PRIMARY KEY relies on three fields for uniqueness. Is there something in the code of the Responsive Banner Module that may be processing the primary key differently?

    However, the real issue for us now is that since this started we've been experiencing periodic 503 server errors and server stoppages. Given the high frequency of the exceptions we suspected the module as a contributing factor. We're going to disable it for 48 hours as of Friday evening to see what happens.

    Cheers
  •  
  • Replied by CCANSW on Wednesday, March 03 2021, 10:35 PM · Hide· #14
    FYI, I have been running a copy of the website on my local server, using PHP 7.2
    The warnings about the outdated PHP aside, the exceptions are not occurring.
  •  
  • Replied by admin on Wednesday, March 03 2021, 11:08 PM · Hide· #15
    Can you try to replace the existing files with these attached files below (but please BACKUP first) and let me know whether the issue persist or not :
    modules/mod_responsivebannerslider/helper.php
    modules/mod_responsivebannerslider/tmpl/default.php
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Thursday, March 04 2021, 02:53 AM · Hide· #16
    OK, will do
  •  
  • Replied by CCANSW on Thursday, March 04 2021, 03:20 AM · Hide· #17
    Sorry, no luck.

    I had disabled the Responsive Banner modules a few hours ago because there was a suggestion that the high frequency of the exceptions was contributing to load & resource issues and crashes we were experiencing with our VPS. This seemed to be correct;

    I changed the files as you directed, cleared the CMS cache, and re-enabled the Responsive Banner Modules. The exceptions returned immediately, about one every 30 seconds or so. CPU usage also rose dramatically.

    I have disabled the modules again.

    Just looking at the issue of the PRIMARY KEY, this was the Message:
    Line: 200
    Message: Duplicate entry '2021-03-04 03:00:59-1-47' for key 'PRIMARY' 


    Looking at the #_banner_records table, there are no records for "2021-03-04 03:00:59-1-47"

    I've gone back on a few of the previous exceptions and am seeing the same, i.e. there is never a record for the one date/ time value cited in the exception message.

    That seems very curious.

    Finally, checking the logs I see very high mysql server loads when the module is enabled.

    Note the above is on our live VPS running PHP 7.4 - I haven't tested on my local copy that's on 7.2.

    Let me know if there's anything else I can do to help.
  •  
  • Replied by admin on Thursday, March 04 2021, 03:27 AM · Hide· #18
    Hmm really strange, the patched helper file almost identical with the default joomla banner helper's file so if you have no problem with default joomla banner then it shouldn't be a problem with the responsive banner module too.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by CCANSW on Thursday, March 04 2021, 05:23 AM · Hide· #19
    Given the frequency of the exceptions, are they more likely to be triggered at the time of the impression, rather than a click?

    Also, do yo you know what the downside is of deleting all records from the #_banners_tracking table. There are 70million plus records, and the stats aren't really that important at the moment.

    Cheers
  •  
  • Replied by CCANSW on Thursday, March 04 2021, 07:09 AM · Hide· #20
    Some progress, although it may only be a kludge.


      I TRUNCATEd the #banners_track table.
      Turned tracker collection for impressions OFF
      Clicks are ON


    The first thirty minutes suggest the exceptions are gone. Clicks do not seem to generate them either

    We'll see how it goes.

    Thanks for your patience.
  •  
  •  
    Replied by admin on Thursday, March 04 2021, 10:00 AM · Hide· #21
    Np. Glad could help. Just keep me updated
    • CCANSW - more than a month ago
      No exceptions since making the changes yesterday.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments