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

Error "110: Connection timed out" while connecting to Memcached on host #6

Open
tchwpkgorg opened this issue Feb 9, 2015 · 17 comments

Comments

@tchwpkgorg
Copy link

I'm not able to use phpMemAdmin.

It errors with:

PHP Fatal error: Uncaught exception 'Clickalicious\Memcached\Exception' with message 'Error "110: Connection timed out" while connecting to Memcached on host: 10.91.0.114:11211 (UUID: 48cd7fb075b3f332993a1542744836a8c5ce1f4c)' in /usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php:908\nStack trace:\n#0 /usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php(954): Clickalicious\Memcached\Client->connect('10.91.0.114', '11211')\n#1 /usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php(1480): Clickalicious\Memcached\Client->send('stats', 'stats??')\n#2 /usr/local/share/phpmemadmin/lib/Clickalicious/PhpMemAdmin/App.php(2120): Clickalicious\Memcached\Client->stats()\n#3 /usr/local/share/phpmemadmin/lib/Clickalicious/PhpMemAdmin/App.php(1303): Clickalicious\PhpMemAdmin\App->aggregateStatistics(Array)\n#4 /usr/local/share/phpmemadmin/lib/Clickalicious/PhpMemAdmin/App.php(1133): Clickalicious\Ph in /usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php on line 908

However, 10.91.0.114:11211 is not refusing connections - anything else except phpMemAdmin is able to connect just fine.

$ telnet 10.91.0.114 11211
Trying 10.91.0.114...
Connected to 10.91.0.114.
Escape character is '^]'.
stats
STAT pid 1718
STAT uptime 2786223
STAT time 1423496877
STAT version 1.4.13
STAT libevent 2.0.16-stable
STAT pointer_size 64
STAT rusage_user 157.696000
(...)

Also, tcpdump shows that phpMemAdmin is connecting to memcache, immediately disconnecting, and reporting bogus 'Error "110: Connection timed out".

@tchwpkgorg
Copy link
Author

Trying to debug it - is seems it's capable of connecting to localhost, but not to external hosts.

I've used this SSH tunnel to verify it (and changed the host from 10.91.0.114 to 127.0.0.1 in the localhost):

ssh -N -L 11211:10.91.0.114:11211 127.0.0.1 -v

@tchwpkgorg
Copy link
Author

But then, still rendering fatal errors for some requests, i.e.:

[Mon Feb 09 15:54:42.432670 2015] [:error] [pid 27337] [client 106.188.9.189:37893] PHP Fatal error: Uncaught exception 'Clickalicious\Memcached\Exception' with message 'Awaited "VALUE" but
received ""' in /usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php:1803\nStack trace:\n#0 /usr/local/share/phpmemadmin/vendor/clickalicious
/memcached.php/lib/Clickalicious/Memcached/Client.php(2164): Clickalicious\Memcached\Client->parseReadResponse('VALUE TD\Models...', Array)\n#1 /usr/local/share/phpmemadmin/vendor/clickalic
ious/memcached.php/lib/Clickalicious/Memcached/Client.php(993): Clickalicious\Memcached\Client->parseResponse('gets', 'VALUE TD\Models...')\n#2 /usr/local/share/phpmemadmin/vendor/clickalic
ious/memcached.php/lib/Clickalicious/Memcached/Client.php(1408): Clickalicious\Memcached\Client->send('gets', 'gets TD\Models...')\n#3 /usr/local/share/phpmemadmin/lib/Clickalicious/PhpMe
mAdmin/App.php(2286): Clickalicious\Memcached\Client->gets(Array, true)\n#4 /usr/local/share/phpmemadmin/lib/Clickalicious/PhpMemAdmin/App.php(1715): Clickalicious\PhpMemAdmin\App->dum in
/usr/local/share/phpmemadmin/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php on line 1803, referer: https://server:444/phpmemadmin/index.php?actio
n=2&host=127.0.0.1:11211

when going to "Data".

@benjamin-carl
Copy link
Collaborator

There are some issues combined i think. I need to check the connection behavior. Currently no clue why it wouldn't connect to another host as localhost. But I will check.

What kind of data do you try to read - can you provide key/value of one recordset as gist or something like that please?

Can you please provide some more environment information:

  • version of memcached (is it the one of your telnet STAT response?)
  • which client was used to write those data Memcached or Memcache Extension?)
  • PHP version
  • OS

Thank you.

@tchwpkgorg
Copy link
Author

When connecting to remote host with phpmemadmin - I don't try to read any data; just going to phpmemadmin interface gives a blank page (and this error).

When connecting to "localhost" - just going to "Data" in the menu results in a blank page (and an error on the server side). Nothing is displayed.

  • memcached 1.4.13-0ubuntu2.1
  • data was written using php5-memcache
  • php 5.5.9
  • Ubuntu 14.04 64 bit

@benjamin-carl
Copy link
Collaborator

There was a bug in the client library used by phpMemAdmin.

I've updated this library - Memcached.php - just a few seconds ago. Try to update phpMemAdmin's composer dependencies (Memcached.php) - make sure to use >= v0.3.2

composer update

should do the trick.

Please let me know if the bug is fixed for you too.

@tchwpkgorg
Copy link
Author

It still crashes for me immediately with "connection timed out" when trying to connect to an external server (just when trying to connect to https://server/phpmemadmin).

@tchwpkgorg
Copy link
Author

Going to "Data" (action=4) - it does not crash immediately anymore. It gets some packets exchanged with memcached, then it stalls. Does not display anything on "Data".

@seyfer
Copy link

seyfer commented Feb 13, 2015

The same error for me
Connects fast on localhost, but error on remote
And there is no timeout settings..

@seyfer
Copy link

seyfer commented Feb 13, 2015

Just fix it!

nano /var/www/nesudba2.razlet.ru/vendor/clickalicious/memcached.php/lib/Clickalicious/Memcached/Client.php

and set const DEFAULT_TIMEOUT = 10

@benjamin-carl
Copy link
Collaborator

@seyfer @tchwpkgorg This really seems to fix the issue and of course - this makes a lot of sense. Never tested with a remote instance.

Thank you for your contribution. It updated Memcached.php to v0.4.0 which supports runtime configuration of timeout and i also currently working on a fresh phpMemAdmin release to support configurable timeout value to be able to connect to remote instances.

@benjamin-carl
Copy link
Collaborator

So guys have a look @ phpMemAdmin v0.3.0 which now requires Memcached.php 0.4.0
Both Libraries where updated this night so the timeout behavior issue was addressed and not it is configurable (.config / .config.dist).

And btw i cleaned the code, added documentation and refactored some parts.

Can you confirm that timeout config will work for you?

@tchwpkgorg
Copy link
Author

Hi,

thanks for your help.

"Cluster" and "Host" menu options work now for remote hosts.

If I press on "Data" - still no output (just hangs "forever loading").

@benjamin-carl
Copy link
Collaborator

I will try to simulate some situations with random types of data written by Memcached (PECL) extension and Memcache (PECL) extension so I'm able to handle this correctly and write tests for this cases.

The only thing I need for this is some time :)

@seyfer
Copy link

seyfer commented Aug 18, 2015

Data still not work

@equinoxmatt
Copy link

I am also receiving the same problem. Cannot load data management tab.

@sverdier
Copy link

Data still not work

@kmajzlik
Copy link

I am on same issue.
It looks like a problem GETS vs GET and maybe some parsing then.

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

6 participants