Could not connect to memcached (example.net:11211)

Seems like something people might run in to, so I figured I’d share it here.
Recently the daily.sh update script started throwing errors. I didn’t change anything, but still this error was showing:

/opt/librenms$ sudo ./validate.php

====================================

Component Version
LibreNMS 1.33-164-gcf58d1583
DB Schema 217
PHP 7.1.8-1ubuntu1
MySQL 10.1.25-MariaDB-1
RRDTool 1.6.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Database connection successful
[OK] Database schema correct

./daily.sh
Checking PHP version                               OK
Updating to latest codebase                        OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     FAIL
Could not connect to memcached (example.net:11211)
Clearing OS cache
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Fetching notifications                             FAIL
Could not connect to memcached (example.net:11211)
Caching PeeringDB data                             OK

Even though I didn’t have example.net anywhere in the config.php. Memcached service was running:

sudo netstat -tap | grep memcached:
tcp        0      0 localhost:11211         0.0.0.0:*               LISTEN      1294/memcached

I am monitoring a server outside my network through distributed polling. It seems that the lines missing from the config.php in regards to the host for memcached in this situation didn’t matter before, but matters now. Adding these lines to the config.php fixed it:

$config['distributed_poller_memcached_host'] = 'localhost';
$config['distributed_poller_memcached_port'] = '11211';

Hopes this helps someone having the same issue I had.

1 Like

Hi Guys,

Was this solved in any thread please ?
I’m hitting the exact same issue.

Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB FAIL
Could not connect to memcached (example.net:11211)
Clearing OS cache
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Could not connect to memcached (example.net:11211)
Fetching notifications FAIL
Could not connect to memcached (example.net:11211)
Caching PeeringDB data FAIL
Could not connect to memcached (example.net:11211)

Hello All,

I had the same issue. In my case this was solved it by editing this file /opt/librenms/misc/config_definitions.json
I changed the default to the LibreNMS URL and the IP address to LibreNMS IP under “value”

“distributed_poller_memcached_host”: {
“default”: “example.net”,
“group”: “poller”,
“section”: “distributed”,
“order”: 1,
“type”: “text”,
“validate”: {
“value”: “x.x.x.x”

And also make sure that the memcached service is running before doing anything, and always backup before any changes.