uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.98k stars 775 forks source link

"cadence workflow show" panic with cron workflow #5078

Open rkumpf opened 1 year ago

rkumpf commented 1 year ago

Version of Cadence server, and client(which language)

Describe the bug The cadence workflow show command gives panic: reflect.Value.Interface: cannot return value obtained from unexported field or method on a cron workflow that was terminated prior to its first scheduled run. The problem does not occur with server version 0.24.0.

To Reproduce Is the issue reproducible?

Steps to reproduce the behavior:

  1. Start a cron workflow.
  2. Terminate the cron workflow before its first scheduled run.
  3. Use the CLI to show the workflow details:
    cadence --address localhost:7933 --do my-domain workflow show --wid my-workflow-id --rid 69f34234-d8d6-4871-b18b-703bad74c8bc --of 69f34234-d8d6-4871-b18b-703bad74c8bc.json

The CLI result is:

panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

Expected behavior The workflow details should be successfully shown, as in this redacted output from an identical workflow using the 0.24.0 server:

  1  WorkflowExecutionStarted     {WorkflowType:{Name:Redacted}, TaskList:{Name:redacted}, Input:["redacted"],                                              
                                   ExecutionStartToCloseTimeoutSeconds:1800, TaskStartToCloseTimeoutSeconds:10, ContinuedFailureDetails:[],                         
                                   LastCompletionResult:[], OriginalExecutionRunID:69f34234-d8d6-4871-b18b-703bad74c8bc,                                            
                                   Identity:1@redacted@@3ba23188-828a-4e1b-a292-2f731f9150ec,                       
                                   FirstExecutionRunID:69f34234-d8d6-4871-b18b-703bad74c8bc, Attempt:0,                                                             
                                   CronSchedule:0 0 * * *, FirstDecisionTaskBackoffSeconds:86304,                                                                 
                                   Header:{...}}                                                 
  2  WorkflowExecutionTerminated  {Reason:Because, Details:[],                                                                           
                                   Identity:1@redacted@@3ba23188-828a-4e1b-a292-2f731f9150ec}                       

Additional context The issue was detected through workflow replay automation. After running a set of tests, all workflow data is exported to check for compatibility in a later build. The export works correctly with server build 0.24.0 and fails with server build 0.25.0.

osho-20 commented 1 week ago

would like to work on this