I'm running php artisan queue:work --tries=3
on some mail jobs but I keep getting this error in the log file:
[2018-11-02 03:22:02] local.ERROR: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 (SQL: update
jobs set
reserved_at = 1541128922,
attempts = 256 where
id = 767) {"exception":"[object] (Illuminate\\\\Database\\\\QueryException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 (SQL: update
jobs set
reserved_at = 1541128922,
attempts = 256 where
id = 767) at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\\\DBAL\\\\Driver\\\\PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 at /var/www/html/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:144, PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 at /var/www/html/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:142) [stacktrace]
= 767) at /var/www/html/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\\\\DBAL\\\\Driver\\\\PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 at /var/www/html/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:144, PDOException(code: 22003): SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1 at /var/www/html/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:142) [stacktrace]
The job is actually being created in the jobs table but it isn't being processed. How can I resolve this issue?
请增加attempts
字段数据值
SQLSTATE[22003] Numeric value out of range: 1264 Out of range value for column 'attempts' at row 1
IT looks like your attemets
field is set to TINYINT
max of 255, I can tell because of this bit.
SQL: updatejobssetreserved_at= 1541128922,attempts= 256 whereid= 767
And because I know that a TinyInt can hold 255 (because I just googled it..ha ha). Its actually probably defined as INT(1) UNSIGEND
So you want to change that to > TINYINT
LIKE a NOTSOTINYINT.... :) I mean SMALLINT
PS I cheated
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.