All Apps and Add-ons

Add-on Builder TypeError: Why do I get this error "get_state_store max_cache_seconds"?

lbeste003
New Member

Hello
I have built an APP with which I collect logs from a REST API. For this I use the checkpoint manager and store type file . I get the following error: 

```

2022-03-28 07:57:58,877 +0000 log_level=INFO, pid=7000, tid=MainThread, file=ta_config.py, func_name=set_logging, code_line_no=94 | Set log_level=DEBUG
2022-03-28 07:57:58,878 +0000 log_level=INFO, pid=7000, tid=MainThread, file=ta_config.py, func_name=set_logging, code_line_no=95 | Start mdm_api task
2022-03-28 07:57:58,878 +0000 log_level=DEBUG, pid=7000, tid=MainThread, file=ta_config.py, func_name=_get_checkpoint_storage_type, code_line_no=102 | Checkpoint storage type=auto
2022-03-28 07:57:58,878 +0000 log_level=DEBUG, pid=7000, tid=MainThread, file=ta_checkpoint_manager.py, func_name=_create_state_store, code_line_no=44 | Got checkpoint storage type=auto
2022-03-28 07:57:58,878 +0000 log_level=INFO, pid=7000, tid=MainThread, file=ta_checkpoint_manager.py, func_name=_use_cache_file, code_line_no=93 | Stanza=mdm_api using cached file store to create checkpoint
2022-03-28 07:57:58,878 +0000 log_level=DEBUG, pid=7000, tid=MainThread, file=ta_checkpoint_manager.py, func_name=_create_state_store, code_line_no=64 | Creating file state store, use_cache_file=True, max_cache_seconds=5
2022-03-28 07:57:58,878 +0000 log_level=ERROR, pid=7000, tid=MainThread, file=ta_mod_input.py, func_name=main, code_line_no=287 | api_mdm_v5 task encounter exception
Traceback (most recent call last):
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_mod_input.py", line 283, in main
cc_json_file=cc_json_file
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_mod_input.py", line 209, in run
for task_config in task_configs
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_mod_input.py", line 209, in <listcomp>
for task_config in task_configs
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_data_client.py", line 68, in create_data_collector
dataloader)
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_data_collector.py", line 61, in __init__
task_config)
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_checkpoint_manager.py", line 40, in __init__
task_config[c.appname]
File "C:\Program Files\Splunk\etc\apps\TA-mdm_api_v5\bin\ta_mdm_api_v5\aob_py3\cloudconnectlib\splunktacollectorlib\data_collection\ta_checkpoint_manager.py", line 71, in _create_state_store
max_cache_seconds=max_cache_seconds
TypeError: get_state_store() got an unexpected keyword argument 'max_cache_seconds'

```

Labels (2)
0 Karma

ankycampy
Explorer

Facing exactly same issue, any other solution rather than downgrading the version ?

0 Karma

azun4i
Observer

Hi anykcampy

You can probably just switch to KV mode. From checking the source it seems like they just updated half the app and forgot to handle the 'max_cache_seconds' argument for File mode.

0 Karma

lbeste003
New Member

Hello everyone I have solved the problem by using an old version of the Add-on Builder (v.301). After that the data input worked correctly.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...