Old persistent sessions in `cylc scan`

cylc scan returns errors relating to my old persistent sessions that are no longer running:

[mjl561@gadi-login-01 ~]$  cylc scan
ERROR: [Errno -2] Name or service not known: test.mjl561.ce10.ps.gadi.nci.org.au
ERROR: [Errno -2] Name or service not known: test.mjl561.ce10.ps.gadi.nci.org.au
ERROR: [Errno -2] Name or service not known: test.mjl561.ce10.ps.gadi.nci.org.au

I think this came about from suites running up until a previous quarter shutdown.

This isn’t causing me a big issue, just wondered if anyone has suggestions to clean these errors up?

There will be a file ~/cylc-run/RUNID/.service/contact that refers to the old host name, it’s fine to delete this file for runs that are no longer running and the scan should get cleaned up.

1 Like

Thank you Scott, as always!

For those cleaning up this problem, this bash script will loop through your cylc-run folders (including symbolic links to scratch) and delete .service/contact (do not run if any suite is still running!)

# cleans old host by deleting all .service/contact 

DIR="$HOME/cylc-run"
# list all directories in the base directory, including symbolic links
find "$DIR" -mindepth 1 -maxdepth 1 \( -type d -o -type l \) | while read -r dir; do
    # only keep dirs that contain the .service/contact file
    if [ -f "$dir/.service/contact" ]; then
        echo "Cleaning up host: $dir"
        # remove the .service/contact file
        rm "$dir/.service/contact"
    fi
done
1 Like