Closed MonicaisHer closed 2 years ago
This test is still not stable in my machine, it has about 50% chance to pass, and each time the error messages are different, for example:
time="2022-01-25 18:33:48" level=info msg="Specified Kuiper base folder at location /var/snap/edgexfoundry/x1/kuiper.\n" file="conf/path.go:100"
cannot stop rule
This appears in the logs at the same time:
Jan 26 09:56:42 farshid-cirrus7 edgexfoundry.kuiper[54862]: time="2022-01-26 09:56:42" level=error msg="closing rule rule_mqtt for error: redis: can't parse \"iI4Njg2Mjk3OTU4ODExOTIyODQwIn1dfQ==\\\",\\\"ContentType\\\":\\\"application/json\\\"}\"" file="server/ruleManager.go:114"
time="2022-01-26 09:54:37" level=info msg="Specified Kuiper base folder at location /var/snap/edgexfoundry/x1/kuiper.\n" file="conf/path.go:100"
cannot run rule's action: rule_edgex_message_bus
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: redis: 2022/01/26 09:54:37 pubsub.go:160: redis: discarding bad PubSub connection: redis: can't parse "ion/json\"}"
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: panic: runtime error: slice bounds out of range [1538:769]
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: goroutine 121 [running]:
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: bufio.(*Reader).ReadSlice(0xc000444c60, 0xb0)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: bufio/bufio.go:335 +0x225
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7/internal/proto.(*Reader).readLine(0x0)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/internal/proto/reader.go:72 +0x25
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7/internal/proto.(*Reader).ReadLine(0x0)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/internal/proto/reader.go:58 +0x19
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7/internal/proto.(*Reader).ReadReply(0xc07460f359d77f0e, 0x14ea598)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/internal/proto/reader.go:84 +0x2a
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7.(*Cmd).readReply(...)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/command.go:276
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7.(*PubSub).ReceiveTimeout.func1(0xc000240108)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/pubsub.go:356 +0x31
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7/internal/pool.(*Conn).WithReader(0xc0000ac4b0, {0x160bba8, 0xc0000360b8}, 0xc000302e98, 0xc000302ea8)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/internal/pool/conn.go:65 +0x6d
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7.(*PubSub).ReceiveTimeout(0xc000331c00, 0x0)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/pubsub.go:355 +0xad
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7.(*PubSub).Receive(...)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/pubsub.go:371
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7.(*PubSub).ReceiveMessage(0xc00000e510)
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/go-redis/redis/v7@v7.3.0/pubsub.go:379 +0x2c
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/edgexfoundry/go-mod-messaging/v2/internal/pkg/redis.(*goRedisWrapper).Receive(0xc000386020, {0xc000438410, 0x0})
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/edgexfoundry/go-mod-messaging/v2@v2.1.0/internal/pkg/redis/goredis.go:78 +0x2a
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/edgexfoundry/go-mod-messaging/v2/internal/pkg/redis.Client.Subscribe.func1()
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/edgexfoundry/go-mod-messaging/v2@v2.1.0/internal/pkg/redis/client.go:142 +0x70
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: created by github.com/edgexfoundry/go-mod-messaging/v2/internal/pkg/redis.Client.Subscribe
Jan 26 09:54:37 farshid-cirrus7 edgexfoundry.kuiper[48575]: github.com/edgexfoundry/go-mod-messaging/v2@v2.1.0/internal/pkg/redis/client.go:140 +0x1c5
I've created a potential fix to a clear bug: https://github.com/farshidtz/go-mod-messaging/commit/823a44fdf5e24b7020773ba337bddadfa024dc24
That's a dependency of kuiper and you'd need to replace it at https://github.com/lf-edge/ekuiper/blob/95e8b5776023d3f54e9a3016e52762b12f7e5b03/go.mod#L11
Suggested way to test:
github.com/farshidtz/go-mod-messaging@823a44f
and check that in.Update: this bugfix doesn't solve the kuiper errors. Kuiper uses a single channel/topic per subscription and not affected by this bug.
@MonicaisHer good catch. We need to document the current need for setting SHARED="true"
and report the errors which would result from not doing so as a bug.
@tonyespy do you have some other insights?
Vault’s failure->security-secretstore-setup->security-bootstrapper-redis->device-virtual Vault’s failure->security-secretstore-setup->security-consul-bootstrapper->app-service-configurable
Error logs:
The probable reason for getting the connection refused is that the Vault Server is not up and running.
With SHARED=false, this bug will eventually cause errors, and errors will appear later when rules run as expected for a while. For example:
rule_log: Running(working) ->(few minutes later) -> Stopped: redis: can't parse "\"}".
rule_mqtt: Running(working) ->(few minutes later) -> Stopped: read tcp 127.0.0.1:53254->127.0.0.1:6379: use of closed network connection.
Test guideline
Expect: