Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR Protocol error: expected '$', got ' ' #1358

Closed
Flawd opened this issue Jul 26, 2016 · 4 comments
Closed

ERR Protocol error: expected '$', got ' ' #1358

Flawd opened this issue Jul 26, 2016 · 4 comments

Comments

@Flawd
Copy link

Flawd commented Jul 26, 2016

Getting this error. Why? How fix? I simply execute the code one time, second time, all works fine, third time (just an example) it gives this error. after that the connection is broken.

This is line 38: connection.getJedis().hset(key, field, object.toString());
object is i.e. an integer

thread "pool-4-thread-1" 
[17:05:57] [pool-4-thread-1/WARN]: redis.clients.jedis.exceptions.JedisDataException: ERR Protocol error: expected '$', got ' '
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Protocol.processError(Protocol.java:117)
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Protocol.process(Protocol.java:151)
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Protocol.read(Protocol.java:205)
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)
[17:05:57] [pool-4-thread-1/WARN]:  at redis.clients.jedis.Jedis.hset(Jedis.java:606)
[17:05:57] [pool-4-thread-1/WARN]:  at me.FlawlezZ.FlawlordBasedSan.redis.JedisManager.hset(JedisManager.java:38)
[17:05:57] [pool-4-thread-1/WARN]:  at me.FlawlezZ.FlawlordChaRPGSan.data.Characters$JedisCharacter.read(Characters.java:43)
[17:05:57] [pool-4-thread-1/WARN]:  at me.FlawlezZ.FlawlordChaRPGSan.data.mongo.MongoCharacter.readCharacter(MongoCharacter.java:34)
[17:05:57] [pool-4-thread-1/WARN]:  at me.FlawlezZ.FlawlordChaRPGSan.data.mongo.MongoCharacter.lambda$loadCharacter$0(MongoCharacter.java:43)
[17:05:57] [pool-4-thread-1/WARN]:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:05:57] [pool-4-thread-1/WARN]:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:05:57] [pool-4-thread-1/WARN]:  at java.lang.Thread.run(Thread.java:745)
[17:05:57] [pool-4-thread-2/WARN]: Exception in thread "pool-4-thread-2" 
[17:05:57] [pool-4-thread-2/WARN]: redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:198)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.jedis.Protocol.process(Protocol.java:141)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.jedis.Protocol.read(Protocol.java:205)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)
[17:05:57] [pool-4-thread-2/WARN]:  at redis.clients.jedis.Jedis.hset(Jedis.java:606)
[17:05:57] [pool-4-thread-2/WARN]:  at me.FlawlezZ.FlawlordBasedSan.redis.JedisManager.hset(JedisManager.java:38)
[17:05:57] [pool-4-thread-2/WARN]:  at me.FlawlezZ.FlawlordBasedSan.mongo.MongoPlayer.readPlayer(MongoPlayer.java:44)
[17:05:57] [pool-4-thread-2/WARN]:  at me.FlawlezZ.FlawlordBasedSan.mongo.MongoPlayer.lambda$loadPlayer$0(MongoPlayer.java:36)
[17:05:57] [pool-4-thread-2/WARN]:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:05:57] [pool-4-thread-2/WARN]:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:05:57] [pool-4-thread-2/WARN]:  at java.lang.Thread.run(Thread.java:745)
@xetorthio
Copy link
Contributor

Are you sharing a Jedis instance through different threads or something
like that?

On Tue, Jul 26, 2016 at 12:11 PM Flawd notifications@github.com wrote:

Getting this error. Why? How fix? I simply execute the code one time,
second time, all works fine, third time (just an example) it gives this
error. after that the connection is broken.

This is line 38: connection.getJedis().hset(key, field, object.toString());
object is i.e. an integer

thread "pool-4-thread-1"
[17:05:57] [pool-4-thread-1/WARN]: redis.clients.jedis.exceptions.JedisDataException: ERR Protocol error: expected '$', got ' '
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Protocol.processError(Protocol.java:117)
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Protocol.process(Protocol.java:151)
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Protocol.read(Protocol.java:205)
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)
[17:05:57] [pool-4-thread-1/WARN]: at redis.clients.jedis.Jedis.hset(Jedis.java:606)
[17:05:57] [pool-4-thread-1/WARN]: at me.FlawlezZ.FlawlordBasedSan.redis.JedisManager.hset(JedisManager.java:38)
[17:05:57] [pool-4-thread-1/WARN]: at me.FlawlezZ.FlawlordChaRPGSan.data.Characters$JedisCharacter.read(Characters.java:43)
[17:05:57] [pool-4-thread-1/WARN]: at me.FlawlezZ.FlawlordChaRPGSan.data.mongo.MongoCharacter.readCharacter(MongoCharacter.java:34)
[17:05:57] [pool-4-thread-1/WARN]: at me.FlawlezZ.FlawlordChaRPGSan.data.mongo.MongoCharacter.lambda$loadCharacter$0(MongoCharacter.java:43)
[17:05:57] [pool-4-thread-1/WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:05:57] [pool-4-thread-1/WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:05:57] [pool-4-thread-1/WARN]: at java.lang.Thread.run(Thread.java:745)
[17:05:57] [pool-4-thread-2/WARN]: Exception in thread "pool-4-thread-2"
[17:05:57] [pool-4-thread-2/WARN]: redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:198)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.jedis.Protocol.process(Protocol.java:141)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.jedis.Protocol.read(Protocol.java:205)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)
[17:05:57] [pool-4-thread-2/WARN]: at redis.clients.jedis.Jedis.hset(Jedis.java:606)
[17:05:57] [pool-4-thread-2/WARN]: at me.FlawlezZ.FlawlordBasedSan.redis.JedisManager.hset(JedisManager.java:38)
[17:05:57] [pool-4-thread-2/WARN]: at me.FlawlezZ.FlawlordBasedSan.mongo.MongoPlayer.readPlayer(MongoPlayer.java:44)
[17:05:57] [pool-4-thread-2/WARN]: at me.FlawlezZ.FlawlordBasedSan.mongo.MongoPlayer.lambda$loadPlayer$0(MongoPlayer.java:36)
[17:05:57] [pool-4-thread-2/WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[17:05:57] [pool-4-thread-2/WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[17:05:57] [pool-4-thread-2/WARN]: at java.lang.Thread.run(Thread.java:745)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1358, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAIhpyjwNjoz-mr85GHnbZU1NQbHzp-xks5qZiOxgaJpZM4JVQMe
.

@Flawd
Copy link
Author

Flawd commented Jul 26, 2016

bless you you lead me the right way
thank you
you are very generous

i didnt read the manual, only a bad tutorial

the actual error resulted from me chaining an async jedis void into another async void. after that I encountered another error: [B can not be cast to java.lang.Long error, because I always used the same Jedis j = pool.getResource();

...

@Flawd Flawd closed this as completed Jul 26, 2016
@marcosnils
Copy link
Contributor

👍

@sthenusan
Copy link

how to fix this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants