Skip to content

ADF diagnostics fails on git command #26

@TomasTorsvik

Description

@TomasTorsvik

ADF run type

Model vs. Model

What happened?

When running with the latest noresm tag, I get the following error:

$ /nird/datalake/NS9560K/home/tomast/NorESMhub/ADF/run_adf_diag --config-file ./config_nor3_b12a-ne30-r1y1.yml 
/diagnostics/ADF-env/adf_v0.13/lib/python3.12/site-packages/xskillscore/__init__.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import DistributionNotFound, get_distribution
ADF diagnostics is starting...
AVAILABLE BASE_HIST_STR: cam.h0a
	Checking history files in '/nird/datalake/NS9560K/noresm3/cases/n1850.ne30pg3_tn14.noresm3_0_beta09-run2_yr001.20251223/atm/hist'
AVAILABLE  YEARS IN BASE RUN: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
	Checking history files in '/nird/datalake/NS9560K/noresm3/cases/n1850.ne30pg3_tn14.noresm3_0_beta12a-run1_yr001.20260313/atm/hist'
Case climo years: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

	Diagnostic Plot Location: /nird/datalake/NS9560K/www/diagnostics/noresm/tomast/n1850.ne30pg3_tn14.noresm3_0_beta12a-run1_yr001.20260313/ADF/n1850.ne30pg3_tn14.noresm3_0_beta12a-run1_yr001.20260313_1_20_vs_n1850.ne30pg3_tn14.noresm3_0_beta09-run2_yr001.20251223_1_20
fatal: not a git repository (or any parent up to mount point /nird/datalake)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Git command failed: Command '['git', 'rev-parse', '--abbrev-ref', 'HEAD']' returned non-zero exit status 128.
Traceback (most recent call last):
  File "/nird/datalake/NS9560K/home/tomast/NorESMhub/ADF/run_adf_diag", line 146, in <module>
    diag = AdfDiag(config_yaml, debug=config_debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nird/datalake/NS9560K/home/tomast/NorESMhub/ADF/lib/adf_diag.py", line 165, in __init__
    super().__init__(config_file, debug=debug)
  File "/nird/datalake/NS9560K/home/tomast/NorESMhub/ADF/lib/adf_web.py", line 196, in __init__
    self._write_run_info_to_log(config_file, active_env)
  File "/nird/datalake/NS9560K/home/tomast/NorESMhub/ADF/lib/adf_web.py", line 297, in _write_run_info_to_log
    for key,val in git_info.items():
                   ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'items'

The error is triggered by a failing git command, apparently because ADF is searching for a git repository. I can overcome this error by commenting out the parts in adf_web.py that calls get_git_info().

ADF Hash you are using

2fc7021

What machine were you running the ADF on?

Other (please explain below)

What python environment were you using?

Other (please explain below)

Extra info

Machine: nird IPCC node
Python version: 3.12.11

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions