Need quick fix for > lineno":466, "message":"SyntaxError: syntax error", "source":"()

Ivaylo Panitchkov ipanitchkov at hibernum.com
Tue Mar 6 15:48:35 EST 2012


Hi Dan,

The simple solution I came up was to replace the M/R request (basically 
fetching 10-50 objects at a time) to a version that fetches objects one 
by one :-)
I haven't noticed performance degradation so that solution even not so 
elegant works for me (at least for the moment).
The problem was related to recently deleted objects that still exist in 
the cluster but with undefined content. If I perform M/R and at least 
one of the requested keys is in that state the M/R request just fails 
returning {lineno":466, "message":"SyntaxError: syntax error", "source":"()}
M/R requests to buckets where we don't perform delete operations work 
perfect.

We have had that problem for a while and rewrote and rewrote the 
function that should do the job.
We use node-js library to communicate with the cluster but for that 
specific task used (till today) the functions below as we thought the 
problem was with the library.

performMapReduceCURL = function(command, cb) {
     var exec = 'curl -X POST -d \'' + command + '\' -H "Content-Type: 
application/json" http://' + config.riakHosts[0].join(':') + '/mapred';
     require('child_process').exec(exec, cb);
};

function mapFunc(o, keyData, arg) {
     var data = Riak.mapValuesJson(o)[0];
     var result;
     if(undefined !== data && data.id) {
         result = [
             
{id:data.id,social_id:data.social_id,experience:data.experience,map:data.map,visited_users:data.visited_users}
         ];
     }
     else {
         result = [];
     }
     return result;
}

ids = ['key1', 'key2', 'key3', etc....];
ids.unshift('set_member');

var command = '{"inputs":{"bucket":\"' + config.CONCRETESBUCKET + 
'\","key_filters":[' + JSON.stringify(ids) + 
']},"query":[{"map":{"language":"javascript","source":"' + 
mapFunc.toString() + '", "keep":true}}], "timeout" : ' + 
config.listenHostTimeout + '}';
performMapReduceCURL(command, function(error, stdout, stderr) {

     // at this point if we have at least one key from ids that looks 
like 'tombstone'
     error = null
     stdout = lineno":466, "message":"SyntaxError: syntax error", 
"source":"()
}

For now everything is under control so thanks to everyone for the help,
Ivaylo



On 12-03-06 12:15 PM, Dan Reverri wrote:
> Hi Ivaylo,
>
> Can you provide an example of the MapReduce job you are running? Are 
> there any log messages on the server side which correspond to the 
> MapReduce error? What bug are you referring to?
>
> Thanks,
> Dan
>
> Daniel Reverri
> Developer Advocate
> Basho Technologies, Inc.
> dan at basho.com <mailto:dan at basho.com>
>
>
> On Tue, Mar 6, 2012 at 8:11 AM, Ivaylo Panitchkov 
> <ipanitchkov at hibernum.com <mailto:ipanitchkov at hibernum.com>> wrote:
>
>
>     Hello guys,
>
>     We are in production and noticed ALL of the M/R requests failing
>     right after a bulk delete with the following response returned back:
>
>     lineno":466,"message":"SyntaxError: syntax error","source":"()
>
>     The problem is now persistent even if the delete operation was
>     done awhile ago.
>     I googled to find a solution and realized this is a bug not fixed yet.
>     We have a cluster of 4 machines with riak (1.0.2 2011-11-17)
>     Debian x86_64 installed.
>     I need a quick fix ASAP if someone could help me out.
>
>     Thanks in advance,
>     Ivaylo
>
>     -- 
>     Ivaylo Panitchkov
>     Software developer
>     Hibernum Creations Inc.
>
>     Ce courriel est confidentiel et peut aussi être protégé par la
>     loi.Si vous avez reçu ce courriel par erreur, veuillez nous en
>     aviser immédiatement en y répondant, puis supprimer ce message de
>     votre système. Veuillez ne pas le copier, l’utiliser pour quelque
>     raison que ce soit ni divulguer son contenu à quiconque.
>     This email is confidential and may also be legally privileged. If
>     you have received this email in error, please notify us
>     immediately by reply email and then delete this message from your
>     system. Please do not copy it or use it for any purpose or
>     disclose its content.
>
>
>     _______________________________________________
>     riak-users mailing list
>     riak-users at lists.basho.com <mailto:riak-users at lists.basho.com>
>     http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Ivaylo Panitchkov
Software developer
Hibernum Creations Inc.

Ce courriel est confidentiel et peut aussi être protégé par la loi.Si vous avez reçu ce courriel par erreur, veuillez nous en aviser immédiatement en y répondant, puis supprimer ce message de votre système. Veuillez ne pas le copier, l’utiliser pour quelque raison que ce soit ni divulguer son contenu à quiconque.
This email is confidential and may also be legally privileged. If you have received this email in error, please notify us immediately by reply email and then delete this message from your system. Please do not copy it or use it for any purpose or disclose its content.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120306/ef80e90e/attachment.html>


More information about the riak-users mailing list