-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
L5: php artisan queue:listen redis connection problem #7904
Comments
Can't replicate. Please make sure you're using the correct dependency versions and have updated your config. |
I am also having the same issue! Running Lumen in a php-fpm Docker container. When I run a custom artisan command, it duplicates the connection string: However, redis connection works fine when app is accessed from web browser. |
I found this to be an issue with the phpdotenv ~v1.0 library. If some environment variable is defined in the OS, and also the same variable is defined in the .env file, phpdotenv gets the system variable by default. This behavior is controlled by the boolean attribute $immutable in Dotenv.php class. |
In my case the problem was that the OS environment variable REDIS_PORT was set to
Maybe Artisan get OS environment variable. I resolved it setting OS environment variable REDIS_PORT to
I use docker and docker-compose so i just modified my docker-compose.yml adding this 2 line:
|
use host name into |
For future reference I ran into this issue yesterday so I'll document it here. Environment
SetupRedis is used in laravel as a queue, cache, session storage. We have one rancher stack that contains two containers What went wrongFor it's service discovery rancher will inject a lot of environment variables based on the name of the containers.
This ended up overwriting our usage of REDIS_PORT that we set as an environment variable on the container when deploying it. TLDRIf you're using rancher, avoid environment variables that could match a container/service name in some form, a lot of pain can be avoided that way |
====docker-compose.yml works for me |
Make sure that the redis service is accessible inside docker. This is my solution. |
Having moved from L4 to L5 we experience some problems with our queue. We run the queue via redis – which we also use for session, so there should be no problem with our redis connection (we can ping pong on the server via redis-tools aswell)
When we execute the command php artisan queue:listen we get the following exception
it seems like laravel is trying to connect to [ (tcp://ip) : (tcp://ip) : (port) ], where it should obviously only connect to (tcp://ip) : (port)
I have been unable to locate any descripencies in the various redis/queue related places i've looked.
Thanks in advance!
The text was updated successfully, but these errors were encountered: