This topic describes the problem description, cause, and solution of the "operation is denied as table TTL exists" exception when you create a search index.
Problem description
The following error occurs when you create a search index:
ErrorCode: OTSParameterInvalid, ErrorMessage: operation is denied as table TTL exists.
Cause
The time to live (TTL) of a table is set to a value other than -1 (the data never expires). You can create a search index only when the TTL of a table is set to -1.
Solution
Set the TTL of a table to -1 by using the console or SDKs.
- Use the console
Log on to the Tablestore console. Go to the Details tab. Click Modify Attributes. In the dialog box, set the TTL to -1, and click OK.
- Use Tablestore SDKs
Call the UpdateTable operation to set the TTL of a table to -1 based on corresponding SDKs.
- Tablestore SDK for Java: UpdateTable
- Tablestore SDK for Go: Update tables
- Tablestore SDK for Python: Update a table
- Tablestore SDK for Node.js: Update tables
- Tablestore SDK for .NET: UpdateTable
- Tablestore SDK for PHP: Update a table