This error occurs because Tablestore requires specific table configurations when combining a secondary index with a custom time to live (TTL) value. Either disable data expiration or prohibit row updates before creating the index.
Error message
ErrorCode: OTSParameterInvalid, ErrorMessage: Don't support allow update operation on table with index and ttlCause
A data table with a secondary index must meet one of these conditions:
TTL is -1 -- data never expires.
TTL is a custom value and
TableOptions.AllowUpdateisfalse.
This error appears when the TTL is not -1 but TableOptions.AllowUpdate is not false.
Solution
Choose one option based on your requirements.
Option 1: Set TTL to -1 (disable data expiration)
Use this option if your data does not need to expire.
Tablestore console
Log on to the Tablestore console and open the target data table.
On the Basic Information tab, click Modify Attributes.
Set Time to Live to -1 and click OK.
Tablestore SDK
Call the UpdateTable operation and set TableOptions.TimeToLive to -1.
Option 2: Prohibit row updates (keep custom TTL)
Use this option if you need data expiration but can disable row updates.
After you prohibit updates, the UpdateRow operation can no longer modify data in this table.
Tablestore console
Log on to the Tablestore console and open the target data table.
On the Basic Information tab, click Modify Attributes.
Set Allow Updates to No, select the checkbox to acknowledge the risk, and click OK.
Tablestore SDK
Call the UpdateTable operation and set TableOptions.AllowUpdate to false.