Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

Illegal group end indicator for Message #199

Open DaRealGunko opened 8 years ago

DaRealGunko commented 8 years ago
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);**
}
ChenLi0830 commented 8 years ago

+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
cbreezier commented 8 years ago

+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?

didix16 commented 8 years ago

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?

DaRealGunko commented 7 years ago

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

marvi14 commented 7 years ago

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

ChristopherLaytonWasTakenSoIWentWithT commented 7 years ago

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>
marvi14 commented 7 years ago

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

invisyi commented 7 years ago

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

ChristopherLaytonWasTakenSoIWentWithT commented 7 years ago

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

ChristopherLaytonWasTakenSoIWentWithT commented 7 years ago

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

phantomlsh commented 4 years ago

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