Hello. I am currently a rotation student in the knight lab developing a plugin that creates a visualizer. Some strange things are happening that I believe are a result of abstract Google Drive permission errors. I believe the error pops up when I am trying to use the q2templates.render
function. I get the following error when running my plugin from the directory I'm currently developing it in, which is in a google drive folder:
/Users/daniperry/Google Drive/My Drive/UCSD/q-winter22/Knight/projects/q2-katharoseq/q2_katharoseq
Traceback (most recent call last):
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
results = action(**arguments)
File "<decorator-gen-547>", line 2, in read_count_threshold
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
outputs = self._callable_executor_(scope, callable_args,
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/site-packages/qiime2/sdk/action.py", line 453, in _callable_executor_
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/Volumes/GoogleDrive/My Drive/UCSD/q-winter22/Knight/projects/q2-katharoseq/q2_katharoseq/_methods.py", line 106, in read_count_threshold
q2templates.render(index, output_dir, context=context)
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/site-packages/q2templates/_templates.py", line 64, in render
shutil.copy2(source_file, temp_dir.name)
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/shutil.py", line 436, in copy2
copystat(src, dst, follow_symlinks=follow_symlinks)
File "/Users/daniperry/anaconda3/envs/qiime2-2021.11/lib/python3.8/shutil.py", line 396, in copystat
lookup("chflags")(dst, st.st_flags, follow_symlinks=follow)
PermissionError: [Errno 1] Operation not permitted: '/var/folders/pv/hg29j3j512d8wd_qw_8g3msw0000gn/T/tmp_lx1kfxs/index.html'
Plugin error from katharoseq:
[Errno 1] Operation not permitted: '/var/folders/pv/hg29j3j512d8wd_qw_8g3msw0000gn/T/tmp_lx1kfxs/index.html'
See above for debug info.
When I move the whole directory outside the google drive it works seamlessly. When I specify an --o-visualization
parameter outside the development directory the problem is NOT solved.
To reproduce the error you may be able to simply create two files in the same directory INSIDE a google drive folder:
test_error.py:
# test_error.py
import q2templates
index = 'index.html'
output_dir = '.'
q2templates.render(index, output_dir)
index.html:
{% extends 'base.html' %}
{% block content %}
<h1>Katharoseq Protocol</h1>
<div class="row">
<div class="col-lg-12">
<div class="text-center">
<div>
<p>Here is a piece of text</p>
</div>
</div>
</div>
</div>
{% endblock %}
Running python test_error.py
inside a google drive directory will throw the above error and running it outside a google drive directory will throw no errors.
Mainly I just want to be able to keep the development within my google drive and am unsure why exactly this is posing a problem.
Thanks so much for your help!