Skip to Content
Author's profile photo Jerry Wang

Something about negative cache error

I am testing my Fiori extension project created based on SAP standard Fiori application “My Opportunity” and I meet with error message “Error: found in negative cache: ‘cus/crm/opportunityExt/Component.js’ from /sap/bc/ui5_ui5/sap/extcrm_opp/Component.js: Error: found in negative cache: ‘cus/crm/opportunity/Component.js’ from /sap/bc/ui5_ui5/ui2/ushell/resources/cus/crm/opportunity/Component.js: 404 – NOT FOUND” when I click tile of my Extension project in Fiori launchpad:

/wp-content/uploads/2015/06/clipboard1_716539.png

/wp-content/uploads/2015/06/clipboard2_716567.png

Issue analysis

put mouse onto the hyperlink part of the topmost callstack, “at a1…”, the mouse becomes a hand shape:

/wp-content/uploads/2015/06/clipboard3_716568.png

click it, and Chrome will bring us to the exact code where this error occurs. Click the bracket icon to format the code:

/wp-content/uploads/2015/06/clipboard4_716569.png

Now the reason of this “negative cache” is clear: there is a global array M which stores all currently loaded modules with their url and state. Since the module to be loaded when I click the tile of my extension project, “cus.crm.opportunity.Component.js”, has error state ( 5 ), the corresponding error is raised.

/wp-content/uploads/2015/06/clipboard5_716571.png

Why this Component.js file is needed when I click the tile

from the callstack we can find the answer:

1. UI controller has a method openApp, which will call render method.

/wp-content/uploads/2015/06/clipboard6_716572.png

2. render method will further delegate the call to load component via sap.ui.component.load:

/wp-content/uploads/2015/06/clipboard7_716573.png

What is negative cache

Let me copy the definition from wikipedia:

In computer programming, negative cache is a cache that also stores “negative” responses, i.e. failures. This means that a program remembers the result indicating a failure even after the cause has been corrected. Usually negative cache is a design choice, but it can also be a software bug.

I am glad today I know a new terminology 🙂

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Maksim Rashchynski
      Maksim Rashchynski

      Running in debug mode gives you much more readable sources

      } else if ( oModule.state === FAILED ) {

        throw new Error("found in negative cache: '" + sModuleName +  "' from " + oModule.url + ": " + oModule.error);

      Author's profile photo Jerry Wang
      Jerry Wang
      Blog Post Author

      Hi Maksim,

      Thanks a lot for your complement. 🙂

      Best regards,

      Jerry

      Author's profile photo Former Member
      Former Member

      So how do you get rid of this negative cache?

      Author's profile photo Former Member
      Former Member

      Im currently experiencing this issue with a few of my applications. Specifically Employee Lookup, My Time Events, My Services, My Team Calendar.

      Anyone know how to fix this?

      Author's profile photo Naveenraj A
      Naveenraj A

      Hi Jared, If you get Negative cache issue while opening a Tile in Launchpad, there may be a configuration problem in LPD_CUST entry or ICF node activation.

      As i understand from your application list(Standard apps), Please ensure that respective service nodes (in path- /sap/bc/ui5_ui5/sap/) are activated in ICF (tcode - SICF).

      Regards,

      Naveenraj

      Author's profile photo Former Member
      Former Member

      Hi,

      Good tip, but I still have this error, can you give us some more details and possibilities to look up?

      Many Thanks

      Author's profile photo Edwar Soto
      Edwar Soto

      Thank you Naveenraj,

      I have resolved my issue with your commentary. !!!

      TX: SICF and just I have actived my service for fiori app. 🙂

      Author's profile photo Nithish Puthiyaveedu
      Nithish Puthiyaveedu

      HI Jerry Wang,

      We started facing he negative cache issue for not only Opportunity extension app , but all also for all other extension CRM apps.

      Is there is a way to resolve this ?

      Thanks,

      Nithish

      Author's profile photo Jerry Wang
      Jerry Wang
      Blog Post Author

      Hi Nithish,

      Can you please kindly paste the whole error message displayed in Chrome development tool - console tab here?

      Best regards,

      Jerry

      Author's profile photo Nithish Puthiyaveedu
      Nithish Puthiyaveedu

      Hi Jerry,

      I found the issue and its seems there is a bug in latest webide versions >1.14 while deploying extended apps to ABAP server.

      There is a new webapp additional folder created in BSP storage repository for the extended app which avoids loading up the component.js file through the launchpad. I corrected the UI5RepositoryPathMapping.xml file as below which identifies the component .js correctly

      <MappingEntry

          path              = "webapp/Component.js"

          is_folder         = ""

          internal_rep      = "B"

          internal_rep_path = "webapp/Component.js" />

      * -----correction-------

      <MappingEntry

          path              = "Component.js"

          is_folder         = ""

          internal_rep      = "B"

          internal_rep_path = "webapp/Component.js" />

      Regards,

      Nithish

      Author's profile photo Jerry Wang
      Jerry Wang
      Blog Post Author

      Hello Nithish,

      It is great that you have resolved the issue all by yourself, and really appreciated you have shared your solution to us!

      Best regards,

      Jerry

      Author's profile photo Joaquin Fornas
      Joaquin Fornas

      Hello all

      Whennever a "negative cache error" arises, it is always convenient applying the following note:

      2246386 - UI_700 (SP01-SP02): Invalidate UI2 Cache on UI5 app change

      Regards

      Joaquin

      Author's profile photo Abhijit Zope
      Abhijit Zope

      We were facing this issue when we have enhanced TEAM CALENDAR application through Web IDE. Reason for issue was - service node in SICF was not activated (path: "/default_host/sap/bc/bsp/sap/" and path "/default_host/sap/bc/ui5_ui5/sap/" which we forgot to activate when moved object to production clients.

      Just adding my comments in case anyone facing same issue in this scenario and looking for solution.

      Regards,

      AZ

      Author's profile photo Asim Mian
      Asim Mian

      My team is doing development in the Web IDE and was pushing code to ABAP repository. We were having the same issue and found that there is an optimized file created by Web IDE starting with UI5 (e.g. UI5B2B5D24238268DEF4FA05063EBE5142BBCACE17B). I directly edited the component.js which does not auto generate the above mentioned file. So it was still referencing the old snapshot.

      So I did the change back in Web IDE and pushed it over. That resolved this error for us.