v5.0.7 – Instance Testing / Benchmark job fails with AttributeError: 'str' object has no attribute 'stat' when benchmark data is missing
Hi all,
I previously encountered/documented this issue against CryoSPARC v5.0.4 and it appears to still be present in v5.0.7.
Environment
- CryoSPARC version: v5.0.7
- Worker revision:
dfcba2f3ac0fe600b22b97895e9ca25abbffcee7 - Deployment: Master + worker on shared
/gpfs/shared/filesystem(GPFS) - Project directory:
/gpfs/shared/filesystem/test/CS-dev-2026-09 - Benchmark directory:
/gpfs/shared/filesystem/test/CS-dev-2026-09/benchmark_data
Issue
When the expected benchmark_data directory does not exist, the Instance Testing / Benchmark job correctly detects that the benchmark data is missing and attempts to automatically download it.
However, the automatic download fails with:
AttributeError: 'str' object has no attribute 'stat'
The job output first reports:
Benchmark data not found: Benchmark directory /gpfs/shared/filesystem/test/CS-dev-2026-09/benchmark_data is not a directory.. Downloading now...
It then attempts to download:
https://s3.us-east-1.wasabisys.com/cryosparc-performance-benchmark-data/performance_benchmark_data_v1.tar.gz
and fails with the following traceback:
Traceback (most recent call last):
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/compute/jobs/instance_testing/run.py", line 217, in run_benchmarks
benchmark_data_dir = get_benchmark_dir(proj_dir_abs, params.benchmark_data_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/compute/jobs/instance_testing/run.py", line 1099, in get_benchmark_dir
assert os.path.isdir(benchmark_data_dir), f"Benchmark directory {benchmark_data_dir} is not a directory."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Benchmark directory /gpfs/shared/filesystem/test/CS-dev-2026-09/benchmark_data is not a directory.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "cli/run.py", line 106, in cli.run.run_job
File "cli/run.py", line 211, in cli.run.run_job_function
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/compute/jobs/instance_testing/run.py", line 221, in run_benchmarks
benchmark_data_dir = rc.download_benchmark_test_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/core/run_context.py", line 517, in download_benchmark_test_data
return benchmarks.download_benchmark_test_data(self.get_job(), url, download_dir, download_basename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/core/benchmarks.py", line 108, in download_benchmark_test_data
tarball_path = download_file(
^^^^^^^^^^^^^^
File "/gpfs/shared/filesystem/home/svcacct_homedir/cryosparc_worker/core/benchmarks.py", line 163, in download_file
if os.path.isfile(dest) and dest.stat().st_size == total_bytes:
^^^^^^^^^
AttributeError: 'str' object has no attribute 'stat'
The failure occurs in:
cryosparc_worker/core/benchmarks.py
at approximately line 163:
if os.path.isfile(dest) and dest.stat().st_size == total_bytes:
dest is a str, but .stat() is being called as though it were a pathlib.Path object.
This is the same underlying error as in v5.0.4.
Workaround
I was able to work around the issue by manually downloading the benchmark dataset and placing it in the expected benchmark_data directory.
For example:
/gpfs/shared/filesystem/test/CS-dev-2026-09/benchmark_data
The problem therefore appears to be specifically with the automatic benchmark-data download path, rather than the benchmark dataset itself.
Possible fix
The problematic line:
if os.path.isfile(dest) and dest.stat().st_size == total_bytes:
could presumably be changed to either:
if os.path.isfile(dest) and os.stat(dest).st_size == total_bytes:
or by ensuring dest is converted to a pathlib.Path before calling .stat().
It would also be helpful if the benchmark setup/download logic provided a clearer indication of the expected directory structure when benchmark data is missing.
Happy to provide additional logs or test a patched version.
Thanks!