Skip to content

XTB worker error: JSON loading #949

@jaclark5

Description

@jaclark5

Describe the bug
~20% of xtb calculations result in the error:

Traceback (most recent call last):
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/qcfractalcompute/apps/helpers.py", line 81, in run_conda_subprocess
    ret = json.loads(proc_result.stdout)
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 2 (char 2)

To Reproduce
Rerun the following record

from qcportal import PortalClient
qc_client = PortalClient("[https://api.qcarchive.molssi.org:443/](https://api.qcarchive.molssi.org/)", cache_dir=".")
record = qc_client.get_records([145252038])[0]
print(record.error["error_message"])

Expected behavior
The output json file will read successfully

Additional context
The actual standard out seems to append the target json string to the xtb log output, where the latter cannot be processed as a json.

Error getting task result:
Traceback (most recent call last):
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/qcfractalcompute/apps/helpers.py", line 81, in run_conda_subprocess
    ret = json.loads(proc_result.stdout)
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/envs/qcfractal/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 2 (char 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/qcfractalcompute/compute_manager.py", line 397, in _acquire_complete_tasks
    ret[executor_label][task_id] = task.result()
  File "/opt/conda/envs/qcfractal/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/opt/conda/envs/qcfractal/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 343, in handle_exec_update
    res = self._unwrap_remote_exception_wrapper(future)
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 607, in _unwrap_remote_exception_wrapper
    result.reraise()
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/parsl/app/errors.py", line 114, in reraise
    raise v
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/parsl/app/errors.py", line 138, in wrapper
    return func(*args, **kwargs)
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/qcfractalcompute/apps/qcengine.py", line 46, in qcengine_conda_app
    return run_conda_subprocess(conda_env_name, cmd, executor_config.scratch_directory, {})
  File "/opt/conda/envs/qcfractal/lib/python3.10/site-packages/qcfractalcompute/apps/helpers.py", line 83, in run_conda_subprocess
    raise RuntimeError(f"Failed to parse JSON from subprocess stdout: {proc_result.stdout}")
RuntimeError: Failed to parse JSON from subprocess stdout: 
 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0742   0.2388   0.0696  total (au/Debye):    0.260   0.660
 dE (eV)             :    0.511
 oscillator strength :  0.11928E-02

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0823  -0.2251  -0.0200  total (au/Debye):    0.241   0.611
 dE (eV)             :    0.489
 oscillator strength :  0.98072E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.1087   0.1739  -0.0221  total (au/Debye):    0.206   0.524
 dE (eV)             :    0.488
 oscillator strength :  0.71908E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.1173  -0.1444   0.0333  total (au/Debye):    0.189   0.480
 dE (eV)             :    0.483
 oscillator strength :  0.59779E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.1183  -0.1347   0.0367  total (au/Debye):    0.183   0.465
 dE (eV)             :    0.480
 oscillator strength :  0.55701E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.1211  -0.1169   0.0385  total (au/Debye):    0.173   0.439
 dE (eV)             :    0.482
 oscillator strength :  0.49755E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.1230  -0.0846   0.0404  total (au/Debye):    0.155   0.393
 dE (eV)             :    0.485
 oscillator strength :  0.40194E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.1145   0.0302  -0.0404  total (au/Debye):    0.125   0.318
 dE (eV)             :    0.474
 oscillator strength :  0.25741E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0682  -0.0811  -0.0409  total (au/Debye):    0.114   0.289
 dE (eV)             :    0.384
 oscillator strength :  0.17155E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0232  -0.1589  -0.0472  total (au/Debye):    0.167   0.426
 dE (eV)             :    0.293
 oscillator strength :  0.28488E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0088  -0.1454  -0.0521  total (au/Debye):    0.155   0.393
 dE (eV)             :    0.226
 oscillator strength :  0.18730E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0091  -0.1295  -0.0368  total (au/Debye):    0.135   0.343
 dE (eV)             :    0.240
 oscillator strength :  0.15139E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0223  -0.2834  -0.0171  total (au/Debye):    0.285   0.724
 dE (eV)             :    0.238
 oscillator strength :  0.66754E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0127   0.2749   0.0291  total (au/Debye):    0.277   0.703
 dE (eV)             :    0.189
 oscillator strength :  0.50179E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0105   0.2497   0.0233  total (au/Debye):    0.251   0.638
 dE (eV)             :    0.187
 oscillator strength :  0.40897E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0052   0.2565   0.0140  total (au/Debye):    0.257   0.653
 dE (eV)             :    0.178
 oscillator strength :  0.40778E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0012   0.2667   0.0060  total (au/Debye):    0.267   0.678
 dE (eV)             :    0.169
 oscillator strength :  0.41758E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0093  -0.2568   0.0033  total (au/Debye):    0.257   0.653
 dE (eV)             :    0.160
 oscillator strength :  0.36647E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
   0.0173  -0.2333   0.0101  total (au/Debye):    0.234   0.595
 dE (eV)             :    0.148
 oscillator strength :  0.28170E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0174   0.2209  -0.0087  total (au/Debye):    0.222   0.564
 dE (eV)             :    0.143
 oscillator strength :  0.24391E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0155   0.2325  -0.0031  total (au/Debye):    0.233   0.592
 dE (eV)             :    0.142
 oscillator strength :  0.26757E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0134   0.2513   0.0018  total (au/Debye):    0.252   0.640
 dE (eV)             :    0.143
 oscillator strength :  0.31289E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0115   0.2772   0.0067  total (au/Debye):    0.278   0.705
 dE (eV)             :    0.143
 oscillator strength :  0.38167E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0091   0.2957   0.0106  total (au/Debye):    0.296   0.752
 dE (eV)             :    0.143
 oscillator strength :  0.43335E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0082   0.3011   0.0111  total (au/Debye):    0.301   0.766
 dE (eV)             :    0.142
 oscillator strength :  0.44706E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0074   0.2960   0.0107  total (au/Debye):    0.296   0.753
 dE (eV)             :    0.141
 oscillator strength :  0.42960E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0076   0.2887   0.0092  total (au/Debye):    0.289   0.734
 dE (eV)             :    0.140
 oscillator strength :  0.40603E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0074   0.2862   0.0088  total (au/Debye):    0.286   0.728
 dE (eV)             :    0.140
 oscillator strength :  0.39796E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0072   0.2859   0.0087  total (au/Debye):    0.286   0.727
 dE (eV)             :    0.140
 oscillator strength :  0.39643E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0071   0.2871   0.0088  total (au/Debye):    0.287   0.730
 dE (eV)             :    0.140
 oscillator strength :  0.39925E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0069   0.2879   0.0090  total (au/Debye):    0.288   0.732
 dE (eV)             :    0.140
 oscillator strength :  0.40170E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0068   0.2886   0.0091  total (au/Debye):    0.289   0.734
 dE (eV)             :    0.140
 oscillator strength :  0.40415E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0066   0.2888   0.0091  total (au/Debye):    0.289   0.735
 dE (eV)             :    0.140
 oscillator strength :  0.40575E-03

 transition dipole moment (au) for excitation:          59          60
     X       Y       Z   
  -0.0063   0.2884   0.0090  total (au/Debye):    0.289   0.734
 dE (eV)             :    0.141
 oscillator strength :  0.40609E-03
{"id": "145252038", "hash_index": null, "schema_name": "qcschema_optimization_output....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions