You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when update the ttl of the token in st2.conf to 600 seconds, the sensor container complains failed to create token with expiry of 86400 for the sensor.
[2017-03-28 16:57:38,855 58587408 ERROR sensor_watcher [-] Handling failed. Message body: SensorTypeDB(artifact_uri="file:///opt/stackstorm/packs/chatops/sensors/HubotWatchdog2.py", description="watch the log of st2chatops. send the timestamp of the last log line", enabled=True, entry_point="sensors.HubotWatchdog2.HubotWatchdog", id=58d0dadc921627282206cf04, name="HubotWatchdog", pack="chatops", poll_interval=10, trigger_types=[u'chatops.last_hubot_log_timestamp_delta'], uid="sensor_type:chatops:HubotWatchdog"). Exception: TTL specified 86400 is greater than max allowed 600.
Traceback (most recent call last):
File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/services/sensor_watcher.py", line 82, in process_task
handler(body)
File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/manager.py", line 141, in _handle_update_sensor
self._sensor_container.add_sensor(sensor=sensor_obj)
File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/process_container.py", line 215, in add_sensor
self._spawn_sensor_process(sensor=sensor)
File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/process_container.py", line 294, in _spawn_sensor_process
temporary_token = create_token(username='sensors_container', ttl=ttl)
File "/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/services/access.py", line 58, in create_token
raise TTLTooLargeException(msg)](url)
I check the code and found at /opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/process_container.py + 449
# Include full api URL and API token specific to that sensor
ttl = (24 * 60 * 60)
temporary_token = create_token(username='sensors_container', ttl=ttl)
create_token is about to create a token with ttl=86400 but failed.
The text was updated successfully, but these errors were encountered:
For end user stuff, we need some kind of protection and reasonable max TTL for tokens, but for system tokens (one used by the sensor container, actions, etc.) it sometimes makes sense to allow larger TTLs.
Adding system argument to create_token method and when system=True we would skip TTL check all together. And we would of course update places where system tokens are generated to pass in system=True.
Edit system -> service. I think calling it service is better.
when update the ttl of the token in st2.conf to 600 seconds, the sensor container complains failed to create token with expiry of 86400 for the sensor.
I check the code and found at /opt/stackstorm/st2/lib/python2.7/site-packages/st2reactor/container/process_container.py + 449
create_token is about to create a token with ttl=86400 but failed.
The text was updated successfully, but these errors were encountered: