Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • beat.editor beat.editor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • beatbeat
  • beat.editorbeat.editor
  • Issues
  • #233
Closed
Open
Issue created Jun 19, 2019 by Zohreh MOSTAANI@zmostaaniDeveloper

An empty json file in the wrong directory format crashes the editor

If a user adds an empty json file in the wrong directory structure using file manager or command line like following:

Usually this is the correct structure: prefix/dataformats///1.json Lets make a file directly in folder so we will have: prefix/dataformats//1.json

If the editor is already open it shows it in the list of the files without giving any warning to the user. But then if you open this new json file the editor will close and this error is shown in the log:

Traceback (most recent call last):
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/widgets/assetwidget.py", line 356, in loadAsset
    self.watcher.addPath(self.current_asset.declaration_path)
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/backend/asset.py", line 208, in declaration_path
    storage = self.type.storage(self.prefix, self.name)
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/src/beat.backend.python/beat/backend/python/dataformat.py", line 77, in __init__
    raise RuntimeError("invalid dataformat name: `%s'" % name)
RuntimeError: invalid dataformat name: `zmostaani/1'
Aborted

Now if you try to run the editor again this will be the error:

Traceback (most recent call last):
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/widgets/dataformateditor.py", line 601, in <lambda>
    lambda: self.dataformat_model.setPrefixPath(self.prefix_path)
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/backend/assetmodel.py", line 182, in setPrefixPath
    self.reload()
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/backend/assetmodel.py", line 119, in reload
    json_files = _find_json_files(asset_folder)
  File "/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.editor/beat/editor/backend/assetmodel.py", line 70, in _find_json_files
    asset_items = os.scandir(path)
NotADirectoryError: [Errno 20] Not a directory: '/remote/idiap.svm/user.active/zmostaani/experiments/beat/beat.zmostaani.prefix/prefix/dataformats/zmostaani/1.json'
Aborted

Even though users are not supposed to make such problematic files but they may by accident and just having log information might not be enough. see #232 (closed)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking