laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.51k stars 11.02k forks source link

`php artisan serve` Command Randomly Fails with 'Not Enough Data Available to Satisfy Format' Error #52592

Closed zaidmcs closed 2 months ago

zaidmcs commented 2 months ago

Laravel Version

10.48.18

PHP Version

8.2.12

Database Driver & Version

No response

Description

php artisan serve command, run perfectly but randomly it's stops and give an error which originate from the Carbon library and is related to an invalid or incomplete date format being passed to the createFromFormat method. This issue is blocking the development server from starting,

The error stack trace provided:

Not enough data available to satisfy format

  at vendor\nesbot\carbon\src\Carbon\Traits\Creator.php:690
    686▕             return $instance;
    687▕         }
    688▕
    689▕         if (static::isStrictModeEnabled()) {
  ➜ 690▕             throw new InvalidFormatException(implode(PHP_EOL, $lastErrors['errors']));
    691▕         }
    692▕
    693▕         return false;
    694▕     }

  1   vendor\nesbot\carbon\src\Carbon\Traits\Creator.php:713
      Carbon\Carbon::rawCreateFromFormat("D M d H:i:s Y")

  2   vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php:328
      Carbon\Carbon::createFromFormat("D M d H:i:s Y")

This error seems to occur randomly without any specific trigger.

Steps To Reproduce

  1. Run the php artisan serve command in the terminal.
  2. Observe that the server starts successfully.
  3. Continue working in the environment, running other artisan commands or refreshing the server.
  4. At random intervals, the server will fail with the following error.
crynobone commented 2 months ago

Hey there,

Unfortunately we don't support this version of the library anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.

Thanks!