Bug 64120

Summary: JMeter recording fails with Underlying input stream returned zero bytes due to bug in jsoup 1.12.1
Product: JMeter - Now in Github Reporter: jnex85
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: p.mouawad, rus_alex777
Priority: P2 Keywords: FixedInTrunk
Version: 5.2.1   
Target Milestone: JMETER_5.3.0   
Hardware: All   
OS: All   
Attachments: Recording Error log

Description jnex85 2020-02-06 15:52:32 UTC
Created attachment 36995 [details]
Recording Error log

It seems that JMeter thrown an exception with the current version of Jsoup 1.12.1 while recording a new session.
Caused by org.jsoup.c: java.io.IOException: Underlying input stream returned zero bytes
       at org.jsoup.parser.CharacterReader.bufferUp(CharacterReader.java:60)
       at org.jsoup.parser.CharacterReader.(CharacterReader.java)
       at org.jsoup.parser.CharacterReader.(CharacterReader.java)
       at org.jsoup.parser.TreeBuilder.defaultSettings(TreeBuilder.java:35)
       at org.jsoup.parser.HtmlTreeBuilder.initialiseParse(HtmlTreeBuilder.java:66)
       at org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:44)
       at org.jsoup.parser.Parser.parseInput(Parser.java:39)
       at org.jsoup.helper.DataUtil.parseInputStream(DataUtil.java:151)
       at org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:832)
       at org.jsoup.helper.HttpConnection.get(HttpConnection.java:289)

Related to this post https://github.com/jhy/jsoup/issues/980 it should be fixed, but in reality is not. I downgraded the version of Jsoup to the one used in JMeter version 5.1.1 and everything works fine. Please,
catch this exception and mitigate it waiting the fix from Jsoup owners!
Comment 1 Philippe Mouawad 2020-02-10 20:00:28 UTC
Hello,
Can you show the jmeter.log with this stacktrace ?
Thank you
Regards
Comment 2 Felix Schumacher 2020-02-10 20:34:55 UTC
The jsoup bug tracker points to https://github.com/jhy/jsoup/issues/1250, which says it should be fixed with version 1.12.2.

I will update the dependency accordingly.

@jnex85 could you test the next nightly, if your problem is fixed?

p.s. It would be nice to have the error messages as text instead of a picture.
Comment 3 Felix Schumacher 2020-02-10 20:41:27 UTC
Will be included in the next JMeter version (after 5.1.2).

@jnex85 if this fixed your problem, you can close this bug and add "FixedInTrunk" to the Keywords above.

commit a6cbe55c367afa6b8a51e9c858e30ed403d1d28f
AuthorDate: Mon Feb 10 21:36:48 2020 +0100

    Updated jsoup to 1.12.2 (from 1.22.1)
    
    Bugzilla Id: 64120
---
 gradle.properties | 2 +-
 xdocs/changes.xml | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Comment 4 Philippe Mouawad 2020-02-15 10:57:30 UTC
Closing as resolved .
But if reported can confirm it would be better, thanks.
Comment 5 jnex85 2020-02-21 07:50:29 UTC
In the nightly 5.3 I don't see the error anymore. Anyway, during the initialization of the recording there is a new error, for sure not related with that one.
The exception is:
apache-jmeter-5.3-SNAPSHOT\apache-jmeter-5.3-SNAPSHOT\bin\proxyserver.jks (The system cannot find the file specified)
	at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_241]
	at java.io.FileInputStream.open(Unknown Source) ~[?:1.8.0_241]
	at java.io.FileInputStream.<init>(Unknown Source) ~[?:1.8.0_241]
	at org.apache.jmeter.protocol.http.proxy.ProxyControl.getKeyStore(ProxyControl.java:1582) ~[ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.protocol.http.proxy.ProxyControl.initDynamicKeyStore(ProxyControl.java:1462) [ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.protocol.http.proxy.ProxyControl.initKeyStore(ProxyControl.java:1415) [ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.protocol.http.proxy.ProxyControl.startProxy(ProxyControl.java:494) [ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.startProxy(ProxyControlGui.java:600) [ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.actionPerformed(ProxyControlGui.java:440) [ApacheJMeter_http.jar:5.3-SNAPSHOT]
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) [?:1.8.0_241]
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) [?:1.8.0_241]
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) [?:1.8.0_241]
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source) [?:1.8.0_241]
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) [?:1.8.0_241]
	at java.awt.Component.processMouseEvent(Unknown Source) [?:1.8.0_241]
	at javax.swing.JComponent.processMouseEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.Component.processEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.Container.processEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.Component.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.Container.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.Component.dispatchEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.Container.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.Window.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.Component.dispatchEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_241]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_241]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_241]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$4.run(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$4.run(Unknown Source) [?:1.8.0_241]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_241]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_241]
Comment 6 Felix Schumacher 2020-02-21 15:54:52 UTC
I think the last comment (about the missing proxyserver.jks) should be discussed on the users mailing list or, if you really believe it to be a bug, in a new bug entry.

Note, that I downloaded a fresh nightly under windows and had no problems running the proxy and recording a https site.
Comment 7 Philippe Mouawad 2020-04-25 13:06:22 UTC
*** Bug 64320 has been marked as a duplicate of this bug. ***
Comment 8 The ASF infrastructure team 2022-09-24 20:38:18 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5236