StackStorm / StackStorm/st2

keyvalue deleted by ttl but not triggered

Open
#5,802 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

SUMMARY

When a keyvalue is deleted by the ttl, no core.st2.key_value_pair.delete is generated

STACKSTORM VERSION

st2 version: st2 3.7.0, on Python 3.6.8

OS, environment, install method

Post what OS you are running this on, along with any other relevant information/
OS: CentOS Linux 3.10.0-1160.76.1.el7.x86_64
Installation: one-line install

Steps to reproduce the problem

(cluster)-[root@auto ~]$ st2 key set test_ttl toto -l 30
+------------------+-----------------------------+
| Property         | Value                       |
+------------------+-----------------------------+
| name             | test_ttl                    |
| value            | toto                        |
| scope            | st2kv.system                |
| expire_timestamp | 2022-11-10T12:34:34.529983Z |
+------------------+-----------------------------+
(cluster)-[root@auto ~]$ st2 key list
+---------------------------+--------------------------------+--------+-----------+--------------+------+-------------------------------+
| name                      | value                          | secret | encrypted | scope        | user | expire_timestamp              |
+---------------------------+--------------------------------+--------+-----------+--------------+------+-------------------------------+
| test_ttl                  | toto                           | False  | False     | st2kv.system |      | Thu, 10 Nov 2022 13:34:34 CET |
+---------------------------+--------------------------------+--------+-----------+--------------+------+-------------------------------+
(cluster)-[root@auto ~]$ st2 key get test_ttl
Key Value Pair "test_ttl" is not found.

ERROR: Resource test_ttl not found.
 (cluster)-[root@auto ~]$st2 trigger-instance list
+--------------------------+--------------------------------+-------------------------------+-----------+
| id                       | trigger                        | occurrence_time               | status    |
+--------------------------+--------------------------------+-------------------------------+-----------+
| 636cefbc87c48a6504896824 | core.st2.key_value_pair.create | Thu, 10 Nov 2022 13:34:04 CET | processed |
+--------------------------+--------------------------------+-------------------------------+-----------+

Expected Results

Once the ttl expire the keyvalue is deleted by the system, it should create a trigger core.st2.key_value_pair.delete.

Actual Results

There is no trigger core.st2.key_value_pair.delete genereted but if you delete a key by hand, a trigger is generated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the TTL deletion path for key-value pairs and compare it with the manual st2 key delete path that emits core.st2.key_value_pair.delete. Reproduce the issue with st2 key set test_ttl toto -l 30, then verify that expiration produces the delete trigger while the existing create trigger behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.