Flexible App Engine (Node.js) not able to access memcached?

504 views
Skip to first unread message

Alejandro Recarey

unread,
Apr 21, 2016, 5:48:35 AM4/21/16
to Google App Engine
Hi all,

I have started using App Engine and am super happy with the docs and examples. Kudos!

However, I'm stumbling upon an issue with trying to use the memcache service. I don't even know if it should work for the flexible environment. I'm using the environment variables:
MEMCACHE_PORT_11211_TCP_ADDR

and:
MEMCACHE_PORT_11211_TCP_PORT

, and by logging I'm seeing that they are actually being set in production, so I assume I should have access. 

Howeve once in production I'm seeing this error:

Error: Server at 172.17.0.3:11211 not available

So they are being set (my defaults are "localhost" and "11211"), it just seems I don't have access.

Should the flexible App Engine environment have access to the Memcached pool? Or do I have to spin up my own servers?

Thanks!

Alex


Evan Jones

unread,
Apr 21, 2016, 1:29:25 PM4/21/16
to Google App Engine
I'm just a user, but I think you should have access. When I SSH to my flexible environment machine, I've run the following command to check that this works:

$ printf "get mykey\r\n" |nc -v 172.17.0.3 11211
172.17.0.3: inverse host lookup failed: Unknown host
(UNKNOWN) [172.17.0.3] 11211 (?) open
END

(the END) part is the reply back from the server saying the key is not found.

I ran the same command inside the docker container with my application and it also works. So .... I think the value you are getting should work?

(I'm pretty sure memcache is working with our Python app, but that uses the python-compat APIs, so I'm not 100% sure if that connects to the same address/port or not).

Nicholas (Google Cloud Support)

unread,
Apr 21, 2016, 1:38:48 PM4/21/16
to Google App Engine
As per this Caching Application Data article, the flexible environment provides a standard memcached service. It enables access by setting the environment variables you've mentioned.

I was able to set and get values from memcache by following the guide on the provided link. It was not necessary to spin up my own servers. Judging from the error, I presume you've already installed the memcached client library with npm install --save memcached.
  • Do you have any standard environment runtime that can successfully access memcache?
  • Do you get the same error if you redeploy this Nodejs module?
  • If so, do you also get the same address and port from the env variables?
  • Does the error occur with new Memcached() or when attempting to get/set?

On Thursday, April 21, 2016 at 5:48:35 AM UTC-4, Alejandro Recarey wrote:

Bill Murphy

unread,
Apr 22, 2016, 10:57:36 AM4/22/16
to Google App Engine
We are experiencing the same issue, it seems it is not consistent, some requests work, others just fail..

Bill Murphy

unread,
Apr 22, 2016, 11:02:32 AM4/22/16
to Google App Engine

Adam (Cloud Platform Support)

unread,
Apr 24, 2016, 3:38:40 PM4/24/16
to Google App Engine
Yes, this is a known issue. Feel free to star the relevant issue tracker here for updates:

Nicholas (Google Cloud Support)

unread,
Apr 25, 2016, 11:08:30 AM4/25/16
to Google App Engine
Thank you to all posters for the information. As per Bill Prin's comment on the StackOverflow post linked by Bill Murphy:
The fix for this has been merged and should be in the next release.
 
Please 'star' to stay updated about public Issue 12843 mentioned by Adam. The current workaround recommended by Bill is to store data in a database like the datastore until this is fixed.

@Alejandro, were you in fact attempting to store values greater than 4070 bytes in size? If not or were otherwise getting a different error, could you provide a code sample that can reproduce said error?


On Thursday, April 21, 2016 at 5:48:35 AM UTC-4, Alejandro Recarey wrote:
Reply all
Reply to author
Forward
0 new messages