Pokemon-GO-node-api icon indicating copy to clipboard operation
Pokemon-GO-node-api copied to clipboard

Illegal group end indicator for Message

Open DaRealGunko opened this issue 9 years ago • 11 comments

Error: Illegal group end indicator for Message .ResponseEnvelop: 7 (not a group)
    at Error (native)
    at ProtoBuf.Reflect.MessagePrototype.decode (/var/lib/openshift/579e17862d5271cfe7000234/app-root/runtime/repo/node_modules/protobufjs/dist/protobuf.js:3205:31)
    at Function.Message.decode (/var/lib/openshift/579e17862d5271cfe7000234/app-root/runtime/repo/node_modules/protobufjs/dist/protobuf.js:2933:37)
    at Request._callback (poke.io.js:137:33)
    at Request.self.callback (/var/lib/openshift/579e17862d5271cfe7000234/app-root/runtime/repo/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/var/lib/openshift/579e17862d5271cfe7000234/app-root/runtime/repo/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)

HERE:

if (e.decoded) {
   // Truncated
   console.warn(e);
    f_ret = e.decoded; // Decoded message with missing required fields
}
 else{
   **console.log(e);**                        
}

so the code in is permanent loop here :

if (f_ret) {
   return callback(null, f_ret);
 } else {
    **console.log('**************** NEW api_req ****************');
   api_req(api_endpoint, access_token, req, callback);**
}

DaRealGunko avatar Aug 04 '16 06:08 DaRealGunko

+1 The API works fine when running on mac locally. But when I try to run it on AWS lambda, I had that exact same error.

I added two console.logs in the poke.io.js file, and it seems "ResponseEnvelop.decode(body)" didn't work.

    var f_ret;
    try {
      f_ret = ResponseEnvelop.decode(body);            
    } catch (e) {
        console.log("e", e); // <----------------------------
        console.log("e.decoded", e.decoded);  // <----------------------------
      if (e.decoded) {
        // Truncated
        console.log("caught error", e); 
        console.warn(e);
        f_ret = e.decoded; // Decoded message with missing required fields
      }
    }

Logs:

e:  [Error: Illegal group end indicator for Message .ResponseEnvelop: 7 (not a group)]
e.decoded : undefined

ChenLi0830 avatar Aug 12 '16 00:08 ChenLi0830

+1 exact same error - also slightly concerned about the lack of retry limit

Very interesting note about AWS lambda - I'm having this error when I have it hosted on a Vultr instance (hosting service)

Possibly Niantic is blocking any requests from known hosting services to reduce load and make it harder for people to mass bot?

cbreezier avatar Aug 12 '16 00:08 cbreezier

I'm experimenting the same issue and I'm not usi g AWS, just my raspberry at local.. Any ideas of how to solve It?

didix16 avatar Aug 14 '16 20:08 didix16

I was using https://www.openshift.com/

DaRealGunko avatar Aug 26 '16 09:08 DaRealGunko

Same problem here. Someone could deal with it? I'm hosting in Heroku

marvi14 avatar Aug 27 '16 19:08 marvi14

Dumped the response body when hosting on DigitalOcean, looks like we're getting 403'd.

<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.11.1</center>
</body>
</html>

@ChristopherLayton I end up deploying it in Digital Ocean, in a MeanStack application that they have. It worked like a charm :)

marvi14 avatar Sep 08 '16 12:09 marvi14

@ChristopherLayton, It doesn't work for me in Digital Ocean with MeanStack application, what is your node version ? thanks

invisyi avatar Sep 08 '16 14:09 invisyi

@marvi14 Giving it a shot, I'll report my findings!

@marvi14 Tried with a MEANStack image located in NY, same forbidden response. Which region did you select?

+1 but run from my laptop (no concern of IP banning)

phantomlsh avatar Jan 26 '20 17:01 phantomlsh