Open ecmendenhall opened 11 years ago
SASL is only supported by Memcached's binary protocol:
In order to enable SASL support in the server you must use the -S flag.
The -S flag does a few things things:
Enable all of the SASL commands.
Require binary protocol only.
Require authentication to have been successful before commands may be issued on a connection.
There is no way to add SASL into text protocol in a backwards-compatible way.
I don't have access to the server. I'm just connecting to it with a username and password, using client/bin-connection
. Is that not the binary protocol?
It should use binary protocol. I can't immediately say what may cause text protocol to be used, Spyglass uses Spymemcached's binary connection factory which should set everything up for us.
I have a theory about what may be going but don't have a SASL-enabled memcached instance to test against. Can you email me credentials I can use? It will only be necessary for a couple of days.
Please try 1.1.0-SNAPSHOT
, if my hypothesis is correct, bin-connection
should be using the binary protocol now.
I'll check it out. Just sent you an email if you want to test it yourself.
Looks like this particular exception is gone but I cannot yet get the test suite to pass using binary protocol with SASL.
Debugging a local copy of Memcached built with SASL and plain text password DB support suggests binary connections now work fine, however, authentication still fails.
Got the below, is I call select all after delete a id
2013-08-14 23:54:05.257 WARN net.spy.memcached.transcoders.SerializingTranscoder: Caught CNFE decoding 2768 bytes of data java.lang.ClassNotFoundException: app.controllers.continent$delete$fn__5568 at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at net.spy.memcached.transcoders.BaseSerializingTranscoder.deserialize(BaseSerializingTranscoder.java:129) at net.spy.memcached.transcoders.SerializingTranscoder.decode(SerializingTranscoder.java:88) at net.spy.memcached.transcoders.TranscodeService$1.call(TranscodeService.java:63) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at net.spy.memcached.transcoders.TranscodeService$Task.run(TranscodeService.java:110) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
@janus
java.lang.ClassNotFoundException: app.controllers.continent$delete$fn__5568
has nothing to do with Spyglass or Memcached. Also, if you have an issue, file a new one or ask on the mailing list instead of leaving comments to existing ones.
Was this ever resolved? I'm getting:
2015-04-10 22:20:34.664 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@9ee1b7
2015-04-10 22:20:34.666 ERROR net.spy.memcached.protocol.binary.NoopOperationImpl: Error: Auth failure.
2015-04-10 22:20:34.666 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Discarding partially completed op: Cmd: 10 Opaque: 31
2015-04-10 22:20:34.666 INFO net.spy.memcached.MemcachedConnection: Reconnection due to exception handling a memcached operation on {QA sa=pub-memcache-18892.us-east-1-3.4.ec2.garantiadata.com/54.87.212.91:18892, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=8}. This may be due to an authentication failure.
OperationException: SERVER: Auth failure.
at net.spy.memcached.protocol.BaseOperationImpl.handleError(BaseOperationImpl.java:164)
at net.spy.memcached.protocol.binary.OperationImpl.finishedPayload(OperationImpl.java:176)
at net.spy.memcached.protocol.binary.OperationImpl.readFromBuffer(OperationImpl.java:162)
at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:521)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:414)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:894)
... on Heroku using Memcached Cloud.
@kendagriff not to my knowledge. In addition we found out that older SpyMemcached versions don't have this issue. Testing Memcached with authentication locally has been a major pain for us. Feel free to investigate it.
Excellent, Michael. That led to at least a workable answer. In case anyone else needs it, I set up project.clj
exactly as described here:
http://blog.clojurewerkz.org/blog/2013/08/22/spyglass-1-dot-1-0-is-released/
Cheers to everyone at Clojurewerkz! Developing a web app with Monger and Spyglass was an absolute joy, and I'm glad you're out there abstracting ConnectionFactoryBuilders for people like me.
I'm still running into an SASL error connecting a Heroku app to a remote Memcached server. The client still seems to be using the ASCII protocol, even when I use
clojurewerkz.spyglass.client/bin-connection
. I saw that there was an authentication fix in the latest beta, so I grabbed the new code and replacedbin-connection
and all its dependencies in my project, but it throws the same exception:java.lang.UnsupportedOperationException: SASL is not supported for ASCII protocol
.I solved this issue by using the example in this blog post to set up my client and pass it to spyglass, but I'm not a Java dev and have no idea what I'm doing when I have to deal with interop stuff.
Here's my code:
And here's the whole error (server address redacted):