Timeout Exception trying to connect to Memcached server on AppHarbor

2.2k views Asked by At

I've been using the Enyim Memcached Client for .Net, trying to connect to a server running on AppHarbor. The relevant parts of my configuration file look like this:

  <enyim.com>
    <log factory="Enyim.Caching.DiagnosticsLogFactory, Enyim.Caching" />
    <memcached protocol="Binary">
      <servers>
        <add address="8d593f28-37d7-4c4f-a702-aa7687a85ea1.memcacher.com" port="11211" />
      </servers>
      <authentication
          type="Enyim.Caching.Memcached.PlainTextAuthenticator, Enyim.Caching"
          userName="changed to post on stack overflow"
          password="changed to post on stack overflow"
          zone="AUTHZ"
              />
      </memcached>
    </enyim.com>

My connection keeps timing out. Any ideas whats going on here? Here are the logs from Enyim client:

2012-01-21 18:56:08 [ERROR] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - Could not init pool. - System.TimeoutException: Could not connect to 50.19.210.46:11211 at Enyim.Caching.Memcached.PooledSocket.ConnectWithTimeout(Socket socket, IPEndPoint endpoint, Int32 timeout) at Enyim.Caching.Memcached.PooledSocket..ctor(IPEndPoint endpoint, TimeSpan connectionTimeout, TimeSpan receiveTimeout) at Enyim.Caching.Memcached.MemcachedNode.CreateSocket() at Enyim.Caching.Memcached.Protocol.Binary.BinaryNode.CreateSocket() at Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl.CreateSocket() at Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl.InitPool() 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - Mark as dead was requested for 50.19.210.46:11211 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - FailurePolicy.ShouldFail(): True 2012-01-21 18:56:08 [WARN] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - Marking node 50.19.210.46:11211 as dead 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.DefaultServerPool - Node 50.19.210.46:11211 is dead. 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.DefaultServerPool - Starting the recovery timer. 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.DefaultServerPool - Timer started. 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - Acquiring stream from pool. 50.19.210.46:11211 2012-01-21 18:56:08 [DEBUG] 7 Enyim.Caching.Memcached.MemcachedNode.InternalPoolImpl - Pool is dead or disposed, returning null. 50.19.210.46:11211

UPDATE:

Turns out the reason I can't connect to the memcached server is because it's only accessible from appharbor's environment. So for anyone else that runs across this, you need to use a local memcached service when developing locally, then simply change the credentials when deploying (which apphaorbor actually does automatically for you). Problem resolved.

1

There are 1 answers

0
friism On BEST ANSWER

AppHarbor Memcacher buckets are only accessible from AppHarbor application servers. The documentation has been amended to clearly reflect this.

You should use a locally installed memcached server for testing.