Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

UnicodeEncodeError in test_full_system (scripts_regression_tests.py)

alvgomezc

Álvaro Gustavo Gómez C.
New Member
Hi,

We're doing the final tests in the CESM2.1.3 port in our university cluster. Until now, the script_regression_tests.py did 361 tests, in which 5 failed, 1 give us error and 11 where skipped. The one test (or the group of tests, I am not quite sure) that I am worried about is the test_full_system, which gives the following:

Code:
test_full_system (__main__.Z_FullSystemTest) ... FAIL

======================================================================
ERROR: test_query_machines (__main__.X_TestQueryConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./scripts_regression_tests.py", line 1481, in test_query_machines
    run_cmd_no_fail("{}/query_config --machines".format(SCRIPT_DIR))
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/tests/../lib/CIME/utils.py", line 516, in run_cmd_no_fail
    expect(False, "Command: '{}' failed with error '{}' from dir '{}'".format(cmd, errput.encode('utf-8'), os.getcwd() if from_dir is None else from_dir))
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/tests/../lib/CIME/utils.py", line 130, in expect
    raise exc_type(msg)
SystemExit: ERROR: Command: '/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/query_config --machines' failed with error 'Traceback (most recent call last):
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/query_config", line 350, in <module>
    _main_func(__doc__)
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/query_config", line 346, in _main_func
    query_machines(machine_name=args.machines)
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/query_config", line 47, in query_machines
    machines.print_values(machine_name=machine_name)
  File "/mnt/flock/cr2/projects/cesm2/cesm2.1.3/cime/scripts/query_config", line 318, in print_values
    print("  {} : {} ".format(name, desc))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 33: ordinal not in range(128)' from dir '/mnt/flock/cr2/projects/cesm2/cesm2.1.3/scratch/scripts_regression_test.20200901_131031/st_archive_resubmit_test'

It's quite odd this acsii error because the machine we are working on is correctly configure. Is there any script that we should specifically check to verify I ain't using an incorrect character or is there something else we're missing?

Thanks :)
 

jedwards

CSEG and Liaisons
Staff member
So you are only showing the error here. I would look at the 5 failed tests. The above failure would seem to suggest that
you have something misformatted in your config_machines.xml file - do you have xmllint on your system? This tool can really help find issues in xml files.
In particular it is having trouble with the name or description of your system. (or perhaps some other system in the file.)
 

alvgomezc

Álvaro Gustavo Gómez C.
New Member
I checked the config_machine.xml with xmllint tool and, apparently, everything was fine. Finally we found that there was a word with a tilde in the description of the machine. We took it off and the problem was solved.

Thanks for your help! :)
 
Top