{"record":{"id":"098c4c55edbdddc2","repo":"locustio/locust","slug":"no-tag-name-was-supplied","errorCode":null,"errorMessage":"No tag name was supplied","messagePattern":"No tag name was supplied","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"locust/user/task.py","lineNumber":139,"sourceCode":"                pass\n\n            @tag('post')\n            @task(11)\n            def comment(self):\n                pass\n    \"\"\"\n\n    def decorator_func(decorated):\n        if hasattr(decorated, \"tasks\"):\n            decorated.tasks = list(map(tag(*tags), decorated.tasks))\n        else:\n            if \"locust_tag_set\" not in decorated.__dict__:\n                decorated.locust_tag_set = set()\n            decorated.locust_tag_set |= set(tags)\n        return decorated\n\n    if len(tags) == 0 or callable(tags[0]):\n        raise ValueError(\"No tag name was supplied\")\n\n    return decorator_func\n\n\ndef get_tasks_from_base_classes(bases, class_dict):\n    \"\"\"\n    Function used by both TaskSetMeta and UserMeta for collecting all declared tasks\n    on the TaskSet/User class and all its base classes\n    \"\"\"\n    new_tasks = []\n    for base in bases:\n        if hasattr(base, \"tasks\") and base.tasks:\n            new_tasks += base.tasks\n\n    if \"tasks\" in class_dict and class_dict[\"tasks\"] is not None:\n        tasks = class_dict[\"tasks\"]\n        if isinstance(tasks, dict):\n            tasks = tasks.items()","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/locustio/locust/blob/f391a716e12c2c712e80b5835e877b7933397453/locust/user/task.py#L121-L157","documentation":"The @tag decorator requires at least one tag string argument. Calling @tag with no arguments (and not directly decorating a function) raises ValueError.","triggerScenarios":"@tag with an empty argument list, e.g. `@tag()` or bare `@tag` where the first positional arg is a callable (function) instead of a tag string.","commonSituations":"Typo like `@tag` instead of `@task`, or `@tag()` left without tag names when filtering tasks with --tags.","solutions":["Supply at least one tag name: @tag(\"smoke\")","If you meant @task, use @task instead","Remove the decorator if no tagging is needed"],"exampleFix":"// before\n@tag()\ndef my_task(self):\n    ...\n// after\n@tag(\"smoke\")\ndef my_task(self):\n    ...","handlingStrategy":"validation","validationCode":"assert tags and all(isinstance(t, str) for t in tags), \"@tag requires at least one tag name\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass explicit string tags","Don't stack @tag and @task in the wrong order (@task under @tag)"],"tags":["python","locust","decorator","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"f391a716e12c2c712e80b5835e877b7933397453","analyzedAt":"2026-08-29T00:36:13.872Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}