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

Could not establish Memcached connection. #3054

Closed
ArtisanTinkerer opened this issue Sep 14, 2021 · 3 comments
Closed

Could not establish Memcached connection. #3054

ArtisanTinkerer opened this issue Sep 14, 2021 · 3 comments

Comments

@ArtisanTinkerer
Copy link

Description:

using PHP7 and in the browser I am getting: Could not establish Memcached connection.

If I look in the Memcached container:

dc exec memcached bash

memcache@484baa22c6c1:/$ service memcached status
memcached: unrecognized service
memcache@484baa22c6c1:/$ 

Expected Behavior:

Laravel application should connect to Memcached container.

Context information:

Memcached container is running

484baa22c6c1   laradock_memcached   "docker-entrypoint.s…"   23 minutes ago   Up 23 minutes   0.0.0.0:11211->11211/tcp, :::11211->11211/tcp 

Output of docker version

Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:54:08 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:16 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker-compose version

docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

System info: Mac, Windows or Linux. Include which disto/version

Ubuntu 18.04 LTS

Steps to reproduce the issue:

  1. up the containers like this: dc up nginx mysql memcached -d
  2. connect to Laravel application

Stacktrace & Additional info:

RuntimeException
HELP
Could not establish Memcached connection.

Open: /var/www/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php
			$memcached->addServer(
				$server['host'], $server['port'], $server['weight']
			);
		}
 
		if ($memcached->getVersion() === false)
		{
			throw new \RuntimeException("Could not establish Memcached connection.");
		}
$server is array(3) { ["host"]=> string(9) "127.0.0.1" ["port"]=> int(11211) ["weight"]=> int(100) }
@bestlong
Copy link
Member

bestlong commented Oct 9, 2021

host is not 127.0.0.1
try service name memcached

@stale
Copy link

stale bot commented Jan 9, 2022

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Jan 9, 2022
@stale
Copy link

stale bot commented Feb 20, 2022

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants