I was running moshpit 2025.4 version and encountered the captioned problem. Below are the scripts I ran, please help.
(qiime2-moshpit-2025.4) chtang@TangLaptop:/mnt/c/Users/chtan/workshop_MCEF$ mosh assembly assemble-megahit --i-reads seq-demux.qza --p-presets "meta-sensitive" --p-num-cpu-threads 20 --o-contigs ./cache:contigs_may --verbose
/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/numpy/core/fromnumeric.py:59: FutureWarning: 'DataFrame.swapaxes' is deprecated and will be removed in a future version. Please use 'DataFrame.transpose' instead.
return bound(*args, **kwds)
/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py:105: UserWarning: The presets parameter overrides settings for the min_count and k_list parameters. The settings of min_count and k_list registered in provenance may not reflect the actual settings used by the presets parameter. Refer to the megahit documentation for more details, and refer to the presets values of these parameters when interpreting or reporting your results.
warnings.warn(warning, UserWarning)
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.
.
.
.
2025-08-24 15:13:17 - MEGAHIT v1.2.9
2025-08-24 15:13:17 - Using megahit_core with POPCNT and BMI2 support
2025-08-24 15:13:17 - Convert reads to binary library
2025-08-24 15:15:38 - b'INFO sequence/io/sequence_lib.cpp : 75 - Lib 0 (/tmp/qiime2/chtang/data/8c65e7c5-555d-4de3-8769-9ad328fabe9e/data/MJ14_3_L001_R1_001.fastq.gz,/tmp/qiime2/chtang/data/8c65e7c5-555d-4de3-8769-9ad328fabe9e/data/MJ14_24_L001_R2_001.fastq.gz): pe, 206290940 reads, 150 max length'
2025-08-24 15:15:38 - b'INFO utils/utils.h : 152 - Real: 140.7282\tuser: 73.0379\tsys: 15.5282\tmaxrss: 246384'
2025-08-24 15:15:38 - k-max reset to: 141
2025-08-24 15:15:38 - Start assembly. Number of CPU threads 20
2025-08-24 15:15:38 - k list: 21,29,39,49,59,69,79,89,99,109,119,129,141
2025-08-24 15:15:38 - Memory used: 45306338918
2025-08-24 15:15:38 - Extracting solid (k+1)-mers and building sdbg for k = 21
2025-08-24 15:37:08 - Assemble contigs from SdBG for k = 21
2025-08-24 20:05:34 - Local assembly for k = 21
2025-08-24 20:12:07 - Extract iterative edges from k = 21 to 29
2025-08-24 20:21:24 - Error occurs, please refer to /tmp/tmppkrvuilk/results/log for detail
2025-08-24 20:21:24 - Command: /home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/bin/megahit_core iterate -c /tmp/tmppkrvuilk/results/intermediate_contigs/k21.contigs.fa -b /tmp/tmppkrvuilk/results/intermediate_contigs/k21.bubble_seq.fa -t 20 -k 21 -s 8 -o /tmp/tmppkrvuilk/results/tmp/k29/29 -r /tmp/tmppkrvuilk/results/tmp/reads.lib.bin; Exit code -9
Traceback (most recent call last):
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py", line 83, in _process_sample
run_command(cmd, verbose=True)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/_utils.py", line 38, in run_command
subprocess.run(cmd, check=True)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['megahit', '-1', '/tmp/qiime2/chtang/data/8c65e7c5-555d-4de3-8769-9ad328fabe9e/data/MJ14_3_L001_R1_001.fastq.gz', '-2', '/tmp/qiime2/chtang/data/8c65e7c5-555d-4de3-8769-9ad328fabe9e/data/MJ14_24_L001_R2_001.fastq.gz', '-o', '/tmp/tmppkrvuilk/results', '--presets', 'meta-sensitive', '--min-count', '2', '--k-list', '21,29,39,59,79,99,119,141', '--bubble-level', '2', '--prune-level', '2', '--prune-depth', '2', '--disconnect-ratio', '0.1', '--low-local-ratio', '0.2', '--cleaning-rounds', '5', '--memory', '0.9', '--mem-flag', '1', '--num-cpu-threads', '20', '--min-contig-len', '200']' returned non-zero exit status 247.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 529, in call
results = self._execute_action(
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 607, in _execute_action
results = action(**arguments)
File "", line 2, in assemble_megahit
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
outputs = self.callable_executor(
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 440, in callable_executor
outputs = self._callable(ctx, **view_args)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py", line 163, in assemble_megahit
(contig,) = _assemble_megahit(seq, **kwargs)
File "", line 2, in _assemble_megahit
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/context/base.py", line 90, in callable_action
return self.dispatch(args, kwargs)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/context/base.py", line 45, in dispatch
results = exe(*args, **kwargs)
File "", line 2, in _assemble_megahit
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
outputs = self.callable_executor(
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 359, in callable_executor
output_views = self._callable(**view_args)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py", line 219, in _assemble_megahit
return assemble_megahit_helper(
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py", line 263, in assemble_megahit_helper
_process_sample(samp, fwd, rev, common_args, result)
File "/home/chtang/miniconda3/envs/qiime2-moshpit-2025.4/lib/python3.10/site-packages/q2_assembly/megahit/megahit.py", line 85, in _process_sample
raise Exception(
Exception: An error was encountered while running MEGAHIT, (return code 247), please inspect stdout and stderr to learn more.
Plugin error from assembly:
An error was encountered while running MEGAHIT, (return code 247), please inspect stdout and stderr to learn more.
See above for debug info.