Symptoms
The system administrator may receive a notification that the cPanel update completed with errors with an entry similar to the following.
[2023-07-12 22:54:04 -0300] E Pre Maintenance ended, however it did not exit cleanly (256). The following events were logged: "scripts/find_outdated_services". Please check the logs for an indication of what happened.
The update log will also show entries similar to the following.
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] Cpanel::Exception::ProcessFailed::Error/(XID gm9gdg) “/usr/bin/needs-restarting” reported error code “1” when it ended: Traceback (most recent call last):
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/bin/needs-restarting", line 101, in <module>
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] main.user_main(MAPPING[command] + args, exit_code=True)
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 201, in user_main
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] errcode = main(args)
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] return _main(base, args, cli_class, option_parser_class)
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 106, in _main
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] return cli_run(cli, base)
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 122, in cli_run
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] cli.run()
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1055, in run
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] return self.command.run()
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf-plugins/needs_restarting.py", line 270, in run
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] for ofile in list_opened_files(uid):
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib/python3.6/site-packages/dnf-plugins/needs_restarting.py", line 77, in list_opened_files
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] lines = smaps_file.readlines()
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] return codecs.ascii_decode(input, self.errors)[0]
[2023-07-12 22:53:41 -0300] E [/usr/local/cpanel/scripts/find_outdated_services] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 137: ordinal not in range(128)
Description
Occasionally when needs-restarting runs, a component that requires a restart may have an open entry in the smaps table with non-ASCII characters in them. When this occurs, needs-restarting exits in a non-zero status. RedHat is reviewing this issue in their internal case, RHELPLAN-159116.
We've opened an internal case for our development team to track RedHat's progress on this issue. For reference, the case number is UPS-582.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Run the needs-restarting script.
/usr/bin/needs-restarting -s
- Verify that the script exited without any errors.
- Run the upcp script.
/usr/local/cpanel/scripts/upcp