Bug 1286440

Summary: minidnf cannot cope with dnf empty history as dnf does not provide root history transaction
Product: [Fedora] Fedora Reporter: Yaniv Lavi <ylavi>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 22CC: alonbl, amureini, bugs, jsilhan, mluscon, packaging-team-maint, penguin.wrangler, pnemade, vmukhame, ylavi
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1279051 Environment:
Last Closed: 2015-12-01 12:57:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1279051    

Description Yaniv Lavi 2015-11-29 14:06:31 UTC
+++ This bug was initially created as a clone of Bug #1279051 +++

Description of problem:

Reinstall host (in maintenence mode) does not work after the host was freshly upgraded to Fedora 22.

Failed to install host <hostname>. Failed to execute stage 'Environment setup': 'NoneType' object has no attribute 'tid'.


in minidnf.py, beginTransaction():
>>  self._baseTransaction = self._base.history.last().tid

# dnf history
Last metadata expiration check performed 0:22:33 ago on Sat Nov  7 08:06:56 2015.
No transactions
Error: Failed history list

Version-Release number of selected component (if applicable):
ovirt-host-deploy-1.4.0-1.el7.centos.noarch

How reproducible:

Fails continuously until workaround applied. See below.

Steps to Reproduce:
1. yum upgrade from earlier Fedora to Fedora 22
2. from ovirt Manager, reinstall host
3.

Actual results:

As indicated above, host install failed "Environment Setup" stage.

Expected results:

Reinstall should complete successfully.

Additional info:

I traced through to find that otopi minidnf module was unable to deal gracefully without any DNF history. I installed any package to cause some DNF history to exist, after which the host re-install completed successfully.

--- Additional comment from Alon Bar-Lev on 2015-11-07 21:29:05 IST ---

As you can see, this is dnf issue.
---
# dnf history
Last metadata expiration check performed 0:22:33 ago on Sat Nov  7 08:06:56 2015.
No transactions
Error: Failed history list
---

If empty history is a valid state it should not be an error, and it should return valid base.history.last().tid

We cannot workaround this, I hope they will fix it.

Workaround is to install/remove something to have anything in history to enable rollback.

--- Additional comment from Yaniv Kaul on 2015-11-29 15:25:19 IST ---

Ian - is there a bug on DNF to fix this?

--- Additional comment from Ian Morgan on 2015-11-29 15:29:27 IST ---

Yaniv, I have no idea about a bug filed against DNF. I just reported the original bug against otopi.

Comment 1 Alon Bar-Lev 2015-11-29 14:38:52 UTC
minidnf is not part of fedora nor dnf, why was this bug dup?
when opening a bug on dependency you should describe exactly what you expect the history is irrelevant, the terms should be within dependencies term.

it may not worth the effort to handle this anyway, as this is edge condition using non public api.