Answers.Body: <p>Sorry this is your first experience with CiviCRM! Usually it works fine but yes it's good to know how to recover from a crash. They are usually caused by installing a buggy or incompatible plugin or extension.</p>
  <p>The way to track down mysterious errors generally involves enabling the <code>debug</code> and <code>backtrace</code> settings in CiviCRM. You can do this in the UI by selecting <strong>Administer -&gt; System Settings -&gt; Debugging and Error Handling</strong> in the menubar.</p>
  <p>Or if CiviCRM is so broken that you can't use the UI, you can do it on the command line:</p>
  <pre><code>cd path/to/your/wp-content/plugins/civicrm/civicrm/
  cv setting:set debug=1
  cv setting:set backtrace=1
  </code></pre>
  <p><strong>Note:</strong> these settings should never be left on for a production site!</p>
  <p>Then when you see the error again it will have much more detail, and the backtrace will generally lead back to a specific plugin or extension that's causing the problem.</p>
  <p>Once you find the culprit you can disable it (or even if you don't, a good guess would be to disable the last extension you installed):</p>
  <pre><code>cd path/to/your/wp-content/plugins/civicrm/civicrm/
  cv dis name_of_extension
  cv ext:uninstall name_of_extension
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-24T02:30:10.463Z
Answers.LastActivityDate: 2023-08-24T02:30:10.463Z
Answers.UserDisplayName: Coleman
Body: <p>We're testing CiviCRM to determine if it's fit for our purpose. Tests were going well until we hit an unexplained snag for which we can't find a definitive fix. The error is as follows ..</p>
  <p><strong>Fatal error: Uncaught CRM_Core_Exception: [unauthorized: Authorization failed thrown in /home/account/site/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php on line 232</strong></p>
  <p>We're running version 5.64.1 in WordPress. The host is a cPanel host using PHP 8.0.</p>
  <p>I can't seem to find a clear answer on how to fix this. Can anyone advise on what to do to overcome this, please?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-22T04:34:20.393Z
Comments.Text: Hi Kerry. Welcome. Can you confirm if either https://civicrm.stackexchange.com/questions/41835/api4-php-fatal-error-uncaught-api-exception-authorization-failed or https://civicrm.stackexchange.com/questions/45154/constant-authorization-failed-error-crashing-wordpress are related to your issue
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-22T12:23:01.550Z
Comments.Text: Yes welcome. Can you please give more context? On which page does this error occur? When taking what action? When logged in as what type of user?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T00:47:18.397Z
Comments.Text: Hi guys. Apologies. I had not received a notification of any replies to my question, so I'm glad I logged in to check if there had been. In answer to you both but especially @Coleman, the context is that this is a vanilla WordPress installation being used for testing to determine if CiviCRM is fit for our purpose as a charity.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T00:47:24.303Z
Comments.Text: @petednz .. we aren't doing any coding or custom development work, so neither of the links you pointed to appear to be relevant. As to which pages this is occurring on; the answer is .. every single one.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T00:47:43.317Z
Comments.Text: We have only two things of note plugged in to WordPress: BookingsPress and Civi (including many of its extensions and a number of Civi-related plugins available for the WordPress plugin GUI). Being a test site, there's no reason we couldn't blow it away and start again, but this behaviour raises a serious concern about the stability and reliability of Civi as a solution for our needs. We simply can't have a situation where a largely unanswered error could derail our operations for days, if not entirely.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T00:47:51.097Z
Comments.Text: If I can find a way to understand this and overcome it, it will go a long way to me being able to support it for our organisation, but as it stands, I'm at a complete loss after spending days trying multiple ways to try and overcome this problem.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T02:30:54.587Z
Comments.Text: I've posted some general information in an answer, but feel free to reach out to me on `chat.civicrm.org` for more help with your specific situation.
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-24T03:20:20.550Z
Comments.Text: Thanks so much, @Coleman. I'll need to arrange Shell access to our cPanel account through our provider in order to action your recommendations. Once I have that sorted, I'll let you know the outcome.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-25T03:53:22.513Z
Comments.Text: @Coleman. Unfortunately, this site is on a shared cPanel server and I have no root access. I've had Shell enabled, but the cv command is "not found" even after installing it according to Civi's instructions.
Comments.UserDisplayName: Kerry Denten
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-25T10:34:56.037Z
Comments.Text: Maybe you were not able to add a `cv` shortcut to your shell, but you should still be able to execute it without the shortcut using the full path e.g. `full/path/to/cv setting:set debug=1` (just remember to call this command from within your `civicrm` directory).
Comments.UserDisplayName: Coleman
Tags: <wordpress><api><core>
Title: I have the dreaded "[unauthorized: Authorization failed" error on a WordPress dev site
ThreadText: # I have the dreaded "[unauthorized: Authorization failed" error on a WordPress dev site
  
  (Asked by: username_0 on 2023-08-22)
  
  We're testing CiviCRM to determine if it's fit for our purpose. Tests were going well until we hit an unexplained snag for which we can't find a definitive fix. The error is as follows ..
  
  **Fatal error: Uncaught CRM\_Core\_Exception: [unauthorized: Authorization failed thrown in /home/account/site/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php on line 232**
  
  We're running version 5.64.1 in WordPress. The host is a cPanel host using PHP 8.0.
  
  I can't seem to find a clear answer on how to fix this. Can anyone advise on what to do to overcome this, please?
  
  **Tags:** wordpress, api, core
  
  > **Comments:**
  > **username_1**: Hi Kerry. Welcome. Can you confirm if either https://civicrm.stackexchange.com/questions/41835/api4-php-fatal-error-uncaught-api-exception-authorization-failed or https://civicrm.stackexchange.com/questions/45154/constant-authorization-failed-error-crashing-wordpress are related to your issue  
  > **username_2**: Yes welcome. Can you please give more context? On which page does this error occur? When taking what action? When logged in as what type of user?  
  > **username_0**: Hi guys. Apologies. I had not received a notification of any replies to my question, so I'm glad I logged in to check if there had been. In answer to you both but especially @username_2, the context is that this is a vanilla WordPress installation being used for testing to determine if CiviCRM is fit for our purpose as a charity.  
  > **username_0**: @petednz .. we aren't doing any coding or custom development work, so neither of the links you pointed to appear to be relevant. As to which pages this is occurring on; the answer is .. every single one.  
  > **username_0**: We have only two things of note plugged in to WordPress: BookingsPress and Civi (including many of its extensions and a number of Civi-related plugins available for the WordPress plugin GUI). Being a test site, there's no reason we couldn't blow it away and start again, but this behaviour raises a serious concern about the stability and reliability of Civi as a solution for our needs. We simply can't have a situation where a largely unanswered error could derail our operations for days, if not entirely.  
  > **username_0**: If I can find a way to understand this and overcome it, it will go a long way to me being able to support it for our organisation, but as it stands, I'm at a complete loss after spending days trying multiple ways to try and overcome this problem.  
  > **username_2**: I've posted some general information in an answer, but feel free to reach out to me on `chat.civicrm.org` for more help with your specific situation.  
  > **username_0**: Thanks so much, @username_2. I'll need to arrange Shell access to our cPanel account through our provider in order to action your recommendations. Once I have that sorted, I'll let you know the outcome.  
  > **username_0**: @username_2. Unfortunately, this site is on a shared cPanel server and I have no root access. I've had Shell enabled, but the cv command is "not found" even after installing it according to Civi's instructions.  
  > **username_2**: Maybe you were not able to add a `cv` shortcut to your shell, but you should still be able to execute it without the shortcut using the full path e.g. `full/path/to/cv setting:set debug=1` (just remember to call this command from within your `civicrm` directory).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-08-24. Score: 0
  
  Sorry this is your first experience with CiviCRM! Usually it works fine but yes it's good to know how to recover from a crash. They are usually caused by installing a buggy or incompatible plugin or extension.
  The way to track down mysterious errors generally involves enabling the debug and backtrace settings in CiviCRM. You can do this in the UI by selecting Administer -> System Settings -> Debugging and Error Handling in the menubar.
  Or if CiviCRM is so broken that you can't use the UI, you can do it on the command line:
  cd path/to/your/wp-content/plugins/civicrm/civicrm/
  cv setting:set debug=1
  cv setting:set backtrace=1
  
  Note: these settings should never be left on for a production site!
  Then when you see the error again it will have much more detail, and the backtrace will generally lead back to a specific plugin or extension that's causing the problem.
  Once you find the culprit you can disable it (or even if you don't, a good guess would be to disable the last extension you installed):
  cd path/to/your/wp-content/plugins/civicrm/civicrm/
  cv dis name_of_extension
  cv ext:uninstall name_of_extension
  
  
  ---
  
  