If this is your first visit, check our documentation. To post, register or login.
Forums / Installing on a Windows Server / fatal error 1101 on fresh local install of 1.5.4

fatal error 1101 on fresh local install of 1.5.4

Locked

Started by keneso on 3 Jan 2015, 8:23 PM · Views: 4,696

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
3 Jan 2015, 8:23 PM
#1
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

fatal error 1101 on fresh local install of 1.5.4

Hi,

I downloaded v.1.5.4, and tried installing on local server, after the needed configuration of Apache, and PHP, all went thru well (all green), can access store fine, but when trying to go to admin I get:
WARNING: An Error occurred, please refresh the page and try again.

The log file reads:
[03-Jan-2015 20:12:52 UTC] PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 <== in C:\Users\PC\sites\AAAhtdocs\zentest\includes\classes\db\mysql\query_factory.php on line 155

Also there is an install warning log:
[03-Jan-2015 20:12:19 UTC] PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59

Thank you

3 Jan 2015, 8:41 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: fatal error 1101 on fresh local install of 1.5.4

keneso:

Hi,

I downloaded v.1.5.4, and tried installing on local server, after the needed configuration of Apache, and PHP, all went thru well (all green), can access store fine, but when trying to go to admin I get:
WARNING: An Error occurred, please refresh the page and try again.

The log file reads:
[03-Jan-2015 20:12:52 UTC] PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 <== in C:\Users\PC\sites\AAAhtdocs\zentest\includes\classes\db\mysql\query_factory.php on line 155

Also there is an install warning log:
[03-Jan-2015 20:12:19 UTC] PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59

Thank you

I've found errors like that relate to the mysql installation, particularly when working on a windows server. I have often corrected by modifying table settings or sql for the applicable problem field/table. Or if necessary settings in the mysql database to allow such "default" setting against a BLOB/TEXT column for example...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

3 Jan 2015, 10:16 PM
#3
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,816
Plugin Contributions:
4

Re: fatal error 1101 on fresh local install of 1.5.4

keneso:

... PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59 ...
This indicates you have not configured your timezone in "php.ini" (in your local development server). This is now required by a number of internal PHP functions (PHP 5.3+) and the error message is coming from PHP itself.

Alternatively (if this message is received on a hosted server and the hosting company cannot / will not / does not allow updating "php.ini"), one can edit "/includes/extra_configures/set_time_zone.php" to add the correct timezone. Be aware this should only be used as a last resort.

keneso:

... PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 ...
MySQL does not allow setting a default on TEXT or BLOB fields, so this may be a minor bug in the code. Probably was missed because many production MySQL servers are configured to ignore rather than report this error.

Starting in "/admin/includes/classes/class.admin.zcObserverLogWriterDatabase.php" around line 87 change the following code:

from:

    if (!$found_logmessage)
    {
      $sql = "ALTER TABLE " . TABLE_ADMIN_ACTIVITY_LOG . " ADD COLUMN logmessage mediumtext NOT NULL default ''";
      $db->Execute($sql);
    }
    // add 'severity' field of type varchar(9)

to:

    if (!$found_logmessage)
    {
      $sql = "ALTER TABLE " . TABLE_ADMIN_ACTIVITY_LOG . " ADD COLUMN logmessage mediumtext NOT NULL;
      $db->Execute($sql);
    }
    // add 'severity' field of type varchar(9)

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

3 Jan 2015, 11:50 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: fatal error 1101 on fresh local install of 1.5.4

What version of PHP and MySQL are you using?
And what version of Windows on your local PC?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Jan 2015, 12:12 AM
#6
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: fatal error 1101 on fresh local install of 1.5.4

DrByte:

What version of PHP and MySQL are you using?
And what version of Windows on your local PC?

httpd-2.4.10-win64-VC11
php-5.6.4-Win32-VC11-x64
mysql-web-community-5.6.22.0
Windows 8.1 64-bit

I did the "standard" installs, not selecting any particular option as I can remember, only problem was with phpMyAdmin.

4 Jan 2015, 12:50 AM
#7
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,816
Plugin Contributions:
4

Re: fatal error 1101 on fresh local install of 1.5.4

I've been able to duplicate this under MySQL 5.5 and 5.6 when STRICT_ALL_TABLES is enabled in MySQL (Windows and Linux). The binary compilations (from Oracle) do not enable this mode by default (according to the documentation).

When not enabled, MySQL 5.5 and 5.6 appear to just create the column as if no default was specified. "SHOW CREATE TABLE admin_activity_log" shows the following after creation without STRICT_ALL_TABLES enabled:

CREATE TABLE `admin_activity_log` (
  `log_id` bigint(15) NOT NULL AUTO_INCREMENT,
  `access_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  `admin_id` int(11) NOT NULL DEFAULT '0',
  `page_accessed` varchar(80) NOT NULL DEFAULT '',
  `page_parameters` text,
  `ip_address` varchar(45) NOT NULL DEFAULT '',
  `flagged` tinyint(4) NOT NULL DEFAULT '0',
  `attention` varchar(255) NOT NULL DEFAULT '',
  `gzpost` mediumblob,
  `logmessage` mediumtext NOT NULL,
  `severity` varchar(9) NOT NULL DEFAULT 'info',
  PRIMARY KEY (`log_id`),
  KEY `idx_page_accessed_zen` (`page_accessed`),
  KEY `idx_access_date_zen` (`access_date`),
  KEY `idx_flagged_zen` (`flagged`),
  KEY `idx_ip_zen` (`ip_address`),
  KEY `idx_severity_zen` (`severity`)
) ENGINE=MyISAM

NOTE: COLLATE, CHARSET, and the current AUTO_INCREMENT values were removed from the above table structure dump.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker