CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation
Pages: [1]

Author Topic: 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation  (Read 2880 times)

marqpdx

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation
June 08, 2009, 09:38:06 am
hi,

i upgrading from 2.2.2b to 2.2.5 and i got two issues, which i cannot figure out.

1. there were four nearly identical errors which were essentially:
warning: DateTime::__construct() [function.DateTime---construct]: Failed to parse time string (1244910600) at position 8 (0): Unexpected character in /var/www/vhosts/civicrm.baynvc.org/httpdocs/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.

i searched the db for the failed time string (1244910600), but didn't find it.

2. constraint error
DB Error: constraint violation

Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`civicrm_baynvc/civicrm_option_value`, CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE), 1452


and the SQL associated with that error:
Code: [Select]
INSERT INTO `civicrm_option_value` 
      (`option_group_id`, `label`, `value`, `name`, `filter`, `weight`, `is_reserved`, `is_active`, component_id) VALUES                 
      (@og_id_at, 'Change Case Start Date', @max_val_at + 1, 'Change Case Start Date', 0, @max_wt_at + 1, 1, 1, @civicase_component_id ),
      (@og_id_mp, 'Localdir',               @max_val_mp + 1, 'Localdir',               0, @max_wt_mp + 1, 1, 1, NULL)

any help is always appreciated.
thanks,
m

ps - tried to upgrade to 2.2.3 and got the same error.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation
June 08, 2009, 04:52:07 pm
not sure about the first, BUT

can u check if this returns anything:

select id from civicrm_option_group where name = 'mail_protocol';

most likely it wont, hence u r getting that error :(

Seems like in some upgrade cases that option group was not created

can u follow the instructions here to remedy this issue:

http://forum.civicrm.org/index.php/topic,6182.msg27325.html#msg27325

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

fcjversc

  • Guest
Re: 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation
July 02, 2009, 12:07:48 am
Hey marqpdx

Have u found a fix for the first issue? Im using drupal and im getting the same error =(

thnx for ur response!

JimWilson

  • Guest
Re: 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation
July 10, 2009, 03:06:32 am
Yes; same issue with UNIXTIME parsing in civicrm_handler_field_datetime.inc on line 23 when the View 'civicrm_events' is run using the 'year' view e.g.
path /events/2009.  This is a new install using the sample data load.

Quote

    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Fri, 07/10/2009 - 12:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.
    * warning: DateTime::__construct() [datetime.--construct]: Failed to parse time string (Thu, 01/01/1970 - 00:00) at position 16 (-): Unexpected character in /var/www/html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_datetime.inc on line 23.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • 2.2b -> 2.2.5 upgrades issues: DateTime and constraint violation

This forum was archived on 2017-11-26.