Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Mongo throwing norepl exception.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cody Halovich  
View profile  
 More options Oct 5 2012, 11:44 am
From: Cody Halovich <c...@telenova.ca>
Date: Fri, 5 Oct 2012 08:44:24 -0700 (PDT)
Local: Fri, Oct 5 2012 11:44 am
Subject: Mongo throwing norepl exception.

Hey guys, Im running the following bit of code, I'm getting exceptions
thrown from mongo that say "norepl", and that's it. You'll notice I'm using
my own class for dealing with the MongoPHP driver, this is insignificant,
the methods just run the query and return the result, nothing special in
between.

 18                 if($userId) {
 19
 20                 $criteria = array('fbid'=>$userId);
 21                 $checkLoc = $db->select('users',$criteria);
 22                 foreach($checkLoc as $user);
 23
 24
 25                 foreach($_POST as $key=>$value) {
 26                         $values[$key] = $value;
 27                 }
 28
 29                 $newupdate = array('$set' => array(
 30                         'address' => $values['profile-address-value'],
 31                         'age' => $values['profile-age-value'],
 32                         'business_name' =>
$values['profile-business-value'],
 33                         'capacity' => $values['profile-capacity-value'],
 34                         'comments' => $values['profile-comments-value'],
 35                         'drive' => $values['profile-driving-value'],
 36                         'exp' => $values['profile-years-value'],
 37                         'firstaid' => $values['profile-firstaid-value'],
 38                         'pets' => $values['profile-pets-value'],
 39                         'smoking' => $values['profile-smoking-value'],
 40                         'type' => $values['profile-type-value'],
 41                         'vacancy' => $values['profile-vacancy-value']));
 42
 43
 44                 // UPDATE USER INFO
 45                 try {
 46                         $db->update('users', $criteria, $newupdate);
 47                 } catch (Exception $e) {
 48                         $error[] = 'failed to update user info:
'.$e->getMessage();
 49                         $success = 500;
 50                 } // THIS IS THROWING THE NOREPL EXCEPTION
 51
 52
 53                 // IF LOCATION HAS CHANGED
 54                 if($user['address'] != $_POST['profile-address-value'])
{
 55
 56                         $update2 = array();
 57
 58                         // GEOCODE ADDRESS TO GET LATLNG
 59                         $uri =
'https://maps.googleapis.com/maps/api/geocode/json?address=' .
urlencode($_POST['profile-address-value']) . '&sensor=false';
 60                         $newLoc = json_decode(file_get_contents($uri));
 61
 62                         // ASSIGN OBJECTS TO VARIABLES
 63                         $lat =
$newLoc->results[0]->geometry->location->lat;
 64                         $lng =
$newLoc->results[0]->geometry->location->lng;
 65
 66                         $update2['$set']['loc.0'] = $lat;
 67                         $update2['$set']['loc.1'] = $lng;
 68
 69                         // UPDATE LATLNG
 70                         try {
 71                                 $db->update('users', $criteria,
$update2);
 72                         } catch (Exception $e) {
 73                                 $success = 500;
 74                                 $error[] = 'failed to update location.
'.$e->getMessage();
 75                         }  // THIS IS ALSO THROWING THE NOREPL EXCEPTION
 76                 }
 77
 78
 79         }

This has been driving me crazy for weeks, I would very much appreciate some
help solving this issue, I have to get this working.

Thank you in advance for your time and brainpower.

Cheers,

Cody


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Oct 9 2012, 10:13 am
From: Kristina Chodorow <krist...@10gen.com>
Date: Tue, 9 Oct 2012 07:13:08 -0700 (PDT)
Local: Tues, Oct 9 2012 10:13 am
Subject: Re: Mongo throwing norepl exception.

This error happens when you try to use the w option without replication
enabled.  For example, if you were using a single server and
did $db->update('users', $criteria, array("w" => 2)).  w might be set on
the database, collection, or individual write.

On the plus side, the write is still being written, Mongo is just unable to
check that it's being written to multiple servers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »