Unable to create 3rd search attribute of type int on mysql8 advanced visibility

I was able to add 2 custom search attributes, but on the 3rd one, I get this error:

$ temporal operator search-attribute create --name=“companyId” --type=“Int”

Error: unable to add search attributes: Failed to add search attributes to store mysql8: Unable to create search attributes: cannot have more than 3 search attribute of type Int.
(‘export TEMPORAL_CLI_SHOW_STACKS=1’ to see stack traces)

Any hints on what I can do about this? Is there a variable that can be adjusted? I have one temporal cluster that has advanced visibility on elasticsearch and works fine. But my local one running on mysql8 has this problem

Temporal server version: 1.24.2

Schema should allow up to 3 custom search attributes of type int.

You could use cli command:
temporal operator search-attribute list -o json | jq .customAttributes

and look at how many custom search attributes you have of type INDEXED_VALUE_TYPE_INT

Thanks! There is one built in out of the box, CustomIntField. I deleted it and was able to add my third so that solved the problem for me. Temporal does try to add it back on boot and prints a failure to add warning, but so far no side side effects.

For folks who need more than three, the value looks to be a hard coded array and not a limit controlled by a flag for mysql advanced visibility.

There is one built in out of the box, CustomIntField

Assume you use the auto-setup server image then which has this script as entry-point that adds it.

You could create a custom autossetup script which does not call add_custom_search_attributes and then overwrite your entry point for the autosetup image if you wanted, just fyi

Ah yes I am. Thanks for this, it’s helpful