tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

SETHOOK: Problem with arguments: ERR invalid argument

Open robmir44 opened this issue 7 years ago • 4 comments

Hello,

I have created via an Interface a new customer command:

@Command("SETHOOK ?0 ?1 NEARBY ?2 FENCE POINT ?3 ?4")
List<Object> setHookIntersect(String webHook, String addr, String key, double Lon, double Lat);

Then i try to call it, see the example below, but I get each time an exception (see below): List<Object> xyz = commands.setHookIntersect("myHook", "http://127.0.0.1:1001", "fleet", 89.050032, 32.102624);

Exception in thread "main" io.lettuce.core.RedisCommandExecutionException: ERR invalid argument '89.050032'
	at io.lettuce.core.LettuceFutures.awaitAll(LettuceFutures.java:85)
	at io.lettuce.core.LettuceFutures.awaitAll(LettuceFutures.java:46)
	at io.lettuce.core.dynamic.AsyncExecutableCommand.dispatchCommand(AsyncExecutableCommand.java:81)
	at io.lettuce.core.dynamic.AsyncExecutableCommand.execute(AsyncExecutableCommand.java:53)
	at io.lettuce.core.dynamic.RedisCommandFactory$CommandFactoryExecutorMethodInterceptor.invoke(RedisCommandFactory.java:227)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:117)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$PooledMethodInvocation.proceed(MethodInterceptorChain.java:194)
	at io.lettuce.core.dynamic.intercept.DefaultMethodInvokingInterceptor.invoke(DefaultMethodInvokingInterceptor.java:45)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:117)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain.invoke(MethodInterceptorChain.java:79)
	at io.lettuce.core.dynamic.intercept.InvocationProxyFactory$InterceptorChainInvocationHandler.handleInvocation(InvocationProxyFactory.java:101)
	at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)

Could anybody tell me what is the Problem? thanks

FYI: I use Java: lettuce as client

robmir44 avatar Jul 05 '18 10:07 robmir44

Hi @robmir44,

It looks like you are missing a param. It should be something like:

SETHOOK myHook http://127.0.0.1:1001 NEARBY fleet FENCE POINT  89.050032 32.102624 5000

Where the 5000 represents the radius in meters around the point.

tidwall avatar Jul 06 '18 19:07 tidwall

Hello, Thanks for the answer. Now it is working, but what did i do?

  1. I changed from Java to python
redis_client = redis.StrictRedis(host, port, db)
data = redis_client.execute_command('custom redis command')
  1. My mistake was to use the docker-container and then I called the server (docker-container) with the localhost address (127.0.0.1), I mean with the call: SETHOOK(xxxx).

robmir44 avatar Jul 07 '18 06:07 robmir44

My problem is similar but with OBJECT or HAST SETHOOK myHook http://127.0.0.1:1001 NEARBY fleet FENCE HAST xxxxxx

ERR invalid argument 'HAST'

hmunoz avatar Sep 29 '20 16:09 hmunoz

@hmunoz do you mean HASH? HAST is not a valid keyword.

tidwall avatar Sep 29 '20 17:09 tidwall