About fmriPrep, it showed the "sqlite3.OperationalError: database is locked"

Summary of what happened:

Command used (and if a helper script was used, a link to the helper script or the command generated):

I ran the following code:

sudo docker run --rm \
    -ti \
    -v /media/share/Member/eden/retinotopy:/data:ro \
    -v /media/share/Member/eden/retinotopy/step1:/out \
    -v /media/share/Member/eden/retinotopy/work:/work \
    -v /home/eden/license.txt:/opt/freesurfer/license.txt \
    --shm-size="10g" \
    nipreps/fmriprep:latest \
    /data /out participant \
    --fs-license-file /opt/freesurfer/license.txt \
    --use-aroma \
    --notrack \
    --output-spaces T1w MNI152NLin2009cAsym:res-2 \
    --fs-no-reconall \
    --use-syn-sdc \
    --nthreads 16 \
    --mem_mb 32000 \
    --work-dir /work \
    --skip_bids_validation

Version:

Environment (Docker, Singularity, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

Relevant log outputs (up to 20 lines):

However, I encountered the following issue:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/bin/fmriprep", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/run.py", line 43, in main
    parse_args()
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/parser.py", line 775, in parse_args
    config.from_dict({})
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/config.py", line 675, in from_dict
    execution.load(settings, init=initialize('execution'), ignore=ignore)
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/config.py", line 232, in load
    cls.init()
  File "/opt/conda/lib/python3.9/site-packages/fmriprep/config.py", line 476, in init
    cls._layout = BIDSLayout(
  File "/opt/conda/lib/python3.9/site-packages/bids/layout/layout.py", line 149, in __init__
    self.connection_manager = ConnectionManager(
  File "/opt/conda/lib/python3.9/site-packages/bids/layout/db.py", line 45, in __init__
    self.reset_database(init_args, config)
  File "/opt/conda/lib/python3.9/site-packages/bids/layout/db.py", line 104, in reset_database
    Base.metadata.create_all(self.engine)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/schema.py", line 4664, in create_all
    bind._run_visitor(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2095, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1656, in _run_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 145, in traverse_single
    return meth(obj, **kw)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 783, in visit_metadata
    self.traverse_single(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 145, in traverse_single
    return meth(obj, **kw)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 827, in visit_table
    self.connection.execute(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1068, in _execute_ddl
    ret = self._execute_context(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: 
CREATE TABLE layout_info (
	root VARCHAR NOT NULL, 
	absolute_paths BOOLEAN, 
	_derivatives VARCHAR, 
	_config VARCHAR, 
	PRIMARY KEY (root), 
	CHECK (absolute_paths IN (0, 1))
)

]
(Background on this error at: http://sqlalche.me/e/13/e3q8)

Screenshots / relevant information:


In the past several times, this code was working!
Btw, I used control+c to stop the preprocessing many times.
Then tried again, and it showed this error.

I had tried “sudo rm the dataset and bulid a new one again”
or gave the permission “chmod 777”

But it still happened.

I have moved this to the software support category and copied the template above your message.

Also this is a duplicate of sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked · Issue #2313 · nipreps/fmriprep · GitHub. It seems likely to happen if you’re using a Windows network share as your work directory. If that is happening, you can try passing an explicit --bids-database-dir flag to a local directory.

Thank you for your response and for helping me adjust the information.
My working directory is on the mounted server.
I tried using --bids-database-dir and set it to a local directory, and this method worked!
Thank you again.