Hi!
I just detected a possible bug, but I don’t really know where to post it, so here it is.
I’m using CB 6.0.0-beta on Docker (Windows host).
When creating an eventing function through the REST API endpoint POST /api/v1/functions
, I’m providing the following body:
{
"appname": "testFn_1535782832544",
"appcode": "function OnUpdate(doc, meta) {\n\n // Check if we're processing a timer task\n if (doc.doc_type !== 'eventing_integration_test_model') {\n return;\n }\n\n doc.processed = true;\n\n}\n",
"depcfg": {
"Buckets": [
{
"alias": "bucket_test",
"bucket_name": "XXXXXX_test"
}
],
"metadata_bucket": "XXXXXX_test_eventing_metadata",
"source_bucket": "XXXXXX_test"
},
"settings": {
"dcp_stream_boundary": "from_now",
"deployment_status": true,
"processing_status": true,
"execution_timeout": 60
}
}
I’m seeing in the eventing.log
Couchbase log file this entry:
interface conversion: interface {} is nil, not string, stacktrace: goroutine 509 [running]:
github.com/couchbase/eventing/suptree.(*Supervisor).runService.func1.1(0xc42012c1c0, 0x1)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/suptree/supervisor.go:392 +0xbc
panic(0xbea900, 0xc420088180)
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.10.3/go/src/runtime/panic.go:502 +0x229
github.com/couchbase/eventing/producer.(*Producer).parseDepcfg(0xc42021c700, 0xd2e6c8, 0xc42021c700)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/producer/depcfg_parser.go:324 +0x3706
github.com/couchbase/eventing/producer.(*Producer).Serve(0xc42021c700)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/producer/producer.go:89 +0x70
github.com/couchbase/eventing/suptree.(*Supervisor).runService.func1(0xc42012c1c0, 0xfc589de200000001, 0xdb4e80, 0xc42021c700)
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/suptree/supervisor.go:398 +0x63
created by github.com/couchbase/eventing/suptree.(*Supervisor).runService
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/suptree/supervisor.go:388 +0x5b
It probably all goes back to this row, which is an unchecked cast:
logLevel := settings["log_level"].(string)
I’m clearly missing the log_level
entry in the body of the function, but I assume this should be a checked cast, or filtered out at the API level.
This bug is causing an eventing function to:
- Be marked as deployed.
- Be constantly marked as “boostrapping” in an infinite loop, impossible do undeploy and delete.
Thank you,
Alberto