dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

unknown method GetWorkflowExecutionHistoryReverse for service temporal.server.api #12

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

A portion of the workflow history records that have been executed are displayed as 501. Note that not all of them are. Why is this happening? I have checked the documentation and it says that the version is incorrect, but I am using the latest version. The temporal server version is 1.24.2 and the Temporal UI Version is 2.28.0

image

image

dhiaayachi commented 22 hours ago

It looks like you're encountering an issue with the Temporal Workflow history, specifically that a portion of the executed history is being displayed as version 501. This is likely due to a mismatch between the version of the Temporal Server and the UI you're using.

Here's a breakdown of the issue and potential solutions:

Understanding the Problem

Troubleshooting Steps

  1. Check Temporal Server Version:

    • You mentioned that the Temporal Server version is 1.24.2. Verify this using the temporal operator version command:
    temporal operator version

    The output should show the version:

    temporal_server_version = 1.24.2
    
  2. Verify Temporal UI Version:

    • The Temporal UI Version is 2.28.0, which is the latest available as of August 2023. However, to completely eliminate this as the source of the problem, make sure that you are not using a previously downloaded version. To find the version of the UI you are using, check the "Server Info" panel in the web UI.

    Server Info Panel in Temporal Web UI

    • You can upgrade to the latest version of the UI by deploying the latest temporal-ui-server binary from the Github Releases page.
  3. Update the temporal-ui-server binary:

    • If you are using a self-hosted Temporal Server, ensure the ui-server binary you are using is the same version as the Temporal Server.
    • If using Temporal Cloud, you'll need to check for a Temporal Cloud release that supports Temporal Server v1.24.2 and includes the latest UI.
  4. Check Your Code:

    • If you've recently changed your Workflow code (Workflow Definition) you might need to implement a patching strategy.
    • Verify that the Workflow code uses the Temporal SDK correctly, particularly for any operations that may affect the Event History.
    • Make sure you have the most recent version of your SDK, since versions of the SDKs are compatible with specific versions of the Temporal Service.
    • It is okay to have a mismatch between the Server and Worker (that is, the SDK) versions but a mismatch between the Server and UI versions is the likely source of the issue.
    • If you're using the GetVersion API to handle Workflow Versioning and this is the source of the incorrect version displayed in the UI, it should be removed from your Workflow code when it becomes safe to do so.
    • Make sure that your Workflows or Activities are not using any deprecated SDK APIs.

Additional Information

Tags:

Have feedback on our documentation?

Post in our Community forum.

Temporal logoTemporal logo

Copyright © 2024 Temporal Technologies Inc.What does the Motor Vehicle Search Workflow Definition look like? | Learn Temporal

Skip to main content

Replay will return September 18-20 in Seattle! Secure your ticket.

Temporal logoTemporal logoHome Get started Courses Project-based tutorials Example applications Documentation

Search

What does the Motor Vehicle Search Workflow Definition look like?

Last updated on Aug 21, 2024

workflows/motor_vehicle_incident_search.go

func MotorVehicleIncidentSearch(ctx workflow.Context, input *MotorVehicleIncidentSearchWorkflowInput) (*MotorVehicleIncidentSearchWorkflowResult, error) {
    var result MotorVehicleIncidentSearchWorkflowResult

    name := input.FullName
    address := input.Address
    var motorvehicleIncidents []string

    activityInput := activities.MotorVehicleIncidentSearchInput{
        FullName: name,
        Address:  address,
    }
    var activityResult activities.MotorVehicleIncidentSearchResult

    ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
        StartToCloseTimeout: time.Minute,
    })

    motorvehicleIncidentSearch := workflow.ExecuteActivity(ctx, a.MotorVehicleIncidentSearch, activityInput)

    err := motorvehicleIncidentSearch.Get(ctx, &activityResult)
    if err == nil {
        motorvehicleIncidents = append(motorvehicleIncidents, activityResult.MotorVehicleIncidents...)
    }
    result.MotorVehicleIncidents = motorvehicleIncidents

    r := MotorVehicleIncidentSearchWorkflowResult(result)
    return &r, nil
}

Swim lane diagram of the State Criminal Search Child Workflow Execution

Last updated on Aug 21, 2024

Previous\ \ What does the State Criminal Search Workflow Definition Look Like? Next\ \ What does the Employment Verification Workflow Definition look like?

Temporal logoTemporal logo

Copyright © 2024 Temporal Technologies Inc.What does the State Criminal Search Workflow Definition Look Like? | Learn Temporal

Skip to main content

Replay will return September 18-20 in Seattle! Secure your ticket.

Temporal logoTemporal logoHome Get started Courses Project-based tutorials Example applications Documentation

Search

What does the State Criminal Search Workflow Definition Look Like?

Last updated on Aug 21, 2024

workflows/state_criminal_search.go


// StateCriminalSearch is a Workflow Definition that calls for the execution an Activity for
// each address associated with the Candidate.
// This is executed as a Child Workflow by the main Background Check.
func StateCriminalSearch(ctx workflow.Context, input *StateCriminalSearchWorkflowInput) (*StateCriminalSearchWorkflowResult, error) {
    var result StateCriminalSearchWorkflowResult

    name := input.FullName
    knownaddresses := input.KnownAddresses
    var crimes []string

    for _, address := range knownaddresses {
        activityInput := activities.StateCriminalSearchInput{
            FullName: name,
            Address:  address,
        }
        var activityResult activities.StateCriminalSearchResult

        ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
            StartToCloseTimeout: time.Minute,
        })

        statecheck := workflow.ExecuteActivity(ctx, a.StateCriminalSearch, activityInput)

        err := statecheck.Get(ctx, &activityResult)
        if err == nil {
            crimes = append(crimes, activityResult.Crimes...)
        }
    }
    result.Crimes = crimes

    r := StateCriminalSearchWorkflowResult(result)
    return &r, nil
}

Swim lane diagram of the State Criminal Search Child Workflow Execution

Last updated on Aug 21, 2024

Previous\ \ What does the Federal Criminal Search Workflow Definition look like? Next\ \ What does the Motor Vehicle Search Workflow Definition look like?

Temporal logoTemporal logo

Copyright © 2024 Temporal Technologies Inc.What are the requirements of the Background Check application? | Learn Temporal

Skip to main content

Replay will return September 18-20 in Seattle! Secure your ticket.

Temporal logoTemporal logoHome Get started Courses Project-based tutorials Example applications Documentation

Search

What are the requirements of the Background Check application?

Last updated on Aug 21, 2024

Tags:

This tutorial covers how to build a Background Check application with Temporal and the Go SDK.

Here are the key features of the application:

Tags:

Last updated on Aug 21, 2024

Previous\ \ How to use the Background Check application Next\ \ How to design and implement the Background Check application

Temporal logoTemporal logo

Copyright © 2024 Temporal Technologies Inc.What does the main Background Check Workflow Definition look like? | Learn Temporal

Skip to main content

Replay will return September 18-20 in Seattle! Secure your ticket.

Temporal logoTemporal logoHome Get started Courses Project-based tutorials Example applications Documentation

Search

What does the main Background Check Workflow Definition look like?

Last updated on Aug 21, 2024

This is the entry point of the Temporal Application. When a new Background Check is started, this is the function that executes.

workflows/background_check.go


// BackgroundCheck is a Workflow Definition that calls for the execution of a variable set of Activities and Child Workflows.
// This is the main entry point of the application.
// It accepts an email address as the input.
// All other personal information for the Candidate is provided when they accept the Background Check.
func BackgroundCheck(ctx workflow.Context, input *BackgroundCheckWorkflowInput) (*BackgroundCheckWorkflowResult, error) {
    w := newBackgroundCheckWorkflow(
        ctx,
        &BackgroundCheckState{
            Email:         input.Email,
            Tier:          input.Tier,
            SearchResults: make(map[string]interface{}),
            SearchErrors:  make(map[string]string),
        },
    )

    // The query returns the status of a background check and is used by the API to build the report at the end.
    err := workflow.SetQueryHandler(ctx, BackgroundCheckStatusQuery, func() (BackgroundCheckState, error) {
        return w.BackgroundCheckState, nil
    })
    if err != nil {
        return &w.BackgroundCheckState, err
    }

    // Send the candidate an email asking them to accept or decline the background check.
    response, err := w.waitForAccept(ctx, w.Email)
    if err != nil {
        return &w.BackgroundCheckState, err
    }

    w.Accepted = response.Accepted

    // If the candidate declined the check, let the hiring manager know and then end the workflow.
    if !w.Accepted {
        return &w.BackgroundCheckState, w.sendDeclineEmail(ctx, activities.HiringManagerEmail)
    }

    w.CandidateDetails = response.CandidateDetails

    // Update our status search attribute. This is used by our API to filter the background check list if requested.
    err = w.pushStatus(ctx, "running")
    if err != nil {
        return &w.BackgroundCheckState, err
    }

    // Run an SSN trace on the SSN the candidate provided when accepting the background check.
    w.SSNTrace, err = w.ssnTrace(ctx)
    if err != nil {
        return &w.BackgroundCheckState, err
    }

    // If the SSN the candidate gave us was not valid then send a report email to the Hiring Manager and end the workflow.
    // In this case all the searches are skipped.
    if !w.SSNTrace.SSNIsValid {
        return &w.BackgroundCheckState, w.sendReportEmail(ctx, activities.HiringManagerEmail)
    }

    // Start the main searches, these are run in parallel as they do not depend on each other.

    var primaryAddress string
    if len(w.SSNTrace.KnownAddresses) > 0 {
        primaryAddress = w.SSNTrace.KnownAddresses[0]
    }

    // We always run the FederalCriminalSearch
    w.startSearch(
        ctx,
        "FederalCriminalSearch",
        FederalCriminalSearch,
        FederalCriminalSearchWorkflowInput{FullName: w.CandidateDetails.FullName, KnownAddresses: w.SSNTrace.KnownAddresses},
    )

    // If the background check is on the full tier we run more searches
    if w.Tier == "full" {
        w.startSearch(
            ctx,
            "StateCriminalSearch",
            StateCriminalSearch,
            StateCriminalSearchWorkflowInput{FullName: w.CandidateDetails.FullName, KnownAddresses: w.SSNTrace.KnownAddresses},
        )
        w.startSearch(
            ctx,
            "MotorVehicleIncidentSearch",
            MotorVehicleIncidentSearch,
            MotorVehicleIncidentSearchWorkflowInput{FullName: w.CandidateDetails.FullName, Address: primaryAddress},
        )

        // Verify their employment if they provided an employer
        if w.CandidateDetails.Employer != "" {
            w.startSearch(
                ctx,
                "EmploymentVerification",
                EmploymentVerification,
                EmploymentVerificationWorkflowInput{CandidateDetails: w.CandidateDetails},
            )
        }
    }

    // Wait for all of our searches to complete.
    w.waitForSearches(ctx)

    // Send the report email to the Hiring Manager.
    return &w.BackgroundCheckState, w.sendReportEmail(ctx, activities.HiringManagerEmail)
}

The sequence that the code defines can be represented in the following diagram:

Swim lane diagram of the Main Background Check Workflow Execution

Last updated on Aug 21, 2024

Previous\ \ How to design and implement the Background Check application Next\ \ What does the Candidate Acceptance Workflow Definition look like?

dhiaayachi commented 21 hours ago

Thank you for reporting this issue!

It looks like you are using the latest version of Temporal Server and UI, however, the issue you are experiencing is a known bug in Temporal Server.

You can find additional information here: https://github.com/temporalio/temporal/issues/5139

We're working to resolve this bug as soon as possible.

Let us know if you have any further questions.

dhiaayachi commented 4 hours ago

Thanks for reporting this! This seems to be an issue with the temporal.server.api version you're using. The GetWorkflowExecutionHistoryReverse method is not available until Temporal server version 1.24.2 or newer. You're using version 1.24.2. Please double check your server version, as you may need to upgrade for this feature to work.

Here's a relevant section from our documentation: https://docs.temporal.io/clusters