Answers.Body: <p>It looks like from your <a href="https://pastebin.com/6vV59YDM" rel="nofollow noreferrer">backtrace</a>, its a bug in GDPR extension because its not possible to replicate in CiviCRM. Your system has many custom group for activity, and the extension code breaks when trying to retrieve results, Mysql supports max 61 joins in a query. </p>
  
  <p>Possible solution:</p>
  
  <ol>
  <li><p>Disable custom group for activity which is not required.</p></li>
  <li><p>Restructure your custom group by moving custom fields into new/existing custom group and delete the ones not required. This is bit risky and will take lots of effort since UI may not allow you to move custom field if its defined for subtype. And if you have already used this field in webforms than probably you may need to retain the custom field ID.</p></li>
  <li><p>Apply the fix from <a href="https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr/pull/209" rel="nofollow noreferrer">here</a>. </p></li>
  </ol>
  
  <p>Thanks</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T11:26:36.763Z
Answers.Text: Yes agreed, we have 114/160+ custom sets for Activity. Option 1 is void since we need all of them, Option 2 sounds like danger of loosing data. We have turned off GDPR extension, but we need to have it enable ASAP as we have big event next week and we are expecting more than 20k volunteers applying for the position. Would it be a simple fix for the extension? Any pointers on how we can debug or fix the problem? Is there any other extension similar to GDPR?
Answers.UserDisplayName: FullStack-Dev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T11:59:24.647Z
Answers.Text: I have submitted a fix for this and have updated my answer to include the PR Link. Can you please  try if it fixes your problem?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T20:16:13.243Z
Answers.Text: Thank you so much pradeep, the fix worked for us. You are a life saver.
Answers.UserDisplayName: FullStack-Dev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T20:17:22.360Z
Answers.Text: cheers!!.......
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-18T11:10:35.213Z
Answers.LastActivityDate: 2019-08-18T11:58:00.613Z
Answers.LastEditDate: 2019-08-18T11:58:00.613Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Today our site started giving fatal error(DB Error: unknown error) screen when trying to view contact. Nothing recorded in php or apache log, but found below error in my CiviCRM logs</p>
  
  <pre><code>[nativecode=1116 ** Too many tables; MariaDB can only use 61 tables in a join]
  </code></pre>
  
  <p>Found a relevant issue/blog for this but none of them have provided any solutions. Is it a known issue in CiviCRM?</p>
  
  <p><a href="https://forum.civicrm.org/index.php%3Ftopic=34205.0.html" rel="nofollow noreferrer">https://forum.civicrm.org/index.php%3Ftopic=34205.0.html</a>
  <a href="https://issues.civicrm.org/jira/browse/CRM-21491" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-21491</a></p>
  
  <p>CiviCRM version: 5.15.2</p>
  
  <p>CMS - Drupal</p>
  
  <p>CiviCRM logging - OFF</p>
  
  <p>Backtrace : <a href="https://pastebin.com/6vV59YDM" rel="nofollow noreferrer">https://pastebin.com/6vV59YDM</a></p>
  
  <p>Any help or pointers would be appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-12T22:02:44.090Z
Comments.Text: I assume the CiviCRM logs has more context than this, like the backtrace.  Could you please post it?  Also list any extensions you're using?  I haven't seen this before personally
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-13T19:43:34.683Z
Comments.Text: I remember seeing this on a Drupal 6 site, related to the search perhaps (in my case, not necessarily for you). I'd try looking in your mysql logs for more details (and follow Jon's advice for seeing where in the code this sql is getting generated). Since it's coming up while looking at a contact, I'd guess you've got some CMS integration or extension that's generating so many table joins.
Comments.UserDisplayName: Alan Dixon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-18T11:02:09.340Z
Comments.Text: Updated my question to include backtrace link. I have renamed the table names in backtrace
Comments.UserDisplayName: FullStack-Dev
Tags: <contacts>
Title: Unable to view CiviCRM contacts anymore
ThreadText: # Unable to view CiviCRM contacts anymore
  
  (Asked by: username_0 on 2019-08-12)
  
  Today our site started giving fatal error(DB Error: unknown error) screen when trying to view contact. Nothing recorded in php or apache log, but found below error in my CiviCRM logs
  [nativecode=1116 ** Too many tables; MariaDB can only use 61 tables in a join]
  
  Found a relevant issue/blog for this but none of them have provided any solutions. Is it a known issue in CiviCRM?
  https://forum.civicrm.org/index.php%3Ftopic=34205.0.html
  https://issues.civicrm.org/jira/browse/CRM-21491
  CiviCRM version: 5.15.2
  CMS - Drupal
  CiviCRM logging - OFF
  Backtrace : https://pastebin.com/6vV59YDM
  Any help or pointers would be appreciated.
  
  **Tags:** contacts
  
  > **Comments:**
  > **username_1**: I assume the CiviCRM logs has more context than this, like the backtrace.  Could you please post it?  Also list any extensions you're using?  I haven't seen this before personally  
  > **username_2**: I remember seeing this on a Drupal 6 site, related to the search perhaps (in my case, not necessarily for you). I'd try looking in your mysql logs for more details (and follow Jon's advice for seeing where in the code this sql is getting generated). Since it's coming up while looking at a contact, I'd guess you've got some CMS integration or extension that's generating so many table joins.  
  > **username_0**: Updated my question to include backtrace link. I have renamed the table names in backtrace  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-08-18. Score: 2
  
  It looks like from your [backtrace](https://pastebin.com/6vV59YDM), its a bug in GDPR extension because its not possible to replicate in CiviCRM. Your system has many custom group for activity, and the extension code breaks when trying to retrieve results, Mysql supports max 61 joins in a query.
  
  Possible solution:
  
  1. Disable custom group for activity which is not required.
  2. Restructure your custom group by moving custom fields into new/existing custom group and delete the ones not required. This is bit risky and will take lots of effort since UI may not allow you to move custom field if its defined for subtype. And if you have already used this field in webforms than probably you may need to retain the custom field ID.
  3. Apply the fix from [here](https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr/pull/209).
  
  Thanks
  
  Pradeep
  
  > **Comments:**
  > **username_0**: Yes agreed, we have 114/160+ custom sets for Activity. Option 1 is void since we need all of them, Option 2 sounds like danger of loosing data. We have turned off GDPR extension, but we need to have it enable ASAP as we have big event next week and we are expecting more than 20k volunteers applying for the position. Would it be a simple fix for the extension? Any pointers on how we can debug or fix the problem? Is there any other extension similar to GDPR?  
  > **username_3**: I have submitted a fix for this and have updated my answer to include the PR Link. Can you please  try if it fixes your problem?  
  > **username_0**: Thank you so much pradeep, the fix worked for us. You are a life saver.  
  > **username_3**: cheers!!.......  
  
  ---
  
  