Satellite-sync failed with "IOError: [Errno 5] Input/output error" error.
Environment
- Red Hat Satellite 5.4
- Red Hat Satellite 5.6
Issue
- Satellite-sync failed with "IOError: [Errno 5] Input/output error" error.
Resolution
- Remove the cache and try again to satellite-sync
# rm -rfv /var/cache/rhn/*
# rhn-satellite restart
# spacewalk-data-fsck -vrF 2>&1 > /tmp/fsck.txt
Root Cause
- In some cases similar issue was presented while trying to run Satellite-sync in background, for example:
satellite-sync &
- The issue was caused by missing file on storage, but there were records in the database for them, so whenever the satellite-sync command came to the first record like this, it failed.
Diagnostic Steps
- Satellite-sync Output with error:
SYNC ERROR: unhandled exception occurred:
Exception reported from satellite.example.local
Time: Mon May 9 13:12:01 2011
Exception type exceptions.IOError
Exception Handler Information
Traceback (most recent call last):
File "/usr/bin/satellite-sync", line 143, in main
return satsync.Runner().main()
File "/usr/share/rhn/satellite_tools/satsync.py", line 226, in main
ret = method()
File "/usr/share/rhn/satellite_tools/satsync.py", line 323, in _step_download_packages
return self.syncer.download_package_metadata()
File "/usr/share/rhn/satellite_tools/satsync.py", line 1160, in download_package_metadata
pb.printIncrement()
File "/usr/share/rhn/satellite_tools/progress_bar.py", line 76, in printIncrement
self.stream.flush()
IOError: [Errno 5] Input/output error
- Try to run this command:
spacewalk-data-fsck -vrF 2>&1 > /tmp/fsck.txt
and attach the fsck.txt output to the case? It should check the consistency between the database and the file system.
- Share the output of following commands:
# rhn-schema-version
# rpm -qa | grep satellite-schema
-
To verify space of free i-nodes :
# df -i -
After checking the backtrace and the source code realized, that there is really an issue accessing a file and reading the required information from it. These situation may happen, during sync / update. Because of that there is an utility command called 'spacewalk-data-fsck' which does actually nothing else, than checking the integrity between database and storage or removing records/files when they could be source of any integrity issue.
-
The command suggested, was actually checking the integrity and it removing any record from the database where it wasn't able to find the file on your storage.
-
What happened now and what consequences it might have when the records were removed, what about the dependencies etc.?
Well, the answer is simple. Run the satellite-sync command afterwards, which should download the missing packages again and they should be available for any client connected to satellite from this moment. -
Also have a look at man page for more information.
man spacewalk-data-fsck
- In case, if dependency issues occur, because some package wasn't synced for whatever reason, try to run satellite-sync for the affected channel(s) with these additional parameters first:
--force-all-packages
--force-all-errata
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
