Sensor token expired when running in Docker

I am running stackstorm in docker https://github.com/StackStorm/st2-docker using the st2 provided docker build.

My sensor is periodically reading/writing values to the stackstorm datastore.
The token is expiring and the program is unable to continue.

I solved this problem in a standard stackstorm ubuntu installation by having the sensor exit(1) and then stackstorm would automatically restart the sensor. This fix however is not working in docker.

2021-06-30 01:25:02,500 140510655553608 ERROR oc_sensor [-] [qa8 - Sensor]  Failed to connect to datastore. 401 Client Error: Unauthorized
MESSAGE: Unauthorized - Token has expired. for url: http://127.0.0.1:9101/v1/keys/qa8:last_poll_timestamp
2021-06-30 01:25:02,505 140510655553608 ERROR oc_sensor [-] [qa8 - Sensor]  Failed to connect to datastore. 401 Client Error: Unauthorized
MESSAGE: Unauthorized - Token has expired. for url: http://127.0.0.1:9101/v1/keys/qa8:last_poll_timestamp
2021-06-30 01:25:02,511 140510655553608 ERROR oc_sensor [-] [qa8 - Sensor]  Failed to connect to datastore. 401 Client Error: Unauthorized
MESSAGE: Unauthorized - Token has expired. for url: http://127.0.0.1:9101/v1/keys/qa8:last_poll_timestamp