Answers.Body: <p>It sounds like you have some weird data in that column. The new maxlength is 16 which is plenty long for the 3 possible values (always, never, or unused). Can you check your existing data &amp; see what's in there?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-22T10:51:59.643Z
Answers.Text: Yeah, seems to be odd data in civicrm_managed table. It was set to NULL changed it to never using sql query
Answers.UserDisplayName: FullStack-Dev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-20T23:44:24.690Z
Answers.LastActivityDate: 2024-02-20T23:44:24.690Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>Try updating the database with below query before the upgrade and then run Civi update</p>
  <pre><code>UPDATE civicrm_managed
  SET cleanup = 'always'
  WHERE cleanup IS NULL;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-22T10:52:32.877Z
Answers.Text: Thank you Pradeep. I set cleanup to never
Answers.UserDisplayName: FullStack-Dev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-20T22:34:14.913Z
Answers.LastActivityDate: 2024-02-20T22:34:14.913Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Upgrade fails below error</p>
  <pre><code>CRM_Core_Exception: 1265 ALTER TABLE `civicrm_managed` CHANGE `cleanup` `cleanup` varchar(16) NOT NULL DEFAULT 'always' COMMENT 'Policy on when to cleanup entity (always, never, unused)' [nativecode=1265 ** Data truncated for column 'cleanup' at row 62] in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php on line 101
  </code></pre>
  
Tags: <upgrade>
Title: Civi Upgrade Error when upgrade from 5.66.2 to 5.70
ThreadText: # Civi Upgrade Error when upgrade from 5.66.2 to 5.70
  
  (Asked by: username_0 on 2024-02-20)
  
  Upgrade fails below error
  CRM_Core_Exception: 1265 ALTER TABLE `civicrm_managed` CHANGE `cleanup` `cleanup` varchar(16) NOT NULL DEFAULT 'always' COMMENT 'Policy on when to cleanup entity (always, never, unused)' [nativecode=1265 ** Data truncated for column 'cleanup' at row 62] in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php on line 101
  
  **Tags:** upgrade
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-02-20. Score: 0
  
  It sounds like you have some weird data in that column. The new maxlength is 16 which is plenty long for the 3 possible values (always, never, or unused). Can you check your existing data & see what's in there?
  
  > **Comments:**
  > **username_0**: Yeah, seems to be odd data in civicrm_managed table. It was set to NULL changed it to never using sql query  
  
  ---
  
  ### Answer by username_2 on 2024-02-20. Score: 0
  
  Try updating the database with below query before the upgrade and then run Civi update
  UPDATE civicrm_managed
  SET cleanup = 'always'
  WHERE cleanup IS NULL;
  
  > **Comments:**
  > **username_0**: Thank you Pradeep. I set cleanup to never  
  
  ---
  
  