Reset temporal_visibility

I am receiving the attached error in my Docker Temporal server instance but cannot find how to fix it. I am running Temporal code locally with the Temporal UI, Postgres database, and server in Docker. This used to run fine on my laptop as I used it regularly.

The impact is my cron workflow (which is called MaintenanceWorkflow) will not show up in the Temporal UI. The other message I see in the Temporal server is “Duplicate activity retry timer task.”

As a last resort, I changed the name of the workflow to MaintenanceWorkflow2, and then that does show up in the UI. SO I believe the cause is narrowed to the Temporal database somehow not in the proper state.

So how do I fix the Temporal database so this will work? Thanks

Are you using auto-setup image? From logs it seems auto-setup script is trying to recreate the your visibility schema but not sure this is related to the issue you are seeing. Anything else in frontend service logs?

Do you configure standard or enhanced visibility (Elasticsearch)?
If you know the workflowid if the MaintenanceWorkflow type you started can you let us know what you get via:

tctl wf desc -w <wfid>


tctl wf list -q "WorkflowId='<wfid>'"

I tried the command but don’t think it is working. here is the output:

john.pirog@ARY-A125 db % docker exec temporal-admin-tools tctl wf list -q "WorkflowId=

I tried with a running workflow but got the same (non) output.

For the other command:

john.pirog@ARY-A125 db % docker exec temporal-admin-tools tctl wf desc -w daily-maintenance-workflow            
Error: Describe workflow execution failed
Error Details: rpc error: code = NotFound desc = sql: no rows in result set
('export TEMPORAL_CLI_SHOW_STACKS=1' to see stack traces)

There is no visibility installed, I’m just using DOcker.

I am able to proceed by renaming the workflow but when I want to move this to our dev/QA system, I will need to go back to the original name. Did the database just get corrupted somehow? I hate to start over but I can reinstall Docker if I have to.

There is no visibility installed, I’m just using DOcker.

You do configure visibility, either standard (backed by your db) or enhanced (backed by Elasticsearch).
Mind sharing your docker compose please?

sql: no rows in result set

This means your workflow execution with provided workflow id cannot be found in main persistence store.

tctl wf list

this command hits visibility store, and it seems visibility also cannot find any results for the given workflow id.

Is this execution running on the “default” namespace or some other one? If its another ns try adding

tctl --ns <namespace_name> ...

to your commands. Also whats the retention period set for your namespace:

tctl --ns <namespace_name> n desc

(look for Retention value in result). If your execution completed and then reached retention period, it would be removed from both primary store as well as visibility.