v13.3: Corrupt or invalid UI Theme can bring the application down

Document ID : KB000029419
Last Modified Date : 14/02/2018
Show Technical Document Details

Symptoms:

The users cannot connect to the application, the browser hangs and nothing is displayed. Error java.lang.StringIndexOutOfBoundsException: String index out of range: -9 is thrown in the logs

This is caused by invalid or corrupt custom UI theme.

Steps to Reproduce:

1. Login into v13.3  
2. Navigate to Administration, Studio: UI Themes  
3. Create a new theme 
4. Enter the following as the CSS 
    #ppm_header_product span:before, #ppm_header_product_small span:before {content:
5. Click Save and return
6. If no error is experienced , select your new theme to be the default, click Save again 
 

Expected Result: Should display error indicating that CSS is invalid, and to revert to a system theme like Default, 

Actual Result: The browser hangs, nobody can login, and errors are displayed in the application log file
  i.e ERROR 2016-01-22 18:08:51,614 [http-bio-80-exec-14] uif.UIServlet (clarity:unknown:none:none)  java.lang.StringIndexOutOfBoundsException: String index out of range: -9

   at java.lang.String.substring(String.java:1911)
   at com.niku.odf.object.Utils.getProductNameFromTheme(Utils.java:555)

Cause:

Caused by CLRT-73888  

Resolution:

Resolved in CA PPM 14.1

Workaround:

Run the following two queries on the database to force CA PPM back to using the system default theme: 

update cmn_ui_themes set is_default = 0 where is_default = 1;
update cmn_ui_themes set is_default = 1 where code = 'default';
commit;