# R2d2 error: "bias\_correction" not exist in database

**URL:** <https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586>\
**Category:** JEDI\
**Created:** [May 22, 2024, 1:52am UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586 "2024-05-22T01:52:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![guoqing](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/guoqing/32/188_2.png) [@guoqing](https://forums.jcsda.org/u/guoqing)\
**Post date:** [May 22, 2024, 1:52am UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/1 "2024-05-22T01:52:50Z")

</div>

Hi,

I am trying to run a few Skylab v8.0 experiments on Orion. However, lots of them stopped at getting observations. The output showed r2d2 errors as below:

Could you help me with this?  
Thanks,  
Guoqing

````auto
Window begin = 2021-07-31T21:00:00Z
Window end = 2021-08-01T03:00:00Z
2024-05-22 01:42:23,786 - INFO - r2d2.r2d2_index - Using intel as the compiler
2024-05-22 01:42:23,944 - INFO - r2d2.r2d2_index - Using orion-intel as the compute_host
2024-05-22 01:42:24,142 - INFO - r2d2.r2d2_data - Fetching data file from the r2d2-archive-msu data store
2024-05-22 01:42:24,300 - INFO - r2d2.util.file_util - Creating symlink from /work2/noaa/jcsda/role-jcsda/r2d2-archive-msu/observation/20210731T210000Z/7611.nc4 to /work2/noaa/wrfruc/gge/skylab/8.0/workdir/d6d064/20210801T000000Z/obs/obs.amsua_n18.20210801T000000Z.nc4
Traceback (most recent call last):
  File "/work2/noaa/wrfruc/gge/skylab/8.0/ecflow/d6d064/an/obs/getObservationsRun.py", line 66, in <module>
    R2D2Data.fetch(
  File "/work2/noaa/wrfruc/gge/skylab/8.0/jedi-bundle/r2d2/src/r2d2/r2d2_data.py", line 638, in fetch
    raise err.RecordNotFound(item, query, values)
r2d2.error.RecordNotFound.RecordNotFound: 
Record does not exist in MySQL Database.
Table Name: bias_correction
Query:
SELECT * FROM `bias_correction` WHERE `date` = 2021-07-31 18:00:00 AND `file_type` = obsbias_coefficients AND `experiment_index` = 351 AND `file_extension_index` = 163 AND `model_index` = 3 AND `observation_type_index` = 1237 AND `provider_index` = 134
+ ERROR
+ set +e
+ timestamp ewok_end_job
++ date '+%Y-%m-%d %H:%M:%S'
+ echo 'ewok_end_job: 2024-05-22 01:42:25'
ewok_end_job: 2024-05-22 01:42:25
++ date +%Y-%m-%dT%H:%M:%S
+ STATS='2024-05-22T01:42:18 2024-05-22T01:42:25 1 1 1 2021-08-01T00:00:00Z /d6d064/an/obs/getObservationsamsua_n18 R2D2'
+ echo 2024-05-22T01:42:18 2024-05-22T01:42:25 1 1 1 2021-08-01T00:00:00Z /d6d064/an/obs/getObservationsamsua_n18 R2D2
+ wait
+ ecflow_client --abort=trap
+ trap 0
+ exit 0```
````

---

<div class="post-metadata">

**Author:** ![fabiolrdiniz](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/fabiolrdiniz/32/88_2.png) [@fabiolrdiniz](https://forums.jcsda.org/u/fabiolrdiniz)\
**Post date:** [May 22, 2024, 2:17am UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/2 "2024-05-22T02:17:51Z")

</div>

Hi @guoqing. Thanks for pointing that out. Currently, I see that we have BC files starting on 2021-08-01T00Z for these observing systems:

```auto
model experiment provider date      
gfs oper noaa 2021-08-01 mhs_metop-a
                             2021-08-01 mhs_metop-b
                             2021-08-01 mhs_metop-c
                             2021-08-01 mhs_n18
                             2021-08-01 mhs_n19
                             2021-08-01 amsua_aqua
                             2021-08-01 amsua_n15
                             2021-08-01 amsua_n18
                             2021-08-01 amsua_n19
                             2021-08-01 amsua_metop-a
                             2021-08-01 amsua_metop-b
                             2021-08-01 amsua_metop-c
                             2021-08-01 atms_n20
                             2021-08-01 atms_npp
                             2021-08-01 cris-fsr_npp
                             2021-08-01 cris-fsr_n20
                             2021-08-01 iasi_metop-a
                             2021-08-01 iasi_metop-b
                             2021-08-01 iasi_metop-c
                             2021-08-01 abi_g16_bt_64km
                             2021-08-01 abi_g17_bt_64km

```

We might be able to populate the ones for the previous cycle, which are the ones you are trying to start your experiment from (2021-07-31T18Z). Have you tried to start your experiment on the next cycle?

---

<div class="post-metadata">

**Author:** ![guoqing](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/guoqing/32/188_2.png) [@guoqing](https://forums.jcsda.org/u/guoqing)\
**Post date:** [May 22, 2024, 3:28am UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/3 "2024-05-22T03:28:45Z")

</div>

Thanks for the help, Fabio!

I tried the next cycle, but still got the “record not exist” error:

```auto
Window begin = 2021-08-01T03:00:00Z
Window end = 2021-08-01T09:00:00Z
2024-05-22 03:23:05,149 - INFO - r2d2.r2d2_index - Using intel as the compiler
2024-05-22 03:23:05,306 - INFO - r2d2.r2d2_index - Using orion-intel as the compute_host
2024-05-22 03:23:05,503 - INFO - r2d2.r2d2_data - Fetching data file from the r2d2-archive-msu data store
2024-05-22 03:23:05,661 - INFO - r2d2.util.file_util - Creating symlink from /work2/noaa/jcsda/role-jcsda/r2d2-archive-msu/observation/20210801T030000Z/10012.nc4 to /work2/noaa/wrfruc/gge/skylab/8.0/workdir/4b0866/20210801T060000Z/obs/obs.amsua_n18.20210801T060000Z.nc4
Traceback (most recent call last):
  File "/work2/noaa/wrfruc/gge/skylab/8.0/ecflow/4b0866/an/obs/getObservationsRun.py", line 66, in <module>
    R2D2Data.fetch(
  File "/work2/noaa/wrfruc/gge/skylab/8.0/jedi-bundle/r2d2/src/r2d2/r2d2_data.py", line 638, in fetch
    raise err.RecordNotFound(item, query, values)
r2d2.error.RecordNotFound.RecordNotFound: 
Record does not exist in MySQL Database.
Table Name: bias_correction
Query:
SELECT * FROM `bias_correction` WHERE `date` = 2021-08-01 00:00:00 AND `file_type` = obsbias_coefficients AND `experiment_index` = 351 AND `file_extension_index` = 163 AND `model_index` = 3 AND `observation_type_index` = 1237 AND `provider_index` = 134
+ ERROR
+ set +e
+ timestamp ewok_end_job
++ date '+%Y-%m-%d %H:%M:%S'
+ echo 'ewok_end_job: 2024-05-22 03:23:07'

```

---

<div class="post-metadata">

**Author:** ![ericlingerfelt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/ericlingerfelt/32/183_2.png) [@ericlingerfelt](https://forums.jcsda.org/u/ericlingerfelt)\
**Post date:** [May 22, 2024, 1:42pm UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/4 "2024-05-22T13:42:33Z")

</div>

Hi @guoqing, It looks like you are using `provider = 'noaa_upgraded'` in the code snippet above. Please change this to `provider = 'noaa'`. Thank you, Eric

---

<div class="post-metadata">

**Author:** ![guoqing](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/guoqing/32/188_2.png) [@guoqing](https://forums.jcsda.org/u/guoqing)\
**Post date:** [May 22, 2024, 2:53pm UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/5 "2024-05-22T14:53:17Z")

</div>

@ericlingerfelt Thanks! Could you help me to make this change? I don’t know which file should be modified.

---

<div class="post-metadata">

**Author:** ![guoqing](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/guoqing/32/188_2.png) [@guoqing](https://forums.jcsda.org/u/guoqing)\
**Post date:** [May 22, 2024, 3:00pm UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/6 "2024-05-22T15:00:29Z")

</div>

OK, it looks like I found “noaa\_upgraded” by doing a grep under skylab/:  
(Many experiments use “noaa-upgraded”)

```auto
(venv) [Orion-login-1 skylab]$ grep 'noaa_upgraded' * -ir
experiments/gfs-envar-fgat-c384.yaml:init_provider_obsbias: noaa_upgraded
experiments/mpas-3dvar-480km.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-3dvar-c384-gsicov.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-4denvar-c384.yaml:init_provider_obsbias: noaa_upgraded
experiments/mpas-4denvar-480km.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-atm-land.yaml:init_provider_obsbias: noaa_upgraded
experiments/mpas-3dvar-120km.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-aero-weather.yaml:init_provider_obsbias: noaa_upgraded
experiments/mpas-3denvar-15-3km.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-3dvar-c384-bumpcov.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-3dvar-c96.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-atm-land-small.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-hofx4d-c768.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-hofx-c12.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-hofx4d-c96.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-trace-gas.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-hofx3d-c384.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-mpas-fullDA.yaml:init_provider_obsbias: noaa_upgraded
experiments/coupled-gfs-mom6-hofx.yaml:init_provider_obsbias: noaa_upgraded
experiments/gfs-hofx3d-c768.yaml:init_provider_obsbias: noaa_upgraded
experiments/skylab-ufs-fullDA.yaml:init_provider_obsbias: noaa_upgraded

```

---

<div class="post-metadata">

**Author:** ![guoqing](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/guoqing/32/188_2.png) [@guoqing](https://forums.jcsda.org/u/guoqing)\
**Post date:** [May 22, 2024, 3:16pm UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/7 "2024-05-22T15:16:43Z")

</div>

After I changed the provider to noaa and the init\_cycle date to 2021-08-01T06:00:00Z, the workflow just passed the “obs” step.

Thanks all for the help!

---

<div class="post-metadata">

**Author:** ![ericlingerfelt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/ericlingerfelt/32/183_2.png) [@ericlingerfelt](https://forums.jcsda.org/u/ericlingerfelt)\
**Post date:** [May 22, 2024, 3:57pm UTC](https://forums.jcsda.org/t/r2d2-error-bias-correction-not-exist-in-database/586/8 "2024-05-22T15:57:11Z")

</div>

Hi @guoqing, Skylab needs to be upgraded to make this change. I will create an issue for the appropriate JCSDA staff members to address this update. For now, please try replacing this value with “noaa”. Thank you!
