Closed FrazeColder closed 3 years ago
Heya, thanks for reporting.
I'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new laravel-issue-36613 --github="--public"
After you've posted the repository, I'll try to reproduce the issue.
Thanks!
Yes, give me a second. I just want to post the full stack trace:
[2021-03-16 11:18:19] local.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at /vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:156)
[stacktrace]
#0 /vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(156): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to acces...', '/vendor...', 156, Array)
#1 /vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(138): Illuminate\\Queue\\QueueManager->resolve('mailcoach-redis')
#2 /vendor/laravel/framework/src/Illuminate/Queue/Worker.php(145): Illuminate\\Queue\\QueueManager->connection('mailcoach-redis')
#3 /vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\\Queue\\Worker->daemon('mailcoach-redis', 'mailcoach', Object(Illuminate\\Queue\\WorkerOptions))
#4 /vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\\Queue\\Console\\WorkCommand->runWorker('mailcoach-redis', 'mailcoach')
#5 /vendor/laravel/horizon/src/Console/WorkCommand.php(51): Illuminate\\Queue\\Console\\WorkCommand->handle()
#6 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Horizon\\Console\\WorkCommand->handle()
#7 /vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#8 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#9 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#10 /vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#11 /vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call(Array)
#12 /vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#13 /vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#14 /vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 /vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand(Object(Laravel\\Horizon\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 /vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 /vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#18 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#19 /artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#20 {main}
"}
@driesvints
Here you go: https://github.com/FrazeColder/laravel-issue-36613
I get the same result when running php artisan horizon
and I did nothing else then installing horizon and edited my config files. I have included the .env
file now because of configs.
@FrazeColder you did not use the command I posted from above. Please re-create the repo in the way that I asked, thanks.
@driesvints I am sorry, but I did. Installed Horizon, edited my configs and then I published it on GitHub via PHPStorm.
The command from above would create a repo with the Laravel skeleton committed separately. So that's not true what you claim. Please create the repo like I asked and I'll have a look.
I am very sorry.. I found my error.. The queue.php
file was missing the mailcoach-redis
connection... I am very sorry!
Description:
Hi,
I am now posting this here because I have posted my issue to Laracast already but as I don't find any solution and nobody is able to tell me where the problem is I have to consider this problem as a bug and I hope you do also so.
I have installed
Redis
andHorizon
correctly. Why I am so certain about this? When I runphp -r "if (new Redis() == true){ echo \"\r\n OK \r\n\"; }"
I getOK
which meansRedis
is working. StrangelyHorizon
is also able process my queue tasks correctly, I can see this under thehorizon/jobs/completed
. I have two completed jobs here and I have received my test emails.My
Redis
database is also working:I also cleared the
cache
by runningphp artisan cache:clear
, cleared composer by runningcomposer dump-autload
, restarted valet multiple times by runningvalet restart
, even restarted myPHP
multiple times by runningbrew services restart php@7.4
and restatedHorizon
multiple times by runningphp artisan horizon:terminate
andphp artisan horizon:clear
.Laravel Valet is also using the correct PHP version (7.4.16) which has the
Redis
extension installed. But what I get when I runphp artisan horizon
is the following:I would appreciate any kind of help! Thank you very much!
When I edit the file and add a simple
dd
for$config
this is what I get:So, it looks like my config files are correctly configured. But why then do I get this error? When I replace
dd
withif(!isset($config['driver']) || is_null($config['driver'])) dd($config);
I getnull
which is the reason why the error above gets thrown. But how can this be? Sometimes$config
isnull
and sometimes not?Till yesterday I have the problem that PHP told me
Please make sure the PHP Redis extension is installed and enabled
when trying to send the emails. But I was able to solve this by adding"ext-redis": "*"
to therequire
section in mycomposer.json
. However, I don't think this has to do something with the problem I am describing here because it has nothing to do with theconfig
files.I will paste my config files now below so you can see what I have configured.
This is my
.env
(just some entries):Here is my config/queue.php:
My config/horizon.php
My
database.php
file: