Closed toto975 closed 2 years ago
Heya, thanks for reporting.
We'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 as separate commits on the main/master branch 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 bug-report --github="--public"
Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hello,
I understand that you need more info and code. I work on a corporate intranet, so it's hard to share all of my code with you.
Here is a part of the code for the job :
<?php
namespace App\Jobs\Portail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Throwable;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Mail;
class ProcessPortail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* The number of times the job may be attempted.
*
* @var int
*/
public $tries = 5;
/**
* The number of seconds the job can run before timing out.
*
* @var int
*/
public $timeout = 3600;
/**
* Indicate if the job should be marked as failed on timeout.
*
* @var bool
*/
public $failOnTimeout = true;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//Pour ne pas mettre dans un même file tous les jobs, on précise ici son nom
$this->onQueue('portail');
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$result = file_get_contents('https://myweb_web_site_which_cant_be_reached') <== Put a website which doesn't exist to fail the job
}
/**
* Handle a job failure.
*
* @param \Throwable $exception
* @return void
*/
public function failed(Throwable $exception)
{
mail('my_mail@dot.com', 'error job', $exception->getMessage());
}
}
For emergency log, i comment all the channels in config\logging.php, except the emergency channel
Hope this helps you with debugging.
Please create a new repo to reproduce the problem with minimal code as possible. Otherwise I can't help you, sorry.
Feel free to re-open once the repo is created.
Description:
When the error text contains \r, it's doing a line break in the error file, like this :
The error text is
In the log file there is :
Steps To Reproduce:
Run a job and fall in failed job
I did some search and found the parameters to put in config\logging.php
It's Ok for error in controller, view, repositories, etc. But not when a job failed.
Same thing happens for emergency log, even if there is in config\logging.php