Answers.Body: <p>I had the same issue.  CiviCRM 4.7/Drupal 7/IIS8 configuration.  The Ajax call was generating a query longer than what the web server was configured to handle and behind the scenes the web server was throwing an error, but it is not logged to the Civicrm log nor the Drupal log.</p>
  
  <p>I was able to solve this by increasing the query string length in IIS.  </p>
  
  <ul>
  <li>In IIS Manager select the site</li>
  <li>Choose the Request filtering icon</li>
  <li>Navigate to the query string tab </li>
  <li>Click the edit feature settings</li>
  <li>Change the Maximum query string (Bytes) from 2048 to 4096 or something larger</li>
  </ul>
  
  <p>Contact Relationships now show properly.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-01T13:57:39.267Z
Answers.LastActivityDate: 2017-04-01T13:57:39.267Z
Answers.UserDisplayName: Jim Bennett
Answers.Body: <p>I am seeing this on 4.6.14 .  This is due to modsec thinking it is a SQL attack.   I saw a popup indicating datatables saw an error and to look here:<a href="https://datatables.net/manual/tech-notes/7" rel="nofollow">https://datatables.net/manual/tech-notes/7</a></p>
  
  <p>Console showed these errors:</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 403 (Forbidden)
    <a href="https://www.xxxxxx.com/civicrm/ajax/contactrelationships?context=past&amp;cid=10" rel="nofollow">https://www.xxxxxx.com/civicrm/ajax/contactrelationships?context=past&amp;cid=10</a>…_9=false&amp;mDataProp_10=10&amp;bSortable_10=false&amp;iSortingCols=0&amp;_=1462288897639 Failed to load resource: the server responded with a status of 403 (Forbidden)</p>
  </blockquote>
  
  <p>When I disabled the modsec rule it worked without error.  here is the rule:
  SecRule ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_NAMES|XML:/<em>|!ARGS:/body/|!ARGS:/content/|!ARGS:/description/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!ARGS:text_message|!REQUEST_COOKIES:/__utm/|!REQUEST_COOKIES:/_pk_ref/|!ARGS:sql_query "@rx [[]\"',().]{10}$|(?:union\s+all\s+select\s+(?:(?:null|\d+),?)+|order\s+by\s+\d{1,4}|(?:and|or)\s+\d{4}=\d{4}|waitfor\s+delay\s+'\d+:\d+:\d+'|(?:select|and|or)\s+(?:(?:pg_)?sleep(\d+)|\d+\s</em>=\s*(?:dbms_pipe.receive_message((?:chr(\d+)(?:\s*\|\|\s*)?)<em>,\d+)|(select\s+\d+\s+from\s+pg_sleep(\d+)))))(?:\s</em>(?:and|or)\s+(?(?:(\d{4})=\1|'(\w{4})'='\2|'%'=')|--\s*\w*|#)$|(select\s*(case\s+when\s*(\d+\s*=\s*\d+)\s+then\s+\d+\s+else\s+(?:0x[\0-9a-h]+|\d+)\s+end))|(?:(?:and|or)\s+(?'?(?:\w{1,4}|%)'?)?(?:=|&lt;|>)(?'?\w{0,4}'?)?|order\s+by\s+\d+)(?:#|--\s*\w{0,4})?$" \
      "id:1,rev:5,msg:'COMODO WAF: SQLmap attack detected',phase:2,severity:2,capture,block,setvar:'tx.sqli_points=+%{tx.points_limit4}',setvar:'tx.points=+%{tx.points_limit4}',logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',ctl:'auditLogParts=+E',t:'none',t:'urlDecodeUni',t:'lowercase'"</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-03T15:49:27.157Z
Answers.Text: Also see this discussion: https://www.datatables.net/forums/discussion/26368/problems-with-modsecurity
Answers.UserDisplayName: Sonicthoughts
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-03T15:47:02.473Z
Answers.LastActivityDate: 2016-05-03T15:47:02.473Z
Answers.UserDisplayName: Sonicthoughts
Answers.Body: <p>I have tested the above issue against WP 4.6.1 and CiviCRM 4.7.11.   I am running Apache 2.4, php 5.6 and MySQL 5.6.   The OS is CentOS 6.</p>
  
  <p>I cannot reproduce this error nor the one mentioned <a href="https://civicrm.stackexchange.com/questions/14442/ajax-error-when-viewing-contact-groups/">AJAX error when viewing contact groups</a></p>
  
  <p>I commented in <a href="https://issues.civicrm.org/jira/browse/CRM-19331" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-19331</a> about this as well.</p>
  
  <p>I would suspect the issue here is due to either a plugin conflict or something specific to the Hosting Configuration. I am interested if these issues are specific to a host or a specific configuration.</p>
  
  <p>I'd disable all plugins (except CiviCRM) and see if you can trace errors in you apache and php logs.  I would also revert to a default theme (CiviCRM demo sites are tested with TwentyThirteen) I'd also look at the CiviCRM logs. The CiviCRM logins should be in the <code>/civicrm/ConfigAndLog</code> directory that is stored in the WP upload directory in 4.7</p>
  
  <p>I'd be interested if these issues are specific to a host or a specific configuration.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-12T00:59:40.990Z
Answers.LastActivityDate: 2016-09-12T00:59:40.990Z
Answers.LastEditDate: 2017-04-13T12:53:13.167Z
Answers.UserDisplayName: Kevin Cristiano
Answers.Body: <p>I had a very similar issue. It turned out to be a limitation of the web-server on the maximum number of characters in the GET request. It was set to 2048 characters, whereas the request was bigger than 2200 characters. Increasing the limitation on the webserver solved my issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T13:03:42.090Z
Answers.LastActivityDate: 2016-10-24T13:03:42.090Z
Answers.UserDisplayName: DirkV
Answers.Body: <p>This sounds like a bug you could probably report the bug the issue tracker: <a href="http://issues.civicrm.org" rel="nofollow">http://issues.civicrm.org</a></p>
  
  <p>As 4.7 is verly new it might contains a few bugs.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-09T19:34:39.067Z
Answers.LastActivityDate: 2016-02-09T19:34:39.067Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>Civicrm 4.7.1
  Joomla 3.4.8</p>
  
  <p>I'm unable to view data in the relationships tab. I get the following errors:</p>
  
  <p>"DataTables warning: table id=DataTables_Table_0 - Ajax error."</p>
  
  <p>And </p>
  
  <p>"DataTables warning: table id=DataTables_Table_1 - Ajax error."</p>
  
  <p>This issue has been ongoing since updating to 4.7.0</p>
  
  <p>Any help would be appreciated. Please let me know if you need additional information.</p>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-09T19:19:43.033Z
Comments.Text: Here is the error that appears in the browser console: 
  GET http://domainname.com/?option=com_civicrm&task…art=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1455045491224 404 (Not Found)  jquery.js:9664.
Comments.UserDisplayName: trvrtwr
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-16T14:41:24.010Z
Comments.Text: I am also seeing this under 4.7.10 using Joomla under IIS - it is a 404 error. The setup is just a local development system. I don't have Modsec installed. The organisation I work for has installations under Apache/Linux, where we don't see the error. I have tried in vain to discover where in the code the error occurs in order to debug it. I even tried a clean Joomla/CiviCRM installation and saw the same problem. The console has: HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier).
  (XHR)GET - https://jupiter/joomla/administrator/?opti
Comments.UserDisplayName: Stephen Palmstrom
Tags: <relationships><database><error><ajax>
Title: Ajax Error when trying to view relationships tab
ThreadText: # Ajax Error when trying to view relationships tab
  
  (Asked by: username_0 on 2016-02-09)
  
  Civicrm 4.7.1
  Joomla 3.4.8
  
  I'm unable to view data in the relationships tab. I get the following errors:
  
  "DataTables warning: table id=DataTables\_Table\_0 - Ajax error."
  
  And
  
  "DataTables warning: table id=DataTables\_Table\_1 - Ajax error."
  
  This issue has been ongoing since updating to 4.7.0
  
  Any help would be appreciated. Please let me know if you need additional information.
  
  Thanks.
  
  **Tags:** relationships, database, error, ajax
  
  > **Comments:**
  > **username_0**: Here is the error that appears in the browser console:  GET http://domainname.com/?option=com_civicrm&task…art=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1455045491224 404 (Not Found)  jquery.js:9664.  
  > **username_1**: I am also seeing this under 4.7.10 using Joomla under IIS - it is a 404 error. The setup is just a local development system. I don't have Modsec installed. The organisation I work for has installations under Apache/Linux, where we don't see the error. I have tried in vain to discover where in the code the error occurs in order to debug it. I even tried a clean Joomla/CiviCRM installation and saw the same problem. The console has: HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier). (XHR)GET - https://jupiter/joomla/administrator/?opti  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_2 on 2017-04-01. Score: 3
  
  I had the same issue. CiviCRM 4.7/Drupal 7/IIS8 configuration. The Ajax call was generating a query longer than what the web server was configured to handle and behind the scenes the web server was throwing an error, but it is not logged to the Civicrm log nor the Drupal log.
  
  I was able to solve this by increasing the query string length in IIS.
  
  * In IIS Manager select the site
  * Choose the Request filtering icon
  * Navigate to the query string tab
  * Click the edit feature settings
  * Change the Maximum query string (Bytes) from 2048 to 4096 or something larger
  
  Contact Relationships now show properly.
  
  
  ---
  
  ### Answer by username_3 on 2016-05-03. Score: 2
  
  I am seeing this on 4.6.14 . This is due to modsec thinking it is a SQL attack. I saw a popup indicating datatables saw an error and to look here:<https://datatables.net/manual/tech-notes/7>
  
  Console showed these errors:
  
  > Failed to load resource: the server responded with a status of 403 (Forbidden)
  > <https://www.xxxxxx.com/civicrm/ajax/contactrelationships?context=past&cid=10>…\_9=false&mDataProp\_10=10&bSortable\_10=false&iSortingCols=0&\_=1462288897639 Failed to load resource: the server responded with a status of 403 (Forbidden)
  
  When I disabled the modsec rule it worked without error. here is the rule:
  SecRule ARGS|ARGS\_NAMES|REQUEST\_COOKIES|REQUEST\_COOKIES\_NAMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:/description/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!ARGS:text\_message|!REQUEST\_COOKIES:/\_\_utm/|!REQUEST\_COOKIES:/\_pk\_ref/|!ARGS:sql\_query "@rx [[]\"',().]{10}$|(?:union\s+all\s+select\s+(?:(?:null|\d+),?)+|order\s+by\s+\d{1,4}|(?:and|or)\s+\d{4}=\d{4}|waitfor\s+delay\s+'\d+:\d+:\d+'|(?:select|and|or)\s+(?:(?:pg\_)?sleep(\d+)|\d+\s*=\s\*(?:dbms\_pipe.receive\_message((?:chr(\d+)(?:\s\*\|\|\s\*)?)*,\d+)|(select\s+\d+\s+from\s+pg\_sleep(\d+)))))(?:\s*(?:and|or)\s+(?(?:(\d{4})=\1|'(\w{4})'='\2|'%'=')|--\s\*\w\*|#)$|(select\s\*(case\s+when\s\*(\d+\s\*=\s\*\d+)\s+then\s+\d+\s+else\s+(?:0x[\0-9a-h]+|\d+)\s+end))|(?:(?:and|or)\s+(?'?(?:\w{1,4}|%)'?)?(?:=|<|>)(?'?\w{0,4}'?)?|order\s+by\s+\d+)(?:#|--\s\*\w{0,4})?$" \
  "id:1,rev:5,msg:'COMODO WAF: SQLmap attack detected',phase:2,severity:2,capture,block,setvar:'tx.sqli\_points=+%{tx.points\_limit4}',setvar:'tx.points=+%{tx.points\_limit4}',logdata:'Matched Data: %{TX.0} found within %{MATCHED\_VAR\_NAME}: %{MATCHED\_VAR}',ctl:'auditLogParts=+E',t:'none',t:'urlDecodeUni',t:'lowercase'"
  
  > **Comments:**
  > **username_3**: Also see this discussion: https://www.datatables.net/forums/discussion/26368/problems-with-modsecurity  
  
  ---
  
  ### Answer by username_4 on 2016-09-12. Score: 1
  
  I have tested the above issue against WP 4.6.1 and CiviCRM 4.7.11. I am running Apache 2.4, php 5.6 and MySQL 5.6. The OS is CentOS 6.
  
  I cannot reproduce this error nor the one mentioned [AJAX error when viewing contact groups](https://civicrm.stackexchange.com/questions/14442/ajax-error-when-viewing-contact-groups/)
  
  I commented in <https://issues.civicrm.org/jira/browse/CRM-19331> about this as well.
  
  I would suspect the issue here is due to either a plugin conflict or something specific to the Hosting Configuration. I am interested if these issues are specific to a host or a specific configuration.
  
  I'd disable all plugins (except CiviCRM) and see if you can trace errors in you apache and php logs. I would also revert to a default theme (CiviCRM demo sites are tested with TwentyThirteen) I'd also look at the CiviCRM logs. The CiviCRM logins should be in the `/civicrm/ConfigAndLog` directory that is stored in the WP upload directory in 4.7
  
  I'd be interested if these issues are specific to a host or a specific configuration.
  
  
  ---
  
  ### Answer by username_5 on 2016-10-24. Score: 1
  
  I had a very similar issue. It turned out to be a limitation of the web-server on the maximum number of characters in the GET request. It was set to 2048 characters, whereas the request was bigger than 2200 characters. Increasing the limitation on the webserver solved my issue.
  
  
  ---
  
  ### Answer by username_6 on 2016-02-09. Score: 1
  
  This sounds like a bug you could probably report the bug the issue tracker: <http://issues.civicrm.org>
  
  As 4.7 is verly new it might contains a few bugs.
  
  
  ---
  
  