why two different enums in the line you say breaks the app and the enum in the error?
Laravel 11 :SQLSTATE[HY000] [2002] Connection refused
Hey guys, need some help here.
I am upgrading to Laravel 11, but I am getting some errors when I am deploying my app on Vapor.
The problem is on Task Scheduling, when I run some querys to get the days and hour that the user input as a parameter to run the jobs.
code:
$hour = Parameter::getParameter(Parameter::TIME_BILLING_AUTO_REGISTER);
Schedule::command("auto-register:daily") ->timezone("America/Chicago") ->dailyAt($hour);
The error:
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Illuminate\Database\QueryException SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select * from
parameterswherekey= WEEKLY_BILLING_DAY limit 1) at vendor/laravel/framework/src/Illuminate/Database/Connection.php:813 809▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 810▕ ); 811▕ } 812▕ ➜ 813▕ throw new QueryException( 814▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 815▕ ); 816▕ } 817▕ } +22 vendor frames 23 app/Models/Parameter.php:61 Illuminate\Database\Eloquent\Builder::first() 24 routes/console.php:47 App\Models\Parameter::getParameter() Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 Error: Process completed with exit code 1.
Important things:
- This works on Laravel 10.
- The credentials not seem to be the problem, since Laravel 10 works and if I remove the line the deploy works and the application works fine as well.
Any ideias?
Please or to participate in this conversation.