One of the scenario is OS upgrade from RHEL7 to RHEL8 after which this issue can pop up.
Customers may encounter an error when exiting from gpssh in interactive mode, specifically when attempting to leave the shell session. The error message appears as :
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/greenplum-db-6.25.2/ext/python/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
IOError: [Errno 22] Invalid argument
This error occurs in the atexit module during the exit process of the gpssh session. The issue is related to the writing process that occurs when attempting to record the session history, in the .gshist file.
All greenplum versions.
The issue error lies within the atexit module, which tries to write the history of the commands executed in the session to the .gshist file located in the user's home directory (/home/gpadmin/.gshist). This file stores the history of the gpssh session commands.
1. The IOError is often caused by a hardware or disk-related problem, particularly if the home directory resides on a device with issues. Review the system logs for any hardware-related errors. Check the following logs:
2. Ensure that the .gshist file is writable. If there is an issue with the file’s permissions, you may encounter the IOError when trying to write to it.
ls -l /home/gpadmin/.gshist
If file is not writable, correct the permissions:
chmod 644 /home/gpadmin/.gshist
3. The file itself may be corrupted or locked. You can try renaming the .gshist file to see if the problem persists:
mv /home/gpadmin/.gshist /home/gpadmin/gshist.old
gpssh -f hostfile
uptime
exit