https://prefect.io logo
Title
c

Charles Leung

03/23/2021, 9:34 PM
hey guys! i have the following error:
INTERNAL_SERVER_ERROR: Variable "$input" got invalid value null at
        "input.states[0].task_run_id"; Expected non-nullable type UUID! not to be null.

The GraphQL query was:

    mutation($input: set_task_run_states_input!) {
            set_task_run_states(input: $input) {
                states {
                    message
                    status
                    id
            }
        }
    }

The passed variables were:

    {"input": {"states": [{"state": {"message": "Trigger was \"all_successful\" but some of the upstream tasks failed.", "_result": {"location": null, "__version__": "0.14.11", "type": "Result"}, "cached_inputs": {}, "context": {"tags": []}, "__version__": "0.14.11", "type": "TriggerFailed"}, "task_run_id": null, "version": null}]}}

what is the issue? I'm not sure how to debug this
j

Jenny

03/23/2021, 9:38 PM
Hi @Charles Leung - can you give a bit more information to help us here. Are you on server or cloud? (Guessing server as you're in the server channel but want to be sure.). What were you doing when you saw the error? (Running flow from the UI or CLI?). Can you share any of your code or storage info? Thanks!
c

Charles Leung

03/24/2021, 1:45 PM
Hey Jenny, Yes Server! I realized an issue with my code was throwing an error since i was trying to read a glacial storage object from s3. However, this error came up and i guess it confused me; i think it may be how i'm creating tasks in a loop (e.g., run task per dealer). I'll try to fix the error and see what happens 🙂. Thanks!
j

Jenny

03/24/2021, 1:48 PM
Ok. Thanks for the update. Please do let us know if you see it again.
c

Charles Leung

03/24/2021, 4:48 PM
Hey Jenny! I appreciate your help. Actually i have a quick question maybe you could help me answer. My flow is structured like this:
with prefect.Flow('aiprice-model-pipeline') as flow:
    new_file_count = upload_smb_files()
    new_data_confirmation = has_new_data(new_file_count)
    with prefect.case(new_data_confirmation, True):
        data = load_s3_data()
        for dealer in dealers:
            estimator = generate_model(data, dealer)
            result = save_model(estimator, dealer)
dealers is a iterable list that holds a fixed set of dealers, but when i look at the flow schematic registered on the UI, it treats it as there's only one instance of the task rather than multiple per dealer
is this normal? it makes it difficult for me to track the logs for each process. I'm not sure if i'm doing this the most 'prefect idiomatic' way
j

Jenny

03/24/2021, 7:07 PM
Hi @Charles Leung - Sorry just seen your new questions! (I'm technically OOO today - always better to ask new questions in the main channel so the rest of the team can see them.). Let me check this with the wider team.
Actually - have you checked out mapping: https://docs.prefect.io/core/concepts/mapping.html#iterated-mapping instead of for ... in ....
c

Charles Leung

03/24/2021, 7:16 PM
Hey Jenny! I appreciate you responding on your OOO day! it's no urgency. 🙂 I have but it's just cumbersome to have a function mapped to the result of a prefect function, when my list is fixed! This is possibly the issue since the looping tasks aren't being registered with separate IDs or something; I'll give this a shot 🙂 greatly appreciate your help.
👍 1