I have created a Sensor and implemented its methods (init,setup,add_trigger,update_trigger etc).
I am taking parameters while creating the trigger.
---
class_name: "PUBSUBSync"
entry_point: "PUBSUBSync.py"
description: "PUBSUB Synchronous Testing"
trigger_types:
-
name: "pubsub"
description: "GCP PUBSUB"
parameters_schema:
type: "object"
properties:
subscriber_id:
type: "string"
required: true
payload_schema:
type: "object"
properties:
message:
type: "object"
topic:
type: "string"
When running the stackstorm i am getting this following error in rulesengine log
2021-03-09 12:07:30,539 139958497248912 DEBUG utils [-] No trigger in db for optigotest.event
2021-03-09 12:07:30,540 139958497248912 ERROR consumers [-] StagedQueueConsumer failed to process
message: {‘trace_context’: None, ‘trigger’: ‘optigotest.event’, ‘payload’: {‘topic’: ‘sttest’,
‘message’: {‘key2’: ‘value2’, ‘key1’: ‘value1’}}}
Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/transport/consumers.py”, line 86, in
process
response = self._handler.pre_ack_process(body)
File “/opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/rules/worker.py”, line 57, in
pre_ack_process
raise_on_no_trigger=True)
File “/opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/utils.py”, line 45, in
create_trigger_instance
raise StackStormDBObjectNotFoundError(‘Trigger not found for %s’ % trigger)
StackStormDBObjectNotFoundError: Trigger not found for optigotest.event
2021-03-09 12:07:34,078 139958497248912 DEBUG triggers [-] Looking up TriggerDB by id:
603b249329b1a881c6b43dcf
2021-03-09 12:07:34,124 139958498188816 DEBUG rules [-] Querying rules with trigger
core.899b1edc-3454-480a-bac6-b9fdeea0dd4c
Is there any error in the way i implemented a Sensor ?
Thanks in Advance !!