Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40663

DEBUG org.sakaiproject.site.impl.BaseSiteService.update Site not found when handling an event (prefs.upd) appears in the logs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.4
    • Fix Version/s: 12.5, 19.0
    • Component/s: None
    • Labels:
      None
    • 12 status:
      Resolved
    • Test Plan:
      Hide

      Please add a Test Plan here.

      Show
      Please add a Test Plan here.

      Description

      • Ensure Debug logging is enabled in local.properties
        log.config.count=2
        log.config.1 = DEBUG.org.sakaiproject.user
        log.config.2 = DEBUG.org.sakaiproject.site
      • login as any user
      • check the tomcat logs
        9-Sep-2018 15:10:44.753 DEBUG [http-nio-8980-exec-6] org.sakaiproject.site.impl.BaseSiteService.update Site not found when handling an event (prefs.upd), ID/REF: /prefs/2967768f-7f93-47e4-ad97-a8bad63b1659
        

      Editing preferences or I believe after a user's cache expires and they navigate anywhere, it will appear again. Perhaps it's benign (since the failing method merely tries to clear the user site cache)? but it does add extra lines to the log file.

      Looking into the code, it's failing in BaseSiteService.java

      	public void update(Observable _, Object eventObj) {
                     .
                     .
                     .
      
      		String eventType = event.getEvent();
      
      		if (EVENT_SITE_USER_INVALIDATE.equals(eventType) || PreferencesService.SECURE_EDIT_PREFS.equals(eventType)) {
      			// KNL-1171: always clear the cache for the user as the Site below may have been deleted
      			clearUserCacheForUser(event.getUserId());
      
      			try {
      				Site site = getSite(event.getResource());
      				clearUserCacheForSite(site);
      			} catch (IdUnusedException e) {
      				if (log.isDebugEnabled())
      				{
      					log.debug("Site not found when handling an event (" + eventType + "), ID/REF: " + event.getResource());
      				}
      			}
      		}
      

      and it's failing because event.getResource() is returning "/prefs/2967768f-7f93-47e4-ad97-a8bad63b1659", but getSite() expects "~2967768f-7f93-47e4-ad97-a8bad63b1659"
      so it throws the IdUnusedException

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  austinUH Austin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code