Tctl add search attribute error

Hi,
I get error when trying to add search attribute:

TEMPORAL_CLI_SHOW_STACKS=1 tctl --address 10.32.22.61:7233 --namespace product adm cl asa -n abcd -t keyword Tue Oct 11 09:08:03 2022
Error: Unable to get existing search attributes.
Error Details: rpc error: code = Unavailable desc = error reading from server: EOF
Stack trace:
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
runtime/debug/stack.go:16 +0x1c
github.com/temporalio/tctl/v2/cli_curr.printError({0x10634415d, 0x29}, {0x106c6f600, 0x14000290080})
github.com/temporalio/tctl/v2/cli_curr/util.go:392 +0x1d0
github.com/temporalio/tctl/v2/cli_curr.ErrorAndExit({0x10634415d?, 0x106c9a690?}, {0x106c6f600?, 0x14000290080?})
github.com/temporalio/tctl/v2/cli_curr/util.go:403 +0x28
github.com/temporalio/tctl/v2/cli_curr.AdminAddSearchAttributes(0x140001d1760)
github.com/temporalio/tctl/v2/cli_curr/admin_cluster_search_attributes_commands.go:59 +0xd8
github.com/temporalio/tctl/v2/cli_curr.newAdminClusterCommands.func1(0x1400032e0c0?)
github.com/temporalio/tctl/v2/cli_curr/admin.go:458 +0x1c
github.com/urfave/cli.HandleAction({0x1068c9c00?, 0x106c641e0?}, 0x15?)
github.com/urfave/cli@v1.22.10/app.go:526 +0x94
github.com/urfave/cli.Command.Run({{0x1063080b1, 0x15}, {0x0, 0x0}, {0x1400077f3e0, 0x1, 0x1}, {0x10631a4b9, 0x1c}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:173 +0x534
github.com/urfave/cli.(*App).RunAsSubcommand(0x1400063a700, 0x140001d1340)
github.com/urfave/cli@v1.22.10/app.go:405 +0x6d0
github.com/urfave/cli.Command.startApp({{0x1062e7848, 0x7}, {0x0, 0x0}, {0x1400077f580, 0x1, 0x1}, {0x106320df7, 0x1e}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.
main.main()
./main.go:47 +0xcc

can i get some pointers for debugging this? Not sure if it is temporal authorization issue or some other issues. Thanks!

Hi @Newbie_Sr

It might be an authorization issue, I have run the same command against a temporal cluster configured with TLS, and I have gotten the same error.

Have you set TLS in your Temporal cluster?

You can pass your certificates to the tctl command with the following flags

Hi Antonio,
I added the ca, cert and key, it worked for get search attribute, but not work for add search attribute.

TEMPORAL_CLI_SHOW_STACKS=1 tctl --tls_ca_path /Users/newbie/intermediary.pem --tls_cert_path /Users/newbie/public.pem --tls_key_path /Users/newbie/private.pem --tls_disable_host_verification --address 10.32.22.61:7233 --namespace product adm cl asa -n arpan -t keyword
You are about to add search attributes [arpan:Keyword]. Continue? Y/N Y

Error: Unable to add search attributes.
Error Details: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Stack trace:
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
runtime/debug/stack.go:16 +0x1c
github.com/temporalio/tctl/v2/cli_curr.printError({0x1053d7324, 0x20}, {0x105d1f600, 0x14000118118})
github.com/temporalio/tctl/v2/cli_curr/util.go:392 +0x1d0
github.com/temporalio/tctl/v2/cli_curr.ErrorAndExit({0x1053d7324?, 0x105d33eb8?}, {0x105d1f600?, 0x14000118118?})
github.com/temporalio/tctl/v2/cli_curr/util.go:403 +0x28
github.com/temporalio/tctl/v2/cli_curr.AdminAddSearchAttributes(0x1400013fb80)
github.com/temporalio/tctl/v2/cli_curr/admin_cluster_search_attributes_commands.go:114 +0x588
github.com/temporalio/tctl/v2/cli_curr.newAdminClusterCommands.func1(0x14000121fc0?)
github.com/temporalio/tctl/v2/cli_curr/admin.go:458 +0x1c
github.com/urfave/cli.HandleAction({0x105979c00?, 0x105d141e0?}, 0x15?)
github.com/urfave/cli@v1.22.10/app.go:526 +0x94
github.com/urfave/cli.Command.Run({{0x1053b80b1, 0x15}, {0x0, 0x0}, {0x1400028e720, 0x1, 0x1}, {0x1053ca4b9, 0x1c}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:173 +0x534
github.com/urfave/cli.(*App).RunAsSubcommand(0x1400063e700, 0x1400013f8c0)
github.com/urfave/cli@v1.22.10/app.go:405 +0x6d0
github.com/urfave/cli.Command.startApp({{0x105397848, 0x7}, {0x0, 0x0}, {0x1400028ea90, 0x1, 0x1}, {0x1053d0df7, 0x1e}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:378 +0x694
github.com/urfave/cli.Command.Run({{0x105397848, 0x7}, {0x0, 0x0}, {0x1400028ea90, 0x1, 0x1}, {0x1053d0df7, 0x1e}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:102 +0x678
github.com/urfave/cli.(*App).RunAsSubcommand(0x1400063e540, 0x1400013f760)
github.com/urfave/cli@v1.22.10/app.go:405 +0x6d0
github.com/urfave/cli.Command.startApp({{0x105392d9f, 0x5}, {0x0, 0x0}, {0x1400028ea20, 0x1, 0x1}, {0x1053b2909, 0x13}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:378 +0x694
github.com/urfave/cli.Command.Run({{0x105392d9f, 0x5}, {0x0, 0x0}, {0x1400028ea20, 0x1, 0x1}, {0x1053b2909, 0x13}, {0x0, …}, …}, …)
github.com/urfave/cli@v1.22.10/command.go:102 +0x678
github.com/urfave/cli.(*App).Run(0x1400063e1c0, {0x1400004e140, 0x13, 0x14})
github.com/urfave/cli@v1.22.10/app.go:277 +0x604
main.main()

When I get search attribute I see the one which I just added but the temporal-sys-add-search-attributes-workflow is failed.

| WorkflowType | keyword |
| arpan | keyword |
| merchanntId | keyword |
±----------------------±------------+
Workflow info:
{
“execution”: {
“workflowId”: “temporal-sys-add-search-attributes-workflow”,
“runId”: “402c957c-f944-427b-bfe3-1072257a01cf”
},
“startTime”: “2022-10-11T21:11:10.714903291Z”,
“closeTime”: “2022-10-11T21:11:46.883115746Z”,
“status”: “Failed”
}

Do you have any idea why this happened?

@Newbie_Sr I am trying to reproduce the issue,

can you share the tctl version, server version, and how you are deploying Temporal?

  • tctl --version
  • tctl admin cl d | jq ‘.serverVersion’