Bug 1574433

Summary: "Invalid data received during bootstrap" errors do not log the invalid data
Product: [oVirt] otopi Reporter: Yedidyah Bar David <didi>
Component: Bindings.JavaAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Belka <jbelka>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.6.2CC: bugs, didi, lsvaty
Target Milestone: ovirt-4.2.4Flags: rule-engine: ovirt-4.2+
rule-engine: exception+
Target Release: 1.7.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: otopi-1.7.8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-26 08:45:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1582136    

Description Yedidyah Bar David 2018-05-03 10:32:19 UTC
Description of problem:

If host-deploy fails due to invalid data right at the beginning, such as the remote host outputs some unrelated text for any reason, the machine dialog parser fails with the error "Invalid data received during bootstrap".

If the engine was configured to log at debug level, we also log "Got: " and the input, but only the first (invalid) line.

otopi should log the invalid line at level "error", so that it's always logged, and log some more lines from the input to help debug failures.

Version-Release number of selected component (if applicable):

All versions

How reproducible:

Always

Steps to Reproduce:
1. Install and setup oVirt engine on some machine, and plain OS (el7) on another, a host.
2. On the host: mkdir /etc/otopi.env.d; printf "echo\necho Bad input\n" > /etc/otopi.env.d/bad-input.sh
3. Try to add the host to the engine

Actual results:

Fails with error "Invalid data received during bootstrap" and "Cannot parse input", but not with "Bad input". If engine logs at debug level, the log will only contain "Got: ".

Expected results:

Fails, and the log contains also "Bad input".

Additional info:

Comment 1 Yaniv Kaul 2018-05-14 15:58:14 UTC
Severity...?

Comment 2 Yedidyah Bar David 2018-05-15 06:43:42 UTC
(In reply to Yaniv Kaul from comment #1)
> Severity...?

It's not a blocker, as in - it does not break any positive functionality.

However, over the years we had quite many host-deploy failures that would have been easier to debug if we had fixed current bug. I opened it now after having yet another one, see the "See also" bug.

It's already merged to master, and 1.7 (4.2) is only blocked because it fails on fedora, as we didn't want to pollute 1.7 branch with the many fixes for fedora we merged to master. I hope to handle this soon and intend to have this fix for 4.2.4.

Setting Medium/Medium. Feel free to change.

Comment 3 Yedidyah Bar David 2018-06-04 07:58:46 UTC
(In reply to Yedidyah Bar David from comment #0)
> 2. On the host: mkdir /etc/otopi.env.d; printf "echo\necho Bad input\n" >
> /etc/otopi.env.d/bad-input.sh

Sorry, should be:

mkdir /etc/otopi.env.d; printf "echo\necho Bad input\n" > /etc/otopi.env.d/bad-input.env

Comment 4 Jiri Belka 2018-06-04 08:13:08 UTC
ok, otopi-1.7.8-1.el7ev.noarch

# grep -Eai 'AuditLogDirector.*EVENT_ID' /var/log/ovirt-engine/engine.log  | tail -n3
2018-06-04 10:09:13,064+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engine-Thread-34) [6bce7467] EVENT_ID: VDS_INSTALL_IN_PROGRESS(509), Installing Host 10-37-137-227.example.com. Connected to host 10-37-137-227.example.com with SSH key fingerprint: SHA256:sOdd7UQKaS9VTtDp2jv+dT7YoEWVgR2trdDpM7oZfe8.
2018-06-04 10:09:14,807+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engine-Thread-34) [6bce7467] EVENT_ID: VDS_INSTALL_IN_PROGRESS_ERROR(511), An error has occurred during installation of Host 10-37-137-227.example.com: Invalid data received during bootstrap.
2018-06-04 10:09:14,821+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedThreadFactory-engine-Thread-34) [6bce7467] EVENT_ID: VDS_INSTALL_FAILED(505), Host 10-37-137-227.example.com installation failed. Invalid data received during bootstrap.

# grep -ai 'bad.*input' /var/log/ovirt-engine/engine.log 
2018-06-04 10:09:13,532+02 ERROR [org.ovirt.otopi.dialog.MachineDialogParser] (VdsDeploy) [6bce7467] Invalid data: 'Bad input'

Comment 5 Sandro Bonazzola 2018-06-26 08:45:59 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.