https://flyte.org logo
#ask-the-community
Title
# ask-the-community
n

Nizar Hattab

10/09/2023, 8:10 AM
Hi all! I am facing issues with registering/running workflows on a remote cluster, getting this error:
Copy code
RPC Failed, with Status: StatusCode.INVALID_ARGUMENT
        details: task with different structure already exists with id resource_type:TASK project:"project_name" domain:"staging" name:"some_task_name" version:"Eg1iLWFry-AOPcFmT5AdYQ=="
One suggested solution is to archive the existing tasks. but that didn't solve the issue. I tried deleting the workflow & tasks, but
flytectl delete
doesn't delete tasks or workflows (is this intentional ?). how to properly delete registered tasks completely (no archive)? this is critical I believe CC: @L godlike @Ariel Kaspit
l

L godlike

10/09/2023, 8:13 AM
Currently, I am not really familiar with
flytectl delete
However, I know how to trace the code. You can go to
flytectl
and search for the
delete
keyword to check if it is implemented or not. It will probably communicate with
flyteadmin
, and
flyteadmin
will delete the workflows & tasks.
s

Samhita Alla

10/09/2023, 8:47 AM
We don't provide a delete API; you can only archive your tasks/workflows. We don't want you to accidentally delete the flyte entities, and hence we haven't made the API available. To resolve the error you're seeing, you'll need to modify your code or update the version if you're registering but not fast-registering.
n

Nizar Hattab

10/09/2023, 10:01 AM
thank you
what happens if I delete the task directly from database ?
s

Samhita Alla

10/09/2023, 1:09 PM
You can but that isn't guaranteed to succeed. You'll have to do that at your own risk.
k

Ketan (kumare3)

10/09/2023, 1:53 PM
Please do not alter the db
Simply use a different version
n

Nizar Hattab

10/10/2023, 11:02 PM
I believe it's necessary to have delete api. a user cant just keep archiving and creating differently-named tasks and launch plans to avoid these errors. I changed the name of the task to fix the error, now I have a different error :
Copy code
details: launch plan with different structure already exists with id resource_type:LAUNCH_PLAN
this is a bug.
s

Samhita Alla

10/11/2023, 6:19 AM
@Nizar Hattab, you don't need to change the name of your task every time; you can just update the version. If you're using
pyflyte run
or
pyflyte register
, you don't need to specify a version as Flyte automatically computes one.
n

Nizar Hattab

10/11/2023, 6:20 AM
In pyflyte run there is no —version option
When i try to do: Pyflyte run .. the previous error shows up .. meaning that the calculated id is the same as older/already existing one
s

Samhita Alla

10/11/2023, 6:24 AM
Have you modified the code when re-registering?
n

Nizar Hattab

10/11/2023, 6:24 AM
Yes
s

Samhita Alla

10/11/2023, 6:24 AM
In pyflyte run there is no —version option
Yes.
pyflyte run
fast registers, hence there's no version.
Yes
If you've, then the version must be updated.
You can try
pyflyte register --non-fast --version <your-version>
n

Nizar Hattab

10/11/2023, 6:25 AM
But isnt it supposed to be automatically assigned ?
In run, i can pass —envs while in register its not possible
s

Samhita Alla

10/11/2023, 6:26 AM
It should. I'm not sure what's happening in your case.
n

Nizar Hattab

10/11/2023, 6:26 AM
So i need to use run for development at least just to test things
s

Samhita Alla

10/11/2023, 6:26 AM
We're adding support for envs in `pyflyte register`: https://github.com/flyteorg/flyte/issues/4092
So i need to use run for development at least just to test things
Got it. Can you share the stack trace? Can you also update the code once again and share me the stack trace?
n

Nizar Hattab

10/11/2023, 6:29 AM
Just to be accurate, what code do I have to change ? Workflow file?
Lets say i have my workflow ready and tested, But the logic is in another module.. i updated the used image .. workflow and task definitions are the same . This is my case.. i dont need to update the tasks or workflow
Will send the st soon