队列未处理

时间:2018-11-02 03:29:57

标签: php laravel laravel-5.6

我在某些邮件作业上运行php artisan queue:work --tries=3,但在日志文件中却不断收到此错误:

[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职位set保留{at = 1541128922,尝试= 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职位set保留职位= 1541128922,尝试= 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]

该作业实际上是在作业表中创建的,但尚未处理。 我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

请增加attempts字段数据值

答案 1 :(得分:0)

  

SQLSTATE [22003]数字值超出范围:1264行1的列“尝试”超出范围值

IT看来您的attemets字段设置为TINYINT的最大值255,因为这一点我可以知道。

 SQL: updatejobssetreserved_at= 1541128922,attempts= 256 whereid= 767

并且因为我知道TinyInt可以容纳255(因为我只是用Google搜索它了..哈哈)。它实际上可能定义为INT(1) UNSIGEND

所以您想将其更改为> TINYINT就像一个NOTSOTINYINT .... :)我的意思是SMALLINT

我被骗了

https://dev.mysql.com/doc/refman/5.5/en/integer-types.html