CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • 4.5: "Network Error - Unable to reach the server."
Pages: [1] 2

Author Topic: 4.5: "Network Error - Unable to reach the server."  (Read 8550 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
4.5: "Network Error - Unable to reach the server."
October 07, 2014, 01:25:16 am
I'm working with a 4.5 install.

Everything seems to be going well - I'm in process of setting up some membership types and importing membership records - then all of a sudden I get an error message:  "Network Error - Unable to reach the server. Please refresh this page in your browser and try again."

Invariably this is happening when a modal pop-up opens, but doesn't then get populated. I'm wondering whether there is a particularly short time-out set for some of these? I'm working on a satellite connection with a long latency.

I can generally work around the issue by selecting my option to open in a new browser tab or window, in which case the pop-up seems not to be used, and I can get on.

However, for me at least, this is a particularly irritating problem. wonder if others are seeing it also?
Graham Mitchell
http://mc3.coop

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
October 07, 2014, 08:10:14 am
Does the popup in question ever work? Or is the problem intermittent?
Timeout seems unlikely to me because in my test environment I sometimes set a debug breakpoint and pause the ajax for several minutes, and when I resume it, the browser happily loads the stalled popup.
BUT it seems like your network settings might have something to do with it. See http://stackoverflow.com/questions/2507355/jquery-ajax-call-default-timeout-value
Try asking your question on the new CiviCRM help site.

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: 4.5: "Network Error - Unable to reach the server."
October 07, 2014, 08:27:14 am
It does seem to be intermittent, but I'll need to do more testing to be sure.

what is surprising is that the pages and pop-ups seem to be loading fine, and then suddenly things halt and I get one of these errors, but there isn't a long wait for the error to display - it is pretty quick. Which suggests to me that it isn't down to a lack of connectivity or low bandwidth, but rather something else which is triggering the error.

For example, if I'm on a screen and click an 'edit' link that should generate a pop-up, and that pop-up gives me an error, I can very quickly control-click on the edit link and bring up the edit page in a new tab, and that loads fine.

All in all it feels fishy. I'll keep a close eye on things and see if I can learn more, and if so I'll report back here.
Graham Mitchell
http://mc3.coop

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
October 07, 2014, 08:33:17 am
If I had to guess, I'd say it's something in the response from the server that is causing invalid JSON, probably a php error or warning. You can test this theory by checking your browser's console and inspecting the response. If the response doesn't start with { and end with } then there is something wrong with it which would cause parseJSON to crash in the browser and issue the error.
These guys had the same problem and it was due to some extra content their custom code was injecting:  http://forum.civicrm.org/index.php?topic=34377
Try asking your question on the new CiviCRM help site.

dchaffin

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.37
  • PHP version: 5.3.29
Re: 4.5: "Network Error - Unable to reach the server."
October 13, 2014, 05:23:13 pm
I'm having the same error. The tabs I'm having trouble with return View Pages and were working fine under 4.4. Here is the code that calls one of the tabs:

$url = CRM_Utils_System::url('civicrm-tab/user/mcle-submissions/'.$contactID, "reset=1&snippet=1&force=1&cid=$contactID");
$tabs[] = array(
  'id' => 'mcle',
  'url' => $url,
  'title' => 'MCLE',
  'weight' => 29,
);

If I load that view, it loads fine. If I right-click on the tab and open in new tab, it loads fine. When I simply click on the tab, I get the network error.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
October 13, 2014, 06:48:07 pm
@dchaffin - CiviCRM 4.5 uses a new form of ajax where the page content is encoded as json rather than sent as a raw html snippet. I have no idea what "View Pages" you are referring to - is this a custom module or extension? If so it needs to be updated to work with our new ajax (normally there is nothing to update but obviously your view is not working - perhaps there is something hackish going on in the code that needs to be fixed - I would start by searching your code for the strings "exit" or "die" or possibly "snippet" to see if there are hacks that are short-circuiting our page controller with an early exit.
Try asking your question on the new CiviCRM help site.

dchaffin

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.37
  • PHP version: 5.3.29
Re: 4.5: "Network Error - Unable to reach the server."
October 14, 2014, 07:09:19 am
Thanks, Coleman. When these tabs were created, an example was followed wherein a Drupal View was created with a Page display and the address of that page display was fed to the tab. The URL in my post:

$url = CRM_Utils_System::url('civicrm-tab/user/mcle-submissions/'.$contactID, "reset=1&snippet=1&force=1&cid=$contactID");

... leads to that View Page. The code I included ($tabs[] = array ...) is the only thing that existed to load the View as is into the tab.

But what you are saying is that is no longer possible, correct? If so, do you know of an example/guide for developing tabs with custom data or can you point me in the direction of what the JSON it is looking for would look like?

Thanks!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
October 14, 2014, 11:00:54 am
Ah very interesting. Out of curiosity, what did you do to suppress the full themed drupal page (headers, menus, etc) from displaying in the tab?
At any rate you are correct a raw html snippet is no longer what CIvi's tab interface is expecting. What it expects is a json object with at least a "content" key, with the html string as the value. It is documented here: http://wiki.civicrm.org/confluence/display/CRMDOC/Ajax+Pages+and+Forms#AjaxPagesandForms-Server-Side.1

3 solutions come to mind:

1) https://www.drupal.org/project/views_datasource might be able to output in the format you need.

2) You could create a very simple menu callback that is 3 lines long, it would look something like:
Code: [Select]
function mysite_view_snippet($viewName, $cid) {
  civicrm_initialize();
  $content = views_embed_view($viewName, $cid);
  CRM_Core_Page_AJAX::returnJsonResponse($content);
}

3) You could help out the community by creating a PR for the CiviCRM views integration code that adds a new type of display, "CiviCRM snippet" which automatically outputs content as json.
Try asking your question on the new CiviCRM help site.

mjpforsberg

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.40
Re: 4.5: "Network Error - Unable to reach the server."
November 12, 2014, 02:36:11 am
Quote from: Upperholme on October 07, 2014, 01:25:16 am

However, for me at least, this is a particularly irritating problem. wonder if others are seeing it also?


Yes - we are seeing it from time to time on only one of our computers - trying to edit any membership records. Restarting, etc., does not help (but not an issue with the account itself as it works fine from other computers). This is the log message we get

$IDS Detector Details = Array (
  • => Array ( [name] => json [value] => {"name":"maxwell","field_name":"","table_name":"cc"} [page] => /civicrm/ajax/rest?entity=contact&action=getquick&json=%7B%22name%22%3A%22maxwell%22%2C%22field_name%22%3A%22%22%2C%22table_name%22%3A%22cc%22%7D [userid] => 42323 [session] => 8070e246d7xxxxxxd6a28765ac [ip] => 216.xx.xx.xx [reaction] => 2 [impact] => 53 ) [1] => Array ( [name] => IDS_request_uri [value] => /civicrm/ajax/rest?entity=contact&action=getquick&json=%7B%22name%22%3A%22maxwell%22%2C%22field_name%22%3A%22%22%2C%22table_name%22%3A%22cc%22%7D [page] => /civicrm/ajax/rest?entity=contact&action=getquick&json=%7B%22name%22%3A%22maxwell%22%2C%22field_name%22%3A%22%22%2C%22table_name%22%3A%22cc%22%7D [userid] => 42323 [session] => 8070e246d7xxxxxxd6a28765ac [ip] => 216.xx.xx.xx [reaction] => 2 [impact] => 53 ) )


Not that easy to recreate, so I'm not sure if there's any point in filing as a bug.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
November 12, 2014, 05:56:02 pm
I recommend giving your trusted users "skip IDS check" permission.
Try asking your question on the new CiviCRM help site.

mjpforsberg

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.40
Re: 4.5: "Network Error - Unable to reach the server."
November 12, 2014, 10:34:34 pm
Thanks - saw now that that staff role did not have that permission enabled!

nicol

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 5
  • CiviCRM version: 4.2, 4.3, 4.4
  • CMS version: Joomla 2.5.x, Joomla 3.x Wordpress 3.x, Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3 / 5.4
Re: 4.5: "Network Error - Unable to reach the server."
November 19, 2014, 02:00:59 pm
Just to say I was having this same error message with Civi 4.5.2 but since upgrading to 4.5.4 it has gone.

Edit: please ignore - 12 hours later and it's back just as before.
« Last Edit: November 20, 2014, 01:24:37 am by nicol »

flo81

  • I’m new here
  • *
  • Posts: 21
  • Karma: 1
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.40
  • PHP version: 5.4
Re: 4.5: "Network Error - Unable to reach the server."
November 28, 2014, 04:20:29 am
Hello,

I have the same problem on a fresh Drupal (7.34)+Civi(4.5.4) installation. On my local installation it's working fine, but I moved all on a remote server (which I don't manage), and this precise problem occurs all the time when trying to open a modal window.

Any help / leads woud be very appreciated !

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: 4.5: "Network Error - Unable to reach the server."
November 28, 2014, 11:22:02 am
@flo81 I really can't help you if you do not post the error message you see in your browser console.
Try asking your question on the new CiviCRM help site.

groston

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34
  • PHP version: 5.3.27
Re: 4.5: "Network Error - Unable to reach the server."
January 22, 2015, 02:58:15 pm
All,

Our site is experiencing the same problem. (Drupal 7.34, CiviCRM 4.5.5)

I have created several classes of somewhat-privileged users, and prior to 4.5.x, neither had any problems. Since the upgrade, both have experienced the "Network Error - Unable to reach the server. Please refresh this page in your browser and try again." error.

In the first case, the error is experienced after searching for a user via find contacts and selecting the 'send an email' link. Oddly, when the record is selected and 'send an email' is selected from the action drop down, the error does not occur.

In the second case, the error is experienced when pulling up a member's record and selecting more->renew link. Again, there is a similar work around.

The other oddity is that when I try to recreate this problem using my non-administrator account, I do not get the error message. This is both puzzling and frustrating (as it makes it impossible for me to figure out the problem on my own).

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • 4.5: "Network Error - Unable to reach the server."

This forum was archived on 2017-11-26.