question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to create task from zip archive located in connected shared folder

See original GitHub issue

My actions before raising this issue

  • Read/searched the docs
  • Searched past issues

Permission error occurs when selected zip archive located on connected file share

Expected Behaviour

Task is created successfully.

Current Behaviour

Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/opt/venv/lib/python3.8/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/home/django/cvat/apps/engine/task.py", line 257, in _create_thread
    extractor = MEDIA_TYPES[media_type]['extractor'](
  File "/home/django/cvat/apps/engine/media_extractors.py", line 187, in __init__
    self._zip_source = zipfile.ZipFile(source_path[0], mode='a')
  File "/usr/lib/python3.8/zipfile.py", line 1251, in __init__
    self.fp = io.open(file, filemode)
PermissionError: [Errno 13] Permission denied: '/home/django/share/data/test.zip'

Possible Solution

Steps to Reproduce (for bugs)

  1. Try to create a task with zip archive located in connected share

Context

Your Environment

Next steps

You may join our Gitter channel for community support.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tralfamadudecommented, Feb 26, 2021

I have this same error when using png files (no zip). After I created a share that maps to a host level dir, I made a bash shell in the container to look at /home/django/share running as user django; surprisingly, I could not list the dir and the ownership was unusual:

drwxrwxr-- 3 1004 128 4096 Feb 26 00:29 share

Obviously, if a user and group show up as numbers here, that means they are not defined. It turns out, these numbers correspond to my account from the host OS. I made that directory world readable and the group is “docker”.

I tried to change these from inside the container, but that produces an error about read-only fs.

WORKAROUND: host level directory (the share) must have world permission 5. Example: chmod -R 775 /mnt/share

Please update documentation about setting up the share to include this info!

0reactions
azhavorocommented, Mar 25, 2021

@azhavoro thanks for responding. It would not hurt to state that 755 chmod bits are recommended. This seems like a docker level issue, I don’t see how processes in the container can get around it since I could not list the bound dir as root inside the container without 775 chmod bits.

Probably you mounted share in the ro mode as described in the installation guide https://github.com/openvinotoolkit/cvat/blob/develop/cvat/apps/documentation/installation.md#share-path.

Read level is not enough if one wants to use subdirectories; execute is needed to list dirs. I organize images by task and name a directory with the task name; this makes it easy to clean up after a task is finished.

Of course the execute bit is needed for directories, I mean read permission as docker mode for the mounted volumes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to create task from zip archive located in connected ...
Try to create a task with zip archive located in connected share ... I made that directory world readable and the group is...
Read more >
Not able to create a Zip archive in Gradle - Stack Overflow
Try something like this (docs): task zip(type:Zip) { from ('resources/') include '*.js' into 'resources' // note that this specifies path ...
Read more >
Can't copy files from mapped drive to local directory
Use a UNC path to connect to network resources, for example, \\server\share. Use Group Policy Preferences to map drives. The white paper ...
Read more >
7 Ways to Fix the “Compressed (Zipped) Folder Is Invalid ...
1. Reinstall the File Compression Tool · Press Win + R to open the Run command dialog box. · Type appwiz.cpl and click...
Read more >
Zip and unzip files and folders on Mac - Apple Support
On your Mac, do any of the following: Compress a file or folder: Control-click it or tap it using two fingers, then choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found