Hi, All. I am seeing an issue I have not seen befo...
# ask-the-community
Hi, All. I am seeing an issue I have not seen before when fast registering locally. The only difference between previous successful registration and this failure is a bump to flytekit 1.12.0 from 1.11.0 I see
Successfully serialized 39 flyte objects
, but then
Error: unknown type <nil>
and for the specific workflow I see
Copy code
| /tmp/workflows/04_flyte.my_package.abc.workflow_xyz_2.pb                                     
| Failed  | Error hydrating spec due to unknown type <nil> |
Any tips on how to debug this? Thanks in advance!
I looked for similar issues on github and haven’t seen anything, but I do know that 1.12 was just released a few days ago in case that is the culprit.
I’m going to try to remove @dataclass_json from the types used in that workflow since they contain a FlyteFile element to see if that works as a response to this important note
If you’re using Flytekit version >= v1.11.1, you don’t need to decorate with
or inherit from Mashumaro’s
found here.
No luck with ^
Ohh can you downgrade
It might be 1.12
Cc @Eduardo Apolinario (eapolinario) do you know
@Len Strnad, can you give more details about the code you're trying to register? For example, the overall shape of the objects you're trying to register. Happy to jump on a call to debug this.
I have pinned us to 1.11, but obviously less ideal. I'm stoked about some changes in 1.12.
@Eduardo Apolinario (eapolinario) I tried to dive in here. My hunch for now was dataclasses with optional types and defaults of None used in an input for a task with map_task. I tried to build an mre, but ran out of time. I'll try again tomorrow and get back with you!
Thank you. Let's sync tomorrow.
Found an MRE! I am just working in minimizing the example as much as possible to narrow down.
Copy code
from flytekit import task, workflow, map_task
from dataclasses import dataclass

class MyOutputs:
    b: str = "anything"

def test_task(i: int) -> MyOutputs:
    return MyOutputs()

def test_workflow2() -> list[MyOutputs]:
    return map_task(test_task)(i=[1, 2, 3])
Seems to do it for me. It looks like there wasn’t a test for map_task in the pr that touched some of this here: https://github.com/flyteorg/flytekit/pull/2279?
Happy to make an issue if someone else can verify this is a valid MRE.
Great, thank you! I’ll take a look shortly.
@Len Strnad, I'm unable to repro this. I tried your example is working for both array node map tasks and legacy map tasks on latest flytekit. How are you registering? Can you confirm which version of the Flyte you're running in the backend too?
We fast register with the command below:
Copy code
: \
&& mkdir -p ${FLYTE_TEMPDIR} \
&& pyflyte -k ${PROJECT_NAME} -k flyte.${PROJECT_NAME} serialize --image ${DOCKER_IMAGE_NAME}:${DOCKER_VERSION_TAG} fast workflows -f ${FLYTE_TEMPDIR} \
&& flytectl --admin.endpoint ${FLYTE_HOST} register files ${FLYTE_TEMPDIR}/* --project=${PROJECT_SLUG} --domain=${FLYTE_DOMAIN} --version=${FLYTE_VERSION} \
&& :
" ;
As for looking into the flyte version on the backend, finding one of the pod components and inspecting the labels in k9s I see
so likely 1.11
Up to this point, we haven’t seen a need to keep versions matching between flyte core and flytekit if I recall correctly. Do these versions need to always match?
> Do these versions need to always match? nope, they don't. I was trying to narrow down the discrepancies between our test environments. Let me see what I can find out.
@Len Strnad, can you also confirm which version of
you're running?
Copy code
root@len-small-cpu:/src# flytectl version
INFO[0000] [0] Couldn't find a config file []. Relying on env vars and pflags. 

 A new release of flytectl is available: 0.6.35 → v0.8.18 
To upgrade, run: flytectl upgrade 

  "App": "flytectl",
  "Build": "bd00706",
  "Version": "0.6.35",
  "BuildTime": "2024-05-10 20:53:41.628788929 +0000 UTC m=+0.019757206"
Upgrading to 0.8.18 now to test. Took me a sec to find where we install this--in our dockerfile.
It registers with the upgrade. I guess we fell behind there. I’ll refrain from creating an issue.
Let me know if there is any other valuable info you might want, but we will just plan to upgrade flytectl. Thanks for pointing that out!
great. This explains it. Map tasks were rewritten and under the covers they are now implemented as a new node type, which was only implemented in flytectl in 0.6.42.
I can't reproduce it too, does this related to
or something?
I've tested the example with latest flyte sandbox release and latest flytekit image.
@Len Strnad @Eduardo Apolinario (eapolinario) Hi, I can help this is there's any follow-up, does this error not related to flytekit?
No, wait, @L godlike, there's no followup. This was caused by an old version of flytectl that didn't have the code necessary to parse the new array node map tasks.
Thank you!!