qiime2 2023.2 dada2: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Hi, thanks for seeing this. I’m using qiime2-2023.2 in Linux. I run dada2 with this command:
time qiime dada2 denoise-paired
–i-demultiplexed-seqs demux.qza
–p-trim-left-f 0
–p-trim-left-r 0
–p-trunc-len-f 250
–p-trunc-len-r 250
–o-table table.qza
–o-representative-sequences rep-seqs.qza
–o-denoising-stats denoising-stats.qza
I got this error:
Plugin error from dada2:
An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.
The log file:
Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_dada.R --input_directory /tmp/tmpxc98kpvi/forward --input_directory_reverse /tmp/tmpxc98kpvi/reverse --output_path /tmp/tmpxc98kpvi/output.tsv.biom --output_track /tmp/tmpxc98kpvi/track.tsv --filtered_directory /tmp/tmpxc98kpvi/
filt_f --filtered_directory_reverse /tmp/tmpxc98kpvi/filt_r --truncation_length 250 --truncation_length_reverse 250 --trim_left 0 --trim_left_reverse 0 --max_expected_errors 2.0 --max_expected_errors_reverse 2.0 --truncation_quality_score 2
--min_overlap 12 --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 1000000

Warning message:
package ‘optparse’ was built under R version 4.2.1
R version 3.6.1 (2019-07-05)
Loading required package: Rcpp
Error: package or namespace load failed for ‘dada2’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/R/library/rlang/libs/rlang.so':
/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/R/library/rlang/libs/rlang.so: undefined symbol: R_ActiveBindingFunction
8: stop(msg, call. = FALSE, domain = NA)
7: value[3L]
6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
4: tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1L])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s",
sQuote(package), P, conditionMessage(e))
if (logical.return)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
})
3: library(dada2)
2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
1: suppressWarnings(library(dada2))
Traceback (most recent call last):
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 326, in denoise_paired
run_commands([cmd])
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
subprocess.run(cmd, check=True)
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/tmpxc98kpvi/forward', '--input_directory_reverse', '/tmp/tmpxc98kpvi/reverse', '--output_path', '/tmp/tmpxc98kpvi/output.tsv.biom', '--output_track', '/tmp/tmp
xc98kpvi/track.tsv', '--filtered_directory', '/tmp/tmpxc98kpvi/filt_f', '--filtered_directory_reverse', '/tmp/tmpxc98kpvi/filt_r', '--truncation_length', '250', '--truncation_length_reverse', '250', '--trim_left', '0', '--trim_left_reverse',
'0', '--max_expected_errors', '2.0', '--max_expected_errors_reverse', '2.0', '--truncation_quality_score', '2', '--min_overlap', '12', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allo
w_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in callable_executor
output_views = self._callable(**view_args)
File "/home/u21111510052/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 339, in denoise_paired
raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.
I don’t know why this happened. I did some attempts and did not find a suitable solution.
Can anyone help me?
Thank you very much!

Hello @sj_Liu, do you have R installed on your computer outside of the QIIME 2 conda environment? Maybe with RStudio or something? I ask because it looks like dada2 was expecting R version 4.2.1 or newer but got R 3.6.1.

Can you run echo $PATH and post the result here?

2 Likes

thank you
This is the result i run echo $PATH
/home/u21111510052/miniconda3/envs/qiime2-2023.2/bin:/opt/app/r/r4.2.2.1/bin/R:/home/u21111510052/blast/ncbi-blast-2.12.0+/bin:/home/u21111510052/miniconda3/bin:/home/u21111510052/miniconda3/condabin:.:/bin:/opt/app/r/gcc/gcc-9.3.0/bin:/opt/app/r/gcc/gcc-9.3.0/sbin:/opt/app/r/r/bin:/opt/app/r/gcc/gcc-9.3.0/bin:/opt/app/r/gcc/gcc-9.3.0/sbin:/opt/app/spack/bin:/opt/app/spack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/nvidia/bin:/opt/app/r/gcc/gcc-9.3.0/bin:/opt/app/r/gcc/gcc-9.3.0/sbin:/opt/app/spack/bin:/opt/app/spack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/app/conda/bin:/home/public/env/pub_conda_envs/bin:/home/public/software/softwares/cellranger/cellranger-7.1.0:/home/public/software/wfz_scripts:/home/public/software/miniconda2/bin:/home/public/alphafold:/home/public/env:/home/u21111510052/.local/bin:/home/u21111510052/bin:/home/u21111510052/HMMer/hmmer
yesterday i updated my R version

@sj_Liu are you still getting the error after updating R? It looks like your conda environment binaries are the first thing in your path, and it looks like the only version of R there is 4.2.2.1.

1 Like

yes , i have solved the problem now,thank you for your reply and help!thank you!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.