Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error deleting a task ("Task deletion failed: 'url'") #1355

Open
morzahavi opened this issue Dec 2, 2024 · 2 comments
Open

Error deleting a task ("Task deletion failed: 'url'") #1355

morzahavi opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@morzahavi
Copy link

Bug description

When I try to delete a task I get an error, for which I could not find a documentation or explanation.

MWE

from clearml import Task
project_tasks = Task.get_tasks(project_name='project_name')

for task in project_tasks:

    if task.name == "task_name":
        task.delete(delete_artifacts_and_models=True, 
        raise_on_error=False, callback=None, skip_models_used_by_other_tasks=False)

Expected

I was able to delete other tasks with the same name, but for some I got this error message:

2024-12-02 10:19:04,364 - clearml.Task - ERROR - Task deletion failed: 'url'

Environment

  • Python Version 3.10
  • OS: Linux, Ubuntu 24.04.1 LTS

Related Discussion

#632

@morzahavi morzahavi added the bug Something isn't working label Dec 2, 2024
@eugen-ajechiloae-clearml
Copy link
Collaborator

Hi @morzahavi ! It might be that there is an invalid artifact that is somehow creating problems. Can you try passing raise_on_error=True? There could be more information in the stack trace.

@morzahavi
Copy link
Author

raise_on_error=True

Thanks for your reply. Here is the output:

{
	"name": "DeleteError",
	"message": "Task deletion failed: 'url'",
	"stack": "---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/.venv/lib/python3.10/site-packages/clearml/backend_interface/task/task.py:844, in Task._delete(self, delete_artifacts_and_models, skip_models_used_by_other_tasks, raise_on_error, callback)
    838 event_uris = []
    839 event_uris.extend(
    840     [
    841         x
    842         for x in filter(
    843             None,
--> 844             self._get_all_events(
    845                 event_type=\"training_debug_image\",
    846                 unique_selector=itemgetter(\"url\"),
    847                 batch_size=10000,
    848             ),
    849         )
    850         if not callback or callback(\"debug_images\", x)
    851     ]
    852 )
    854 event_uris.extend(
    855     [x for x in filter(None, self._get_image_plot_uris()) if not callback or callback(\"image_plot\", x)]
    856 )

File ~/.venv/lib/python3.10/site-packages/clearml/backend_interface/task/task.py:2886, in Task._get_all_events(self, max_events, batch_size, order, event_type, unique_selector)
   2885     events_list = set([])
-> 2886     apply_unique_selector(events_list, log_events.response.events)
   2887 else:

File ~/.venv/lib/python3.10/site-packages/clearml/backend_interface/task/task.py:2867, in Task._get_all_events.<locals>.apply_unique_selector(events_set, evs)
   2866 try:
-> 2867     events_set.update(map(unique_selector, evs))
   2868 except TypeError:

KeyError: 'url'

During handling of the above exception, another exception occurred:

DeleteError                               Traceback (most recent call last)
Cell In[8], line 5
      3 for task in project_tasks:
      4     if task.name == \"task_name\" and task.id == \"6bd7f31e6861404c8012e45b754f72c1\":
----> 5         task.delete(delete_artifacts_and_models=True, raise_on_error=True, callback=None, skip_models_used_by_other_tasks=False)

File ~/.venv/lib/python3.10/site-packages/clearml/task.py:2398, in Task.delete(self, delete_artifacts_and_models, skip_models_used_by_other_tasks, raise_on_error, callback)
   2379 \"\"\"
   2380 Delete the task as well as its output models and artifacts.
   2381 Models and artifacts are deleted from their storage locations, each using its URI.
   (...)
   2395 :return: True if the task was deleted successfully.
   2396 \"\"\"
   2397 if not running_remotely() or not self.is_main_task():
-> 2398     return super(Task, self)._delete(
   2399         delete_artifacts_and_models=delete_artifacts_and_models,
   2400         skip_models_used_by_other_tasks=skip_models_used_by_other_tasks,
   2401         raise_on_error=raise_on_error,
   2402         callback=callback,
   2403     )
   2404 return False

File ~/.venv/lib/python3.10/site-packages/clearml/backend_interface/task/task.py:877, in Task._delete(self, delete_artifacts_and_models, skip_models_used_by_other_tasks, raise_on_error, callback)
    875 except Exception as ex:
    876     if raise_on_error:
--> 877         raise self.DeleteError(\"Task deletion failed: {}\".format(ex))
    878     self.log.error(\"Task deletion failed: {}\".format(ex))
    879     return False

DeleteError: Task deletion failed: 'url'"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants