HumanSignal / HumanSignal/label-studio

Runtime Error: "was cancelled"

Open
#2,852 2 comments 0 reactions 1 assignee Claimed by @makseq View on GitHub
configuration problem storages
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
After updating the Label Studio, my old annotation files do not work with storage sync anymore. When I try to sync my local storage, I get Runtime Error "was cancelled". After examining the error and commits, I realized that this commit has broken my annotations -> https://github.com/heartexlabs/label-studio/commit/36de45c9af69514f7b841e8391bf0e4103b4661b by adding `cancelled_annotations = len([a for a in annotations if a['was_cancelled']])` line. I cannot find any mention of "was_cancelled" field in documentation about the json annotations for Label Studio.

**To Reproduce**
1. Go to Settings / Cloud Storage
2. Add Source Storage
3. Select local storage
4. Sync Storage

**Expected behavior**
If I understand the intention of the code correctly, I would expect either "was_cancelled" json field to be described in documentation as mandatory, or the code to create some default value for it if it is not provided instead of failing to sync my local storage, which used to work before the update.

**Stacktrace**
```
Traceback (most recent call last):
File "/home/user/anaconda3/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/user/anaconda3/lib/python3.7/site-packages/django/utils/decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "/home/user/anaconda3/lib/python3.7/site-packages/label_studio/io_storages/api.py", line 93, in post
storage.sync()
File "/home/user/anaconda3/lib/python3.7/site-packages/label_studio/io_storages/base_models.py", line 180, in sync
self.scan_and_create_links()
File "/home/user/anaconda3/lib/python3.7/site-packages/label_studio/io_storages/localfiles/models.py", line 94, in scan_and_create_links
return self._scan_and_create_links(LocalFilesImportStorageLink)
File "/home/user/anaconda3/lib/python3.7/site-packages/label_studio/io_storages/base_models.py", line 122, in _scan_and_create_links
cancelled_annotations = len([a for a in annotations if a['was_cancelled']])
File "/home/user/anaconda3/lib/python3.7/site-packages/label_studio/io_storages/base_models.py", line 122, in
cancelled_annotations = len([a for a in annotations if a['was_cancelled']])
KeyError: 'was_cancelled'
```

**Environment:**
Ubuntu 20.04, Label Studio 1.5.0post0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.