arjunmehta / node-georedis

Super fast geo queries.
MIT License
192 stars 33 forks source link

Redis: unsupported command "COMMAND" #7

Closed nidhhoggr closed 8 years ago

nidhhoggr commented 8 years ago

I keep getting the redis errors on my server as a result on the initialization of this library. Here is the problem area of the code:

                client.send_command('command', nativeCommands, function(err, response) {

                    if (!err) {
                        if (Array.isArray(response) && Array.isArray(response[0]) && response[0][0] === 'geoadd') {
                            set.clientInterface = new NativeInterface(client);
                        }
                    }
                });

Is there another command to send instead of command? to determine whether of not to use native or emulated, perhaps maybe INFO instead of COMMAND? I am trying to troubleshoot an issue with twemproxy and its hard to do so with all of the errors "unsupported command 'COMMAND'" in the error logs

nidhhoggr commented 8 years ago

After further research this appears to be a twemproxy issue. it turns outs that both COMMAND and INFO are unsupported. My only recommendation would be to provide the ability to specify as an option a native check command.

Supported twemproxy commands listed here https://github.com/twitter/twemproxy/blob/master/notes/redis.md

arjunmehta commented 8 years ago

@zmijevik Thanks for this.

Can you tell me more about the error and where/when/how it happens? Can you tell if it is returning an error in the callback at https://github.com/arjunmehta/node-georedis/blob/master/main.js#L161 ?

arjunmehta commented 8 years ago

You know you can of course skip the test by forcing the module to use either native geo commands or not:

var geo = require('georedis').initialize(client, {
  nativeGeo: false
})
nidhhoggr commented 8 years ago

That should do the trick. Closing the issue. Thanks.