RichardKnop / machinery

Machinery is an asynchronous task queue/job queue based on distributed message passing.
Mozilla Public License 2.0
7.55k stars 916 forks source link

machinery task error #497

Open lb151 opened 4 years ago

lb151 commented 4 years ago

INFO: 2019/11/28 15:17:00 worker.go:54 - ResultBackend: redis://192.168.1.253:6379/2 INFO: 2019/11/28 15:17:00 redis.go:94 [] Waiting for messages. To exit press CTRL+C DEBUG: 2019/11/28 15:17:07 redis.go:297 Received new message: {"UUID":"task_3f4c817a-8cf6-4eca-afe7-f6f4fb34f541","Name":"task_done","RoutingKey":"machinery_tasks","ETA":null,"GroupUUID":"","GroupTaskCount":0,"Args":[{"Name":"ss","Type":"int64","Value":1},{"Name":"dd","Type":"int64","Value":1}],"Headers":{},"Priority":0,"Immutable":false,"RetryCount":0,"RetryTimeout":0,"OnSuccess":null,"OnError":null,"ChordCallback":null,"BrokerMessageGroupId":"","SQSReceiptHandle":"","StopTaskDeletionOnError":false,"IgnoreWhenTaskNotRegistered":false} INFO: 2019/11/28 15:17:07 main.go:70 I am a start of task handler for: task_done ERROR: 2019/11/28 15:17:07 task.go:130 goroutine 51 [running]: runtime/debug.Stack(0x1d54ec8, 0xc0004f6180, 0x2) F:/go/src/runtime/debug/stack.go:24 +0xa4 github.com/RichardKnop/machinery/v1/tasks.(Task).Call.func1(0xc0004d7cc8, 0xc0004ea280) E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/tasks/task.go:130 +0xc3 panic(0xfb3520, 0x14bb4d0) F:/go/src/runtime/panic.go:679 +0x1c0 reflect.Value.call(0xfab2e0, 0x122e628, 0x13, 0x11bc320, 0x4, 0xc000422810, 0x2, 0x2, 0x10f7ca0, 0x1155e80, ...) F:/go/src/reflect/value.go:380 +0x151b reflect.Value.Call(0xfab2e0, 0x122e628, 0x13, 0xc000422810, 0x2, 0x2, 0xc0000b0d20, 0xc0004a6400, 0x5e) F:/go/src/reflect/value.go:321 +0xbb github.com/RichardKnop/machinery/v1/tasks.(Task).Call(0xc0004ea280, 0x0, 0x0, 0x0, 0x14d66e0, 0xc0003b8b30) E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/tasks/task.go:142 +0x264 github.com/RichardKnop/machinery/v1.(Worker).Process(0xc00049a500, 0xc00030a1e0, 0x0, 0x0) E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/worker.go:170 +0x390 github.com/RichardKnop/machinery/v1/brokers/redis.(Broker).consumeOne(0xc0001f2000, 0xc000008000, 0x1df, 0x1df, 0x14e0fa0, 0xc00049a500, 0x0, 0x0) E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/brokers/redis/redis.go:299 +0x55f github.com/RichardKnop/machinery/v1/brokers/redis.(Broker).consume.func2(0xc0001f2000, 0xc000008000, 0x1df, 0x1df, 0x14e0fa0, 0xc00049a500, 0xc00053e480, 0xa, 0xc0004ae1e0) E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/brokers/redis/redis.go:258 +0x71 created by github.com/RichardKnop/machinery/v1/brokers/redis.(*Broker).consume E:/go/mod/test/pkg/mod/github.com/!richard!knop/machinery@v1.7.1/v1/brokers/redis/redis.go:257 +0x15a

INFO: 2019/11/28 15:17:07 main.go:74 I am an end of task handler for: task_done ERROR: 2019/11/28 15:17:07 main.go:66 I am an error handler: reflect: Call with too many input arguments

rafareyes7 commented 4 years ago

I'm having the same trouble.

cdelacruzpinto commented 4 years ago

Are you creating this task in an OnSuccess or maybe from a Chain? When using tasks in chains apparently if you don't mark the task as immutable, the result of the calling task is injected as an additional argument. See #158 just in case this helps you.