No CSS after upgrade to 2.10

Upgraded a recently installed PiaF Centos 5.7 setup from 2.9 to 2.10 and lost all my CSS. The CSS files called in the head of the HTML (common/mstyle_autogen_1330716857.css?load_version=2.10.0.2 and assets/core/css/core.css) both return 404 Not Found. Anyone else have this happen to them? Anything I can do? I found this in the PHP error log, not sure if it’s normal or not:

2012-Mar-19 16:09:54	/var/www/html/admin/modules/framework/upgrades/2.10.0beta2/migration.php:80
[WARNING]: rmdir(/var/www/html/admin/common): Directory not empty

Here’s what those directories that should have CSS look like; no permissions problems or anything like that.

$ cd /var/www/html/admin/

$ ls -lah common/
total 60K
drwxrwx---  2 asterisk asterisk 4.0K Mar 19 16:09 .
drwxrwx--- 10 asterisk asterisk 4.0K Mar 19 16:09 ..
-rw-rw-r--  1 asterisk asterisk 7.0K Apr 17  2011 graph_pie.php
-rw-rw-r--  1 asterisk asterisk  44K Apr 17  2011 jquery-ui-1.8.custom.min.js

$ ls -lah assets/
total 24K
drwxrwxr-x  6 asterisk asterisk 4.0K Feb  8 18:22 .
drwxrwx--- 10 asterisk asterisk 4.0K Mar 19 16:09 ..
drwxrwxr-x  2 asterisk asterisk 4.0K Mar 19 16:09 css
drwxrwxr-x  5 asterisk asterisk 4.0K Aug 18  2011 endpointman
drwxrwxr-x  3 asterisk asterisk 4.0K Mar 19 16:09 images
drwxrwxr-x  2 asterisk asterisk 4.0K Mar 19 16:09 js
lrwxrwxrwx  1 asterisk asterisk   46 Jan 24 19:22 sipsettings -> /var/www/html/admin/modules/sipsettings/assets

I set “DISABLE_CSS_AUTOGEN” to “1” in the advanced settings. I had to do this in the database directly, since the settings page didn’t work without the CSS in place. That’s a problem for another time.

After that I reinstalled the Framework and Core modules, which seems to have fixed things completely:

$ ls -lah assets/
total 24K
drwxrwxr-x  6 asterisk asterisk 4.0K Mar 19 17:52 .
drwxrwx--- 10 asterisk asterisk 4.0K Mar 19 16:09 ..
lrwxrwxrwx  1 asterisk asterisk   41 Mar 19 17:52 backup -> /var/www/html/admin/modules/backup/assets
lrwxrwxrwx  1 asterisk asterisk   39 Mar 19 17:52 core -> /var/www/html/admin/modules/core/assets
drwxrwxr-x  2 asterisk asterisk 4.0K Mar 19 16:09 css
lrwxrwxrwx  1 asterisk asterisk   44 Mar 19 17:52 directory -> /var/www/html/admin/modules/directory/assets
drwxrwxr-x  5 asterisk asterisk 4.0K Aug 18  2011 endpointman
drwxrwxr-x  3 asterisk asterisk 4.0K Mar 19 16:09 images
lrwxrwxrwx  1 asterisk asterisk   38 Mar 19 17:52 ivr -> /var/www/html/admin/modules/ivr/assets
drwxrwxr-x  2 asterisk asterisk 4.0K Mar 19 16:09 js
lrwxrwxrwx  1 asterisk asterisk   43 Mar 19 17:52 logfiles -> /var/www/html/admin/modules/logfiles/assets
lrwxrwxrwx  1 asterisk asterisk   46 Jan 24 19:22 sipsettings -> /var/www/html/admin/modules/sipsettings/assets

Just hit this myself.

This is the query I used to fix it:

UPDATE freepbx_settings SET value = '1' WHERE keyword = 'DISABLE_CSS_AUTOGEN';

… the database of course being asterisk.

If you’re new to MySQL, just do this:

mysql -u root -p

… enter your mysql password …

use asterisk; UPDATE freepbx_settings SET value = '1' WHERE keyword = 'DISABLE_CSS_AUTOGEN';

I did not have to re-install modules after doing this, just reloading the page was sufficient.

Thanks for finding and posting the knob to turn, I was a little freaked after upgrading when I saw a naked page :slight_smile:

Has someone reported and opened a bug on this yet. If you look to the right of your screen you will see a link called Report Bug/Feature

As Tony mentions, it would be nice to file a bug report with detailed repro steps on this since there have been thousands of upgrades that have worked, we’d like to understand what are the circumstances that might be causing this.

In the meantime, it’s not a very good idea to go editing the database or suggesting that people do that. If you have a setting that needs to be set, you can simply type:

/var/lib/asterisk/bin/freepbx_setting DISABLE_CSS_AUTOGEN 1

or don’t type any parameters for help:

[[email protected] ~]# /var/lib/asterisk/bin/freepbx_setting 
Usage:
/var/lib/asterisk/bin/freepbx_setting RAW_SETTING_NAME <value>
RAW_SETTING_NAME is case sensitive and almost always all CAPS
Boolean settings should be set with 0 for false and 1 for true

This will make sure that it get’s properly set and validated so that you don’t get any garbage into the database by accident.

But again, details in a bug report is what is most helpful :slight_smile:

Or run

amportal a r

i opened bug 5928 for this issue which happened to me on INSTALL

This bug should be a blocker given that it renders the gui interface useless.

It is present on the current “stable” distro release:

FreePBX-1.1007.210.58-x86_64-Netinstall-1344904533.iso

Looks like there were a bunch of CSS related bug fixes in 2.10.1 but I still experienced this problem upgrading from 2.9.

This is what the FreePBX error log looks like:

[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:55) - Undefined index: FORCE_JS_CSS_IMG_DOWNLOAD
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:60) - Undefined index: BRAND_IMAGE_HIDE_NAV_BACKGROUND
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:63) - Undefined index: BRAND_IMAGE_SHADOW_SIDE_BACKGROUND
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:67) - Undefined index: AMPADMINLOGO
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:70) - Undefined index: BRAND_IMAGE_FREEPBX_RIGHT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:72) - Undefined index: BRAND_FREEPBX_ALT_LEFT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:73) - Undefined index: BRAND_FREEPBX_ALT_RIGHT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:74) - Undefined index: BRAND_IMAGE_FREEPBX_LEFT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:75) - Undefined index: BRAND_IMAGE_FREEPBX_LINK_LEFT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:76) - Undefined index: BRAND_IMAGE_FREEPBX_LINK_RIGHT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:77) - Undefined index: BRAND_HIDE_LOGO_RIGHT
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:78) - Undefined index: BRAND_HIDE_HEADER_VERSION
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:79) - Undefined index: BRAND_HIDE_HEADER_MENUS
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:81) - Undefined index: BRAND_CSS_ALT_MAINSTYLE
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:82) - Undefined index: BRAND_CSS_CUSTOM
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:84) - Undefined index: DISABLE_CSS_AUTOGEN
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:85) - Undefined index: AMPWEBROOT
[2013-Jan-03 13:25:48] [PHP-WARNING] (/var/www/html/admin/views/freepbx.php:90) - stat(): stat failed for /admin/common/mainstyle.css
[2013-Jan-03 13:25:48] [PHP-WARNING] (/var/www/html/admin/views/freepbx.php:109) - file_get_contents(/admin/common/mainstyle.css): failed to open stream: No such file or directory
[2013-Jan-03 13:25:48] [PHP-WARNING] (/var/www/html/admin/views/freepbx.php:113) - file_put_contents(/admin/common/mstyle_autogen_.css): failed to open stream: No such file or directory
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:195) - Undefined variable: module_name
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:236) - Undefined index: USE_PACKAGED_JS
[2013-Jan-03 13:25:48] [PHP-NOTICE] (/var/www/html/admin/views/freepbx.php:386) - Undefined index: FOPDISABLE
[2013-Jan-03 13:25:56] [PHP-WARNING] (/var/www/html/admin/modules/dashboard/class.procinfo.php:12) - fsockopen(): unable to connect to localhost:22 (Connection refused)
[2013-Jan-03 13:26:04] [PHP-NOTICE] (/var/www/html/admin/modules/fax/functions.inc.php:515) - Undefined index: legacy_email
[2013-Jan-03 13:26:11] [PHP-NOTICE] (/var/www/html/admin/modules/voicemail/functions.inc.php:296) - Undefined variable: vmops_imapuser
[2013-Jan-03 13:26:11] [PHP-NOTICE] (/var/www/html/admin/modules/voicemail/functions.inc.php:296) - Undefined variable: vmops_imappassword
[2013-Jan-03 13:27:20] [PHP-WARNING] (/var/www/html/admin/libraries/utility.functions.php:417) - file_get_contents(http://mirror.freepbx.org/version-2.10.0alpha0.html?installid=xxx&astver=1.8.7.2&phpver=5.3.3&distro=piaf&distrover=1.7.5.7.PURPLE): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

[2013-Jan-03 13:27:29] [PHP-WARNING] (/var/www/html/admin/modules/framework/upgrades/2.10.0beta2/migration.php:80) - rmdir(/var/www/html/admin/common): Directory not empty
[2013-Jan-03 13:27:33] [PHP-NOTICE] (/var/www/html/admin/modules/framework/upgrades/2.10.1/migration.php:35) - Uninitialized string offset: 0
[2013-Jan-03 13:27:33] [PHP-NOTICE] (/var/www/html/admin/modules/framework/upgrades/2.10.1/migration.php:35) - Uninitialized string offset: 0
[2013-Jan-03 13:27:33] [PHP-NOTICE] (/var/www/html/admin/modules/framework/upgrades/2.10.1/migration.php:52) - Undefined index: ASTMGRWRITETIMEOUT
[2013-Jan-03 13:27:33] [PHP-WARNING] (/usr/share/pear/DB/mysql.php:802) - mysql_real_escape_string() expects parameter 1 to be string, array given

And then it died halfway through the upgrade process with this in the Apache log:

[03-Jan-2013 13:27:33] PHP Fatal error:  Class 'CssMin' not found in /var/www/html/admin/modules/framework/install.php on line 147
$ php -v
PHP 5.3.3 (cli) (built: Feb 22 2012 19:37:49) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
$ uname -a
Linux xxx.xxx.ca 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:14:03 EDT 2011 i686 i686 i386 GNU/Linux