Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Coroutine Raised StopIteration when triggering workflow execution from CLI for workflows which call workflow.upsert_search_attributes #443

Closed
alonwengierko opened this issue Dec 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@alonwengierko
Copy link

What are you really trying to do?

I modified poetry file to use temporalio version 1.4.0 and then ran worker.py of your_visibility folder of the DOCUMENTATION_SAMPLES_PYTHON repository (https://github.com/temporalio/documentation-samples-python)

Then I use cli command to trigger workflow

temporal workflow start --task-queue search-attributes-task-queue --type GreetingWorkflow

After doing that I get an error:
"coroutine raised StopIteration"

This error doesn't happen for version Python SDK 1.3.0 when I trigger workflow from cli

Describe the bug

I found that when you trigger a workflow who has calls to workflow.upsert_search_attributes using cli for for Temporalio Python SDK version 1.4.0, you get error Coroutine Raised StopIteration

File "/Users/awengierko/Documents/Projects/documentation-samples-python/.venv/lib/python3.11/site-packages/temporalio/worker/_workflow_instance.py", line 1888, in execute_workflow
return await input.run_fn(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine raised StopIteration
Failed activation on workflow GreetingWorkflow with ID 9e14f703-b1de-4031-9213-fb43b405a660 and run ID cf74cb1b-0bb2-4d08-a711-312c3f050cfb

Screenshot 2023-12-08 at 21 11 10 Screenshot 2023-12-08 at 21 11 18

Minimal Reproduction

  1. Clone repo https://github.com/temporalio/documentation-samples-python
  2. Update pyproject.toml to use temporalio = "^1.4.0" instead of temporalio = "^1.3.0"
  3. Terminal 1 -> Run worker: python worker.py
  4. Terminal 2 -> Trigger Workflow exeuction: temporal workflow start --task-queue search-attributes-task-queue --type GreetingWorkflow
  5. See in Terminal 2: Error message "coroutine raised StopIteration"

Environment/Versions

  • OS and processor: M2 Mac
  • Temporal Version: 1.4.0
  • Are you using Docker or Kubernetes or building Temporal from source? No
@alonwengierko alonwengierko added the bug Something isn't working label Dec 9, 2023
@cretz
Copy link
Member

cretz commented Dec 11, 2023

Thanks! I believe this was just fixed in #440 but not yet released. In the meantime, I recommend using typed search attributes for upsert_search_attributes (you should be getting a warning if you use this deprecated form). I will see if I can have the docs updated to match.

(closing since the primary issue was fixed, but feel free to continue to discuss here, on the forums, or on Slack)

@cretz cretz closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants