facebookincubator / dcrpm Goto Github PK
View Code? Open in Web Editor NEWA tool to detect and correct common issues around RPM database corruption.
License: GNU General Public License v2.0
A tool to detect and correct common issues around RPM database corruption.
License: GNU General Public License v2.0
If the rpmdb is already unhealthy y-c-t can sometimes make things worse
dcrpm --blacklist Conflictname
should skip that table, but it doesn't
We are using esapi 2.2.2.0 which brings log4j 1.2.17.jar depndency.
But In our BlackDuck scan a vulnerability(https://nvd.nist.gov/vuln/detail/CVE-2017-5645) is being shown for this jar, and this requires upgrade of log4j 1.2.17.jar to 2.11.1
So we would like to if we exclude this jar from esapi 2.2.2.0 and upgrade log4j to 2.11.1 would this cause any issues with working of esapi 2.2.2.0 components.
dcrpm runs rpm -qa as a heuristic to determine whether an rpmdb is accessible, followed by running db_recover on a timeout (or other) failure. Unfortunately db_recover destroys whatever state that can be used to diagnose the root cause.
Capturing "db_stat -CA" (or at least "db_stat -Cl") would help classify "stale lock" deadlock problems from timeouts.
Checking for the DB_ RUNRECOVERY error message on steer would help classify dbenv recovery problems. You might also consider writing a simple program to open&eclipse the rpmdb dbenv instead of reading the 100Mb of content in Packages (rpm -qa is perhaps not the best heuristic, although there really isn't a better means to get a package count than rpm -qa line count)
Finally, db_recovery can be run with a "-evv" to preserve the dbenv files: there are known (but rare) problems if/when there are multiple instances of dbenv files attached to different processes which can happen if open files are unlinked. Preserving the dbenv files with db_recover is recommended to avoid.
@fornellas is deprecating support for python 3.4 in TestSlide, the testing framework we use here. dcrpm still enforces compat with this version for $reasons. Can we drop support for it, especially since it's been EOL'd upstream?
On some OS, e.g. CentOS 8 or Fedora 36, "/var/lib/yum" doesn't exist. Thus causing this error.
$ sudo dcrpm --clean-yum-transactions
2023-01-13 21:18:14,717 ERROR [main.main]: exception
2023-01-13 21:18:14,717 ERROR [main.main]: exception
2023-01-13 21:18:14,717 ERROR [main.main]: exception: [Errno 2] No such file or directory: '/var/lib/yum'
Not sure if it's due to yum/dnf difference or something, but maybe we can fix it for CentOS 8 or other DNF distros?
Tried #55, but that may not be the correct fix.
Under heavy load checks can timeout, which can cause us to unnecessarily remediate. Figure out if we can do something smarter here.
=================================== FAILURES ===================================
____________ DcrpmIntegrationTest.test_rpmdb_centos7_missing_index _____________
args = (<tests.test_end_to_end.DcrpmIntegrationTest testMethod=test_rpmdb_centos7_missing_index>, '/tmp/tmpbmruxg8r/rpm')
kwargs = {}
def wrapper(*args, **kwargs):
# type: (t.Any, t.Any) -> RT
args += (os.path.join(temp_dir, "rpm"),)
> result = t.cast(F, function)(*args, **kwargs)
tests/rpmdb.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_end_to_end.py:93: in test_rpmdb_centos7_missing_index
self.assertTrue(run_result)
E AssertionError: False is not true
------------------------------ Captured log call -------------------------------
WARNING root:rpmutil.py:510 No db_backend found in macros, assuming bdb
ERROR root:dcrpm.py:137 DB needs recovery
ERROR root:dcrpm.py:148 DB needs rebuild
ERROR root:rpmutil.py:430 db_verify returned nonzero status
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.dbenv.lock: No such file or directory
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.rpm.lock: No such file or directory
WARNING root:dcrpm.py:160 Got other exception: Could not save __db.001 failed
ERROR root:rpmutil.py:430 db_verify returned nonzero status
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.dbenv.lock: No such file or directory
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.rpm.lock: No such file or directory
WARNING root:dcrpm.py:160 Got other exception: Could not save __db.001 failed
ERROR root:rpmutil.py:430 db_verify returned nonzero status
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.dbenv.lock: No such file or directory
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.rpm.lock: No such file or directory
WARNING root:dcrpm.py:160 Got other exception: Could not save __db.001 failed
ERROR root:rpmutil.py:430 db_verify returned nonzero status
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.dbenv.lock: No such file or directory
WARNING root:pidutil.py:65 lsof returned non-zero: lsof: status error on /tmp/tmpbmruxg8r/rpm/.rpm.lock: No such file or directory
WARNING root:dcrpm.py:160 Got other exception: Could not save __db.001 failed
ERROR root:dcrpm.py:169 Unable to repair RPM database
=========================== short test summary info ============================
FAILED tests/test_end_to_end.py::DcrpmIntegrationTest::test_rpmdb_centos7_missing_index
Hello,
I'm working on integrating setuptools 60+ to Fedora and test it against all packages in Fedora Rawhide (the rebuild takes place in Copr repository. One of the big-impact changes is the new default: setuptools uses its own distutils (rather than the one from Python's standard library).
One of dcrpm's tests fails every time with the newest setuptools and builds successfully every time with setuptools 59.6.0 we already have in Fedora. The test failure is rather weird though, there's no clear (to me) connection to setuptools that could play any role here. Do you have any idea why does this happen?
FAIL: test_rpmdb_centos7_missing_index (tests.test_end_to_end.DcrpmIntegrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/dcrpm-0.6.2/tests/rpmdb.py", line 38, in wrapper
result = t.cast(F, function)(*args, **kwargs)
File "/builddir/build/BUILD/dcrpm-0.6.2/tests/test_end_to_end.py", line 92, in test_rpmdb_centos7_missing_index
self.assertEqual(self.action_trace(), [])
AssertionError: Lists differ: ['index_rebuild', 'index_rebuild', 'table_rebuild'] != []
First list contains 3 additional elements.
First extra element 0:
'index_rebuild'
- ['index_rebuild', 'index_rebuild', 'table_rebuild']
+ []
----------------------------------------------------------------------
Ran 67 tests in 7.490s
FAILED (failures=1)
Test failed: <unittest.runner.TextTestResult run=67 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=67 errors=0 failures=1>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.