ESMCI / cime

Common Infrastructure for Modeling the Earth
http://esmci.github.io/cime
Other
161 stars 206 forks source link

Unbound machine variable when there is no matching nodename_regex #4588

Closed billsacks closed 6 months ago

billsacks commented 7 months ago

When there is no matching nodename_regex for a machine, the following error is generated from create_newcase, even if --machine is explicitly specified:

Traceback (most recent call last):
  File "/Users/sacks/cesm_code/cesm/cime/scripts/./create_newcase", line 18, in <module>
    _main_func()
  File "/Users/sacks/cesm_code/cesm/cime/CIME/scripts/create_newcase.py", line 440, in _main_func
    case.create(
  File "/Users/sacks/cesm_code/cesm/cime/CIME/case/case.py", line 2479, in create
    self.configure(
  File "/Users/sacks/cesm_code/cesm/cime/CIME/case/case.py", line 1350, in configure
    probed_machine = machobj.probe_machine_name()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sacks/cesm_code/cesm/cime/CIME/XML/machines.py", line 183, in probe_machine_name
    machine = self._probe_machine_name_one_guess(nametomatch)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sacks/cesm_code/cesm/cime/CIME/XML/machines.py", line 213, in _probe_machine_name_one_guess
    return self._probe_machine_name_one_guess_v3(nametomatch)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sacks/cesm_code/cesm/cime/CIME/XML/machines.py", line 306, in _probe_machine_name_one_guess_v3
    return machine
           ^^^^^^^
UnboundLocalError: cannot access local variable 'machine' where it is not associated with a value

This is with the latest CIME in CESM (cime6.0.217_httpsbranch02) – I haven't tried cime master.

See https://github.com/ESMCI/cime/discussions/4587 for details.