JIRA 5.0.6 - Default favicon and logo are inaccessible

I had to import a JIRA backup to our locally hosted JIRA 5.0.6 instance that was created on Atlassian's onDemand service. The import was mostly successful, but one problem still bugged me. The favicon (in the browser's address bar) didn't show up at all, when I visited our JIRA instance's URL. I've opened a support ticket with Atlassian, but in the end I was the one to solve the problem. Smile

I'll just copy&paste the ticket here, because it's not publicly available (ie. you've to have an Atlassian support account to view the ticket).

The problem's description is:

We've installed JIRA 5.0.6 on a Debian Squeeze (6.0.5) server using the 32 bit JIRA (standalone) installer.
After the installation was finished, both the default favicon and logos were properly displayed, both in administration (System / User Interface / Look and Feel / Edit Configuration) and in the system (top-left section of JIRA pages where the logo is displayed and the browser address bar, where the favicon is displayed).

Since we intially started testing JIRA via onDemand, we requested a backup of the trial JIRA environment we used in onDemand. We've imported this backup using the "System / Import & Export / Restore System" screen and all went well.

After the import was done, we've reindexed JIRA and restarted JIRA (via the /etc/init.d/jira script).

Now every time the browser loads a page, the page references the favicon like this:
<link rel="shortcut icon" href="/s/en_USxmofrp/733/5/_/favicon.ico">

The browser tries to load this URL, but is redirected to this:
http://jira.example.com:8180/s/en_USxmofrp/733/5/_/download/resources/com.atlassian.studio.static:studio_images/images/AtlassianFavicon.png

Loading this URL results in a HTTP 404 (Not found) error and at the same time we get the following line in the /var/atlassian/application-data/jira/log/atlassian-jira.log file:
2012-07-05 14:15:07,780 http-8180-10 INFO anonymous 855x10734x3 1scevsf 192.168.0.122 /s/en_USxmofrp/733/5/_/download/resources/com.atlassian.studio.static:studio_images/images/AtlassianFavicon.png [atlassian.plugin.webresource.SingleDownloadableResourceBuilder] Module not found: com.atlassian.studio.static:studio_images

We're really just starting to understand how JIRA works, but my best bet is that the "JIRA Studio" plugin (which I was told is currently "being phased out") was installed in onDemand and it did set/save something regarding both the JIRA favicon and logo. And since our 5.0.6 JIRA does not have "JIRA Studio", there's some missing dependency.

If I go to the "System / User Interface / Look and Feel / Edit Configuration" screen, I see plain blue rectangles above the "Default" labels for both the favicon and the logo. If I click the "Reset defaults" button, both the favicon and the logo are set to the "Default" setting and neither of them are displayed in the system (no logo in the top-left section of the JIRA pages and no favicon in the browser's address bar).

I've just tested this in an 5.0.7 trial installation and it's all the same.

Please, let us know if we can provide further information to help track down the source of the problem.
This might be a bug ... or just a problem with importing backups created in onDemand.

I've attached screenshot of the "System / User Interface / Look and Feel / Edit Configuration" screen before and after the import of the onDemand backup and a JIRA restart.

And here's the solution to the problem (the one before my last comment in the ticket):

My efforts ended in a full success.

I used (eventually) the following query to get all favicon and logo related application properties from the JIRA database:

SELECT pe.*, ps.`propertyvalue`
FROM `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
WHERE 1 = 1
AND (
pe.`PROPERTY_KEY` LIKE 'com.atlassian.jira.lookandfeel%favicon%'
OR pe.`PROPERTY_KEY` LIKE 'com.atlassian.jira.lookandfeel%logo%'
OR pe.`PROPERTY_KEY` LIKE 'jira.lf%favicon%'
OR pe.`PROPERTY_KEY` LIKE 'jira.lf%logo%'
)
ORDER BY pe.`PROPERTY_KEY`

Then I compared values from both our production JIRA instance and an evaluation JIRA instance that I just set up to get the default values for these properties.

Then I created the necessary SQL statements to set all the properties in our production instance's database to the default values:

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = 'JIRA'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel.faviconChoice', 'com.atlassian.jira.lookandfeel.logoChoice');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '64'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:faviconHeight', 'com.atlassian.jira.lookandfeel:faviconWidth');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = 'false'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:isDefaultFavicon', 'com.atlassian.jira.lookandfeel:usingCustomFavicon', 'com.atlassian.jira.lookandfeel:isDefaultLogo', 'com.atlassian.jira.lookandfeel:usingCustomLogo');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '30'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:logoHeight', 'jira.lf.logo.height');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '111'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:logoWidth', 'jira.lf.logo.width');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '/images/jira111x30.png'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:DefaultlogoURL', 'jira.lf.logo.url');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '/images/64jira.png'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:customDefaultFaviconHiresURL', 'jira.lf.favicon.hires.url');

UPDATE `propertyentry` pe
JOIN `propertystring` ps ON pe.`ID` = ps.`ID`
SET ps.`propertyvalue` = '/favicon.ico'
WHERE 1 = 1
AND pe.`PROPERTY_KEY` IN ('com.atlassian.jira.lookandfeel:customDefaultFaviconURL', 'jira.lf.favicon.url');

Of course I've created both an XML backup and separate database-level (MySQL) backup and a backup of the JIRA data directory prior to messing with JIRA's properties. And I've shut down JIRA too before running these updates.

Afterwards I've started up JIRA, went to the "Look and Feel" admin screen, clicked "Edit Configuration" and clicked "Reset Defaults". That did the trick.

To be sure, I also clicked the link in the "Refresh Client Resources" section and I executed a re-indexing of JIRA.

Now both the favicon and the logo are reset to their defaults and work just fine.
I consider this issue/ticket closed.