Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rerunning link_workflow.sh generates gdas fix error #1100

Closed
RussTreadon-NOAA opened this issue Oct 27, 2022 · 3 comments · Fixed by #1101
Closed

rerunning link_workflow.sh generates gdas fix error #1100

RussTreadon-NOAA opened this issue Oct 27, 2022 · 3 comments · Fixed by #1101
Labels
bug Something isn't working

Comments

@RussTreadon-NOAA
Copy link
Contributor

Expected behavior
Reruns ./link_workflow.sh should complete without error.

Current behavior
Rerunning ./link_workflow.sh returns an error as shown below

[Russ.Treadon@hfe11 sorc]$ ./link_workflow.sh
ln: failed to create symbolic link 'bump/20220805': Permission denied
./link_workflow.sh encounted an error at line 184 (rc=1)

Machines affected
Only tested on Hera but may occur on other machines.

To Reproduce

  1. clone g-w develop
  2. cd sorc
  3. ./checkout.sh -u
  4. ./build_all.sh
  5. ./link_workflow.sh
  6. ./link_workflow.sh

The second execution of ./link_workflow.sh will generate an error.

Context
It is not uncommon for a developer change of a g-w component to necessitate relinking files.

Additional Information
If the gdas fix section of ./link_workflow.sh is commented out, reruns of ./link_workflow.sh complete without error.

@RussTreadon-NOAA RussTreadon-NOAA added the bug Something isn't working label Oct 27, 2022
@RussTreadon-NOAA
Copy link
Contributor Author

The following change to ./link_workflow.sh removes the gdas fix error

[Russ.Treadon@hfe11 sorc]$ git diff link_workflow.sh
diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh
index 3c21a3ea..91f9222d 100755
--- a/sorc/link_workflow.sh
+++ b/sorc/link_workflow.sh
@@ -180,6 +180,9 @@ if [ -d "${script_dir}/gdas.cd" ]; then
     [[ ! -d gdas ]] && mkdir -p gdas
     cd gdas || exit 1
     for gdas_sub in bump crtm fv3jedi; do
+      if [ -d ${gdas_sub} ]; then
+         rm -rf "${gdas_sub}"
+      fi
       fix_ver="gdas_${gdas_sub}_ver"
       ${LINK} "${FIX_DIR}/gdas/${gdas_sub}/${!fix_ver}" "${gdas_sub}"
     done

Executing ./link_workflow.sh with the above change yields

[Russ.Treadon@hfe11 sorc]$ ./link_workflow.sh
./link_workflow.sh completed successfully
[Russ.Treadon@hfe11 sorc]$

@RussTreadon-NOAA
Copy link
Contributor Author

Another error noted in fix/gdas. File fix/gdas/gdas_minmon_gnorm.txt is a dead link

rwxr-sr-x 4 glopara      global   4096 Oct 11 16:28 bump
drwxr-sr-x 4 glopara      global   4096 Oct 11 16:58 crtm
drwxr-sr-x 5 glopara      global   4096 Oct 11 16:58 fv3jedi
-rw-r--r-- 1 Russ.Treadon da         92 Oct 25 00:09 gdas_minmon_cost.txt
l????????? ? ?            ?           ?            ? gdas_minmon_gnorm.txt
-rw-r--r-- 1 Russ.Treadon da      30720 Oct 25 00:09 gdas_oznmon_base.tar
-rw-r--r-- 1 Russ.Treadon da        125 Oct 25 00:09 gdas_oznmon_satype.txt
-rw-r--r-- 1 Russ.Treadon da     471040 Oct 25 00:09 gdas_radmon_base.tar
-rw-r--r-- 1 Russ.Treadon da        385 Oct 25 00:09 gdas_radmon_satype.txt
-rw-r--r-- 1 Russ.Treadon da       3741 Oct 25 00:09 gdas_radmon_scaninfo.txt

link_workflow.sh includes two whitespace characters at the end of the quoted path/filename linked to gdas_minmon_gnorm.txt.

${LINK} "${script_dir}/gsi_monitor.fd/src/Minimization_Monitor/nwprod/gdas/fix/gdas_minmon_gnorm.txt  "                .

The two extra whitespace trace back to the initial commit of link_workflow.sh at e7f72ed. Removing the extra whitespace in link_workflow.sh

@@ -203,7 +206,7 @@ if [ -d "${script_dir}/gsi_monitor.fd" ]; then
     [[ ! -d gdas ]] && ( mkdir -p gdas || exit 1 )
     cd gdas || exit 1
     ${LINK} "${script_dir}/gsi_monitor.fd/src/Minimization_Monitor/nwprod/gdas/fix/gdas_minmon_cost.txt"                   .
-    ${LINK} "${script_dir}/gsi_monitor.fd/src/Minimization_Monitor/nwprod/gdas/fix/gdas_minmon_gnorm.txt  "                .
+    ${LINK} "${script_dir}/gsi_monitor.fd/src/Minimization_Monitor/nwprod/gdas/fix/gdas_minmon_gnorm.txt"                  .
     ${LINK} "${script_dir}/gsi_monitor.fd/src/Ozone_Monitor/nwprod/gdas_oznmon/fix/gdas_oznmon_base.tar"                   .
     ${LINK} "${script_dir}/gsi_monitor.fd/src/Ozone_Monitor/nwprod/gdas_oznmon/fix/gdas_oznmon_satype.txt"                 .
     ${LINK} "${script_dir}/gsi_monitor.fd/src/Radiance_Monitor/nwprod/gdas_radmon/fix/gdas_radmon_base.tar"                .

yields a functional link in fix/gdas.

@KateFriedman-NOAA
Copy link
Member

Thanks for these fixes @RussTreadon-NOAA ! I've tested it myself as well and confirm the error and resulting fix works (including the dead link and its fix). I will initiate a PR to get these fixes into develop.

KateFriedman-NOAA added a commit that referenced this issue Oct 27, 2022
Fix 1: When link_workflow.sh is rerun an error occurs:

-bash-4.2$ ./link_workflow.sh
./link_workflow.sh completed successfully
-bash-4.2$ ./link_workflow.sh
ln: failed to create symbolic link 'bump/20220805': Permission denied
./link_workflow.sh encounted an error at line 184 (rc=1)

Update link_workflow.sh gdas section to remove the subfolder symlinks if
they already exist before trying to make them. Error goes away now.

Fix 2: Dead symlink for a GSI monitoring file under /fix/gdas

Two extra whitespaces in link_workflow.sh cause a dead link. Remove the
whitespaces and link is created correctly.

Refs #1100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants