PermissionError [Errno 1] something went wrong with q2cli

Now whatever command I run QIIME will report as follow:

PermissionError: [Errno 1] Operation not permitted: '/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2020.2/var/q2cli/cache/completion.sh'

Is there any way I can solve this issue? thanks in advance.

This error first occurred when I ran commands to do rPCA, after that every command I ran came with the same error.

I googled this error but couldn't find an answer so I deleted and redownloaded QIIME2.

That solved the problem to do rPCA but again, when I used it to do phylo-RPCA this error just pumped out and everything lost control...

@jjj33,

From the path to your environment, it looks like you are running an older version of QIIME2, if it is possible for you to upgrade to the latest version(you can keep your old one right where it is, so you can always go back to it if you are not happy with the upgrade :slightly_smiling_face:) and try again? I am not aware of a specific bug that has caused this for users in the past, but we work hard to keep dependencies up to date and our code maintained, so there is a good chance we have fixed this, whether on purpose or not(:joy:) since the version you have was released. Here is the link to the install instructions, just perform a fresh conda install that is appropriate for your system, you don't have to worry about uninstalling your old version, as it lives in its own conda environment.

If upgrading is not possible, could you run qiime info and conda list, and ls -lA and post the results here? Run these commands from where you are running your QIIME 2 commands, with your conda environment activated.

I suspect upgrading will do the trick, but if not let's work through what is going on! Welcome to the QIIME 2 forum! :confetti_ball:

1 Like

Hi thanks for helping.
I installed the QIIME2 2022.2 version and still encountered this error:

PermissionError: [Errno 1] Operation not permitted: '/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/var/q2cli/cache/completion.sh'

Now this time when I run:

conda activate qiime2-2022.2

The system will give the same error, while I still can activate qiime2-2022.2:

(base) conda activate qiime2-2022.2
QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
Traceback (most recent call last):
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/bin/qiime", line 11, in
sys.exit(qiime())
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 781, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 700, in make_context
self.parse_args(ctx, args)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/click/command.py", line 43, in parse_args
return super().parse_args(ctx, args)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 1209, in parse_args
echo(ctx.get_help(), color=ctx.color)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 570, in get_help
return self.command.get_help(self)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 975, in get_help
self.format_help(ctx, formatter)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/click/core.py", line 1003, in format_help
self.format_options(ctx, formatter)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/click/command.py", line 157, in format_options
for subcommand in self.list_commands(ctx):
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 92, in list_commands
plugins = sorted(self._plugin_lookup)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
import q2cli.core.cache
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/core/cache.py", line 285, in
CACHE = DeploymentCache()
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/core/cache.py", line 61, in init
self._state = self._get_cached_state(refresh=refresh)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
self._cache_current_state(current_requirements)
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/core/cache.py", line 221, in _cache_current_state
q2cli.core.completion.write_bash_completion_script(
File "/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/lib/python3.8/site-packages/q2cli/core/completion.py", line 55, in write_bash_completion_script
os.chmod(path, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
PermissionError: [Errno 1] Operation not permitted: '/lustre1/g/aos_shihuang/tools/anaconda3/envs/qiime2-2022.2/var/q2cli/cache/completion.sh'

However, after that, whatever instruction I give my system will return the same error without further response.

Can you look and see what version of Conda you are using? conda --version

Also, are you running this on a cluster? What OS is it installed under?

the version of conda is 22.9.0

The commands were run on a server and the OS is Linux

Ok, I am afraid you are going to need to contact your sys-admin, as I think this is a permissions issue on the machine you are running it on. The assumption QIIME 2 operates under is that it will be installed using on a user level installation(as opposed to global/machine wide installation) of conda. Unfortunately, I am not sure how much help we will be on here, though if your sys-admin has questions about how to get it setup, feel free to post those questions here. It may be the case that other users who have run into this issue on their clusters might be able to provide some feedback as well!

Okay, thanks anyway!

1 Like