yajra / laravel-oci8

Oracle DB driver for Laravel via OCI8
https://yajrabox.com/docs/laravel-oci8
MIT License
832 stars 237 forks source link

insert into jobs failed #164

Closed holyblue closed 8 years ago

holyblue commented 8 years ago

I use laravel default migration to create jobs and failed-jobs table. When I dispatch a job into the queue the error occur. this is the error message: (could you help me to solve the problem)

Error Code : 1438
Error Message : ORA-01438: value larger than specified precision allowed for this column
Position : 114
Statement : insert into jobs ("queue", payload, attempts, reserved, reserved_at, available_at, created_at) values (:p0, :p1, :p2, :p3, :p4, :p5, :p6) returning id into :p7
Bindings : [default,{"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:29:\"EverymanAdmin\\Jobs\\SendSmsJob\":4:{s:6:\"\u0000*\u0000sms\";O:8:\"stdClass\":4:{s:12:\"phone_number\";s:10:\"0935838777\";s:7:\"message\";s:18:\"\u9019\u662f\u6e2c\u8a66\u7c21\u8a0a\";s:9:\"send_time\";s:0:\"\";s:8:\"receiver\";s:0:\"\";}s:5:\"queue\";N;s:5:\"delay\";N;s:6:\"\u0000*\u0000job\";N;}"}},0,0,,1461319493,1461319493,0]

 in Statement.php line 177
at Statement->execute() in OracleProcessor.php line 28
at OracleProcessor->processInsertGetId(object(OracleBuilder), 'insert into jobs ("queue", payload, attempts, reserved, reserved_at, available_at, created_at) values (?, ?, ?, ?, ?, ?, ?) returning id into ?', array('default', '{"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:29:\"EverymanAdmin\\Jobs\\SendSmsJob\":4:{s:6:\"\u0000*\u0000sms\";O:8:\"stdClass\":4:{s:12:\"phone_number\";s:10:\"0935838777\";s:7:\"message\";s:18:\"\u9019\u662f\u6e2c\u8a66\u7c21\u8a0a\";s:9:\"send_time\";s:0:\"\";s:8:\"receiver\";s:0:\"\";}s:5:\"queue\";N;s:5:\"delay\";N;s:6:\"\u0000*\u0000job\";N;}"}}', '0', '0', null, '1461315941', '1461315941'), null) in Builder.php line 1821
at Builder->insertGetId(array('default', '{"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:29:\"EverymanAdmin\\Jobs\\SendSmsJob\":4:{s:6:\"\u0000*\u0000sms\";O:8:\"stdClass\":4:{s:12:\"phone_number\";s:10:\"0935838777\";s:7:\"message\";s:18:\"\u9019\u662f\u6e2c\u8a66\u7c21\u8a0a\";s:9:\"send_time\";s:0:\"\";s:8:\"receiver\";s:0:\"\";}s:5:\"queue\";N;s:5:\"delay\";N;s:6:\"\u0000*\u0000job\";N;}"}}', '0', '0', null, '1461315941', '1461315941')) in DatabaseQueue.php line 150
at DatabaseQueue->pushToDatabase('0', null, '{"job":"Illuminate\\Queue\\CallQueuedHandler@call","data":{"command":"O:29:\"EverymanAdmin\\Jobs\\SendSmsJob\":4:{s:6:\"\u0000*\u0000sms\";O:8:\"stdClass\":4:{s:12:\"phone_number\";s:10:\"0935838777\";s:7:\"message\";s:18:\"\u9019\u662f\u6e2c\u8a66\u7c21\u8a0a\";s:9:\"send_time\";s:0:\"\";s:8:\"receiver\";s:0:\"\";}s:5:\"queue\";N;s:5:\"delay\";N;s:6:\"\u0000*\u0000job\";N;}"}}') in DatabaseQueue.php line 69
at DatabaseQueue->push(object(SendSmsJob)) in Dispatcher.php line 268
at Dispatcher->pushCommandToQueue(object(DatabaseQueue), object(SendSmsJob)) in Dispatcher.php line 243
at Dispatcher->dispatchToQueue(object(SendSmsJob)) in Dispatcher.php line 175
at Dispatcher->dispatch(object(SendSmsJob)) in DispatchesJobs.php line 17
at Controller->dispatch(object(SendSmsJob)) in TestController.php line 134

job table schema

CREATE TABLE "JOBS" 
   (    "ID" NUMBER(19,0) NOT NULL ENABLE, 
    "queue" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
    "PAYLOAD" CLOB NOT NULL ENABLE, 
    "ATTEMPTS" NUMBER(3,0) NOT NULL ENABLE, 
    "RESERVED" NUMBER(3,0) NOT NULL ENABLE, 
    "RESERVED_AT" NUMBER(10,0), 
    "AVAILABLE_AT" NUMBER(10,0) NOT NULL ENABLE, 
    "CREATED_AT" NUMBER(10,0) NOT NULL ENABLE, 
     CONSTRAINT "JOBS_ID_PK" PRIMARY KEY ("ID")
   )

environment PHP 7 Laravel 5.1.34 Yajra/oci 5.1.0 oracle 11g

yajra commented 8 years ago

@holyblue, does your date field really a number? That might be causing your issue?

"RESERVED_AT" NUMBER(10,0), 
"AVAILABLE_AT" NUMBER(10,0) NOT NULL ENABLE, 
"CREATED_AT" NUMBER(10,0) NOT NULL ENABLE, 
holyblue commented 8 years ago

yes it's number like this '1461315941', '1461315941'

yajra commented 8 years ago

Let's continue the discussion on #170 where PR was also created to fix this. Thanks!