Skip to content

Trying to create search attribute that already exists should return error #8631

@tsurdilo

Description

@tsurdilo

How issue was found:
Try adding same search attribute multiple times via cli - cli always gives "ok" response, for example try running this command multiple times:

      temporal operator search-attribute create --name MyCustomSA --type Keyword
      Search attributes have been added

When adding SA server has this loop where it creates aliasToFieldMap -

for saName, saType := range request.GetSearchAttributes() {

In this loop server logs the warn message with errSearchAttributeAlreadyExistsMessage
but because it does not add anything to map it just returns nil -

instead of serviceerror
this then in turn return nil to cli as response. cli does check for already exists error, but since server returns nil, error is never shown to user.

Ask is to change this code on server to return serviceError instead that tells cli/sdk/clients that they are trying to create a SA that already exists

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions