Answers.Body: <p>If you check the civi log from the date you ran the upgrade I expect something failed.</p>
  <p>This is risky sometimes but you can try:</p>
  <ul>
  <li>Make a db backup.</li>
  <li>In api explorer choose Domain.create, and set civi version. In this case to 5.60.0.
  <ul>
  <li>It will also ask for name but pick id instead and put 1.</li>
  </ul>
  </li>
  <li>Visit the upgrade screen and run updates.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-12T19:21:59.907Z
Answers.Text: Thanks for the suggestion. I don't know what api explorer is though. I'm not an expert at this stuff.
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-12T19:28:35.090Z
Answers.Text: If you could explain a bit more where/how to do this that would be great. Thanks.
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-12T20:11:40.867Z
Answers.Text: It's in the menu under Support - Developer - Api explorer v3. You choose Domain for the entity and create for the action. Then two rows of fields appear. Change the name one to id and put `1` in the box to the right. For the version one put `5.60.0`. Then click execute at the bottom. https://docs.civicrm.org/dev/en/latest/api/#api-explorer
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-12T20:32:01.627Z
Answers.Text: It worked! Thank you so much for all your help Demerit!
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-12T18:35:50.713Z
Answers.LastActivityDate: 2023-05-12T18:35:50.713Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>I am just writing this here as I had a similar issue and this could be helpful to someone.</p>
  <p>This site is on Joomla. I could not even access the Civi component without a server error. So what was done - restore the civi backups /administrator/components/civicrm and components/civicrm and run the installation again and do the DB run script (cleared the templates_c folder also each time).</p>
  <p>Also had this issue where the civi version was not properly getting updated so had to change it manually on civicrm_domain</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-07T05:06:45.227Z
Answers.LastActivityDate: 2023-09-07T05:06:45.227Z
Answers.UserDisplayName: Srinath Obeysekara
Body: <p>The setup is CiviCRM 5.61.2 on Drupal 7.97. Using Stripe for payment with the latest version of the extension.</p>
  <p>We are getting the following error whenever we try to do anything.</p>
  <pre><code>[error] 
  $Fatal Error Details = array:3 [
    &quot;message&quot; =&gt; &quot;DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report.&quot;
    &quot;code&quot; =&gt; null
    &quot;exception&quot; =&gt; CRM_Core_Exception {#2244
      -errorData: array:8 [
        &quot;error_code&quot; =&gt; -19
        &quot;sql&quot; =&gt; &quot;&quot;
        &quot;debug_info&quot; =&gt; &quot;&quot;&quot;
          SELECT a.id as `id`, a.domain_id as `domain_id`, a.name as `name`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.payment_processor_type_id as `payment_processor_type_id`, a.is_active as `is_active`, a.is_default as `is_default`, a.is_test as `is_test`, a.user_name as `user_name`, a.password as `password`, a.signature as `signature`, a.url_site as `url_site`, a.url_api as `url_api`, a.url_recur as `url_recur`, a.url_button as `url_button`, a.subject as `subject`, a.class_name as `class_name`, a.billing_mode as `billing_mode`, a.is_recur as `is_recur`, a.payment_type as `payment_type`, a.payment_instrument_id as `payment_instrument_id`, a.accepted_credit_cards as `accepted_credit_cards`\n
          FROM civicrm_payment_processor a\n
          WHERE (a.is_active = &quot;1&quot;) AND (a.domain_id = &quot;1&quot;)\n
          ORDER BY a.is_default DESC, a.name\n
           [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']
          &quot;&quot;&quot;
        &quot;entity&quot; =&gt; &quot;PaymentProcessor&quot;
        &quot;action&quot; =&gt; &quot;get&quot;
        &quot;is_error&quot; =&gt; 1
        &quot;error_message&quot; =&gt; &quot;DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report.&quot;
        &quot;debug_information&quot; =&gt; &quot;&quot;
      ]
      #cause: null
      -_trace: null
      #message: &quot;DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report.&quot;
      #code: -19
      #file: &quot;/home/mydomain/www/www/sites/all/modules/civicrm/api/api.php&quot;
      #line: 135
      trace: {
        /home/mydomain/www/www/sites/all/modules/civicrm/api/api.php:135 {
          civicrm_api3(string $entity, string $action, array $params = [])
          › if (is_array($result) &amp;&amp; !empty($result['is_error'])) {
          ›   throw new CRM_Core_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
          › }
        }
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:305 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:400 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:450 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Config.php:441 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php:455 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:319 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
        /home/mydomain/www/www/includes/menu.inc:527 { …}
        /home/mydomain/www/www/index.php:21 { …}
      }
    }
  ]
  </code></pre>
  <p>Another symptom is that we can't access contributions of individual member - just give a blank and we get a Network Error &quot;Unable to reach the server. Please refresh this page in your browser and try again&quot;</p>
  <h2>Any help appreciated.</h2>
  <p>Revision in response to whether upgrades have been run. Seems so.
  <a href="https://i.sstatic.net/g9tg5.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/g9tg5.jpg" alt="screenshot showing upgrades" /></a></p>
  <p>MORE INFORMATION
  When I go to edit the Payment Processor (see screenshot below), it won't save. Looking at the table civicrm_payment_processor, there does not appear to be a field for the Frontend Title in the form which is a required field.</p>
  <p><a href="https://i.sstatic.net/imqCz.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/imqCz.jpg" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-12T16:41:43.007Z
Comments.Text: It sounds like the [upgrades](https://github.com/civicrm/civicrm-core/blob/884ced9f0059f4ae613ca970af08ca85cee72523/CRM/Upgrade/Incremental/php/FiveSixtyOne.php#L60) didn't run. Have you run the upgrades for 5.61?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-12T17:44:53.313Z
Comments.Text: I thought I had. Is there a way to run them again?
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-12T18:00:32.160Z
Comments.Text: Actually, it seems the upgrades have been run. See screenshot added to original post.
Comments.UserDisplayName: The Amateur
Tags: <error><payment-processor>
Title: How to fix DB Constraint Violation related to Payment Processor
ThreadText: # How to fix DB Constraint Violation related to Payment Processor
  
  (Asked by: username_0 on 2023-05-12)
  
  The setup is CiviCRM 5.61.2 on Drupal 7.97. Using Stripe for payment with the latest version of the extension.
  We are getting the following error whenever we try to do anything.
  [error] 
  $Fatal Error Details = array:3 [
    "message" => "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
    "code" => null
    "exception" => CRM_Core_Exception {#2244
      -errorData: array:8 [
        "error_code" => -19
        "sql" => ""
        "debug_info" => """
          SELECT a.id as `id`, a.domain_id as `domain_id`, a.name as `name`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.payment_processor_type_id as `payment_processor_type_id`, a.is_active as `is_active`, a.is_default as `is_default`, a.is_test as `is_test`, a.user_name as `user_name`, a.password as `password`, a.signature as `signature`, a.url_site as `url_site`, a.url_api as `url_api`, a.url_recur as `url_recur`, a.url_button as `url_button`, a.subject as `subject`, a.class_name as `class_name`, a.billing_mode as `billing_mode`, a.is_recur as `is_recur`, a.payment_type as `payment_type`, a.payment_instrument_id as `payment_instrument_id`, a.accepted_credit_cards as `accepted_credit_cards`\n
          FROM civicrm_payment_processor a\n
          WHERE (a.is_active = "1") AND (a.domain_id = "1")\n
          ORDER BY a.is_default DESC, a.name\n
           [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']
          """
        "entity" => "PaymentProcessor"
        "action" => "get"
        "is_error" => 1
        "error_message" => "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
        "debug_information" => ""
      ]
      #cause: null
      -_trace: null
      #message: "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
      #code: -19
      #file: "/home/mydomain/www/www/sites/all/modules/civicrm/api/api.php"
      #line: 135
      trace: {
        /home/mydomain/www/www/sites/all/modules/civicrm/api/api.php:135 {
          civicrm_api3(string $entity, string $action, array $params = [])
          › if (is_array($result) && !empty($result['is_error'])) {
          ›   throw new CRM_Core_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
          › }
        }
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:305 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:400 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:450 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Config.php:441 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php:455 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:319 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
        /home/mydomain/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
        /home/mydomain/www/www/includes/menu.inc:527 { …}
        /home/mydomain/www/www/index.php:21 { …}
      }
    }
  ]
  
  Another symptom is that we can't access contributions of individual member - just give a blank and we get a Network Error "Unable to reach the server. Please refresh this page in your browser and try again"
  Any help appreciated.
  Revision in response to whether upgrades have been run. Seems so.
  
  MORE INFORMATION
  When I go to edit the Payment Processor (see screenshot below), it won't save. Looking at the table civicrm_payment_processor, there does not appear to be a field for the Frontend Title in the form which is a required field.
  
  **Tags:** error, payment-processor
  
  > **Comments:**
  > **username_1**: It sounds like the [upgrades](https://github.com/civicrm/civicrm-core/blob/884ced9f0059f4ae613ca970af08ca85cee72523/CRM/Upgrade/Incremental/php/FiveSixtyOne.php#L60) didn't run. Have you run the upgrades for 5.61?  
  > **username_0**: I thought I had. Is there a way to run them again?  
  > **username_0**: Actually, it seems the upgrades have been run. See screenshot added to original post.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-05-12. Score: 2 | Accepted answer
  
  If you check the civi log from the date you ran the upgrade I expect something failed.
  
  This is risky sometimes but you can try:
  
  * Make a db backup.
  * In api explorer choose Domain.create, and set civi version. In this case to 5.60.0.
    + It will also ask for name but pick id instead and put 1.
  * Visit the upgrade screen and run updates.
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion. I don't know what api explorer is though. I'm not an expert at this stuff.  
  > **username_0**: If you could explain a bit more where/how to do this that would be great. Thanks.  
  > **username_1**: It's in the menu under Support - Developer - Api explorer v3. You choose Domain for the entity and create for the action. Then two rows of fields appear. Change the name one to id and put `1` in the box to the right. For the version one put `5.60.0`. Then click execute at the bottom. https://docs.civicrm.org/dev/en/latest/api/#api-explorer  
  > **username_0**: It worked! Thank you so much for all your help username_1!  
  
  ---
  
  ### Answer by username_2 on 2023-09-07. Score: 0
  
  I am just writing this here as I had a similar issue and this could be helpful to someone.
  
  This site is on Joomla. I could not even access the Civi component without a server error. So what was done - restore the civi backups /administrator/components/civicrm and components/civicrm and run the installation again and do the DB run script (cleared the templates\_c folder also each time).
  
  Also had this issue where the civi version was not properly getting updated so had to change it manually on civicrm\_domain
  
  
  ---
  
  