Bug 1172085

Summary: Nullpointer Exception on RHQ Agent Setup.prompt()
Product: [Other] RHQ Project Reporter: Stian Lund <stianlund+bugzilla>
Component: AgentAssignee: Nobody <nobody>
Status: ON_QA --- QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.13CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.13   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1173297 (view as bug list) Environment:
Last Closed: 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: 1173297    

Description Stian Lund 2014-12-09 11:21:27 UTC
Description of problem:

When starting rhq-agent.sh on a 'clean' server, after doing 'java -jar rhq-agent.jar --install', the setup fails with a Nullpointer:

----- 
    Agent Name [d32apvl043.oera-t.local] : Failed to start the agent  
    java.lang.NullPointerException  
            at org.rhq.enterprise.communications.util.prefs.Setup.prompt(Setup.java:303)  
            at org.rhq.enterprise.communications.util.prefs.Setup.setup(Setup.java:193)  
            at org.rhq.enterprise.agent.promptcmd.SetupPromptCommand.performBasicSetup(SetupPromptCommand.java:108)  
            at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:455)  
    Agent will be restarted soon to see if the failure condition cleared up  
-----

Obv. this never clears up

There's nothing more in the agent.log.

Workaround is to, download older agent jar, I used 4.5.1 from another server, then install this, run setup and let it update automagically.

Edit; I have also noticed that on existing agent when running the interactive shell (just running rhq-agent.sh), you are unable to actually type anything. According to GaYak on IRC 

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

RHQ 4.13

Red Hat Enterprise Linux Server release 6.5 (Santiago)
2.6.32-431.23.3.el6.x86_64 #1 SMP Wed Jul 16 06:12:23 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:

Every time running the initial setup prompt.


Steps to Reproduce:
1. Download rhq-agent.jar
2. Install RHQ-agent 'java -jar rhq-agent.jar --install'
3. run rhq-agent/bin/rhq-agent.sh

Actual results:

Nullpointer Exception on Setup.prompt()

Expected results:

Interactive setup

Additional info:

Verified with 'gaYak' on irc.

Comment 1 Stian Lund 2014-12-09 11:34:43 UTC
Java version:

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

Comment 2 Michael Burman 2014-12-11 20:24:30 UTC
An update to this one: The null value is coming straight from the JLine module, which has not changed between last working version and current version. Possible corruption on in the jar from repository? Have to investigate more..

Comment 3 Michael Burman 2014-12-12 11:30:17 UTC
The bug appeared on the merge of commit 2a2ffa4dc443f0064365e7ef56deee4b9e3c688d which tried to fix issue BZ 1166383. The changes to running foreground prevent console reading from working.

Comment 4 Michael Burman 2014-12-12 11:31:26 UTC
Well, pasted wrong commit. BZ 1166383 is not the one to blame, but commit 72446e2a2b396285ce10ac784523fe2f98458006

Comment 5 Michael Burman 2015-01-05 20:35:09 UTC
Fixed in master and RHQ 4.13.1