Blazemeter / HLSPlugin

A repo to hold the OpenSource HLS JMeter Plugin code
Apache License 2.0
48 stars 17 forks source link

NullPointerException while parsing playlist #18

Closed kontrollanten closed 2 years ago

kontrollanten commented 4 years ago

When I try to start a test the following error occurs. It seems like there's no URI to the video part. The playlist parsing seems to be done here https://github.com/Comcast/hlsparserj/blob/817454e4efe469e9b1b5656ad23b3d889345f1f5/src/main/java/com/comcast/viper/hlsparserj/MediaPlaylist.java#L166

But maybe the error is within the playlist file? The m3u8 file can be reached here https://we.tl/t-yDoUosysJl

2020-11-02 08:59:30,481 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'bzm - Streaming Sampler'.
java.lang.NullPointerException: null
    at java.net.URI$Parser.parse(URI.java:3104) ~[?:?]
    at java.net.URI.<init>(URI.java:600) ~[?:?]
    at java.net.URI.create(URI.java:881) ~[?:?]
    at com.blazemeter.jmeter.videostreaming.hls.Playlist.buildAbsoluteUri(Playlist.java:117) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.Playlist.lambda$getMediaSegments$1(Playlist.java:139) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?]
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]
    at com.blazemeter.jmeter.videostreaming.hls.Playlist.getMediaSegments(Playlist.java:140) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler$MediaPlayback.updateMediaSegments(HlsSampler.java:116) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler$MediaPlayback.<init>(HlsSampler.java:110) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler$MediaPlayback.<init>(HlsSampler.java:100) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.sample(HlsSampler.java:59) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.videostreaming.core.VideoStreamingSampler.sample(VideoStreamingSampler.java:79) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:198) ~[jmeter-bzm-hls-3.0.3.jar:?]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270) ~[ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) ~[ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
    at java.lang.Thread.run(Thread.java:834) [?:?]

HLSPlugin version: 3.0.3 Jmeter version: 5.3

RicardoPoleo commented 3 years ago

Hello @kontrollanten,

For our delay, I'm sorry, we shouldn't leave you hanging.

We experienced some issues regarding the protocol selection and other minor issues that, in our last release, were fixed.

Could you please try it out and let us know if it works for you?

Hope to hear from you and, as always,

Happy Hacking!

kontrollanten commented 3 years ago

Thanks for your reply. I tried with the latest version and got the same result. Below is a screenshot of the settings.

RicardoPoleo commented 3 years ago

Thanks for your quick response @kontrollanten,

I'll check this with the team and let you know when we fix it.

That being said, I saw that this issue was mentioned on the PeerTube's Community. Do you know if their formatting was fixed?

As always, thanks for taking the time,

kontrollanten commented 3 years ago

Thanks ๐Ÿ‘๐Ÿป I don't think that the formatting has been fixed/changed on PeerTube. I don't know what's wrong, so I can't propose a fix either.

RicardoPoleo commented 3 years ago

We reviewed the issue and, it looks like the problem is on our end, in the way we solve the byte ranges and obtain the URLs from them.

We will be working on fixing it and, when the release is done, we will let you know.

Anyways, thanks for taking the time @kontrollanten to test it and report it.

kontrollanten commented 2 years ago

Hi! Any updates on this?

stevespaw commented 2 years ago

We also have run into this issue. We are trying to get PeerTube videos playing on ROKU and Video.JS. Neither of these play with Audio. Try any PeerTube M3U8 here to replicate, this mirrors our Roku experience. This would really help us if it was fixed. https://videojs-http-streaming.netlify.app/ @RicardoPoleo Thanks

diego-ferrand commented 2 years ago

Hey, we just launched a pre-release which should solve this issue. Please check it out and let us know what you think.

kontrollanten commented 2 years ago

Thanks, the NullPointerException seems to have been solved, but now I get other errors:

2022-09-28 07:01:05,141 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-09-28 07:01:05,143 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-09-28 07:01:05,143 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-09-28 07:01:05,144 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2022-09-28 07:01:05,145 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2022-09-28 07:01:05,199 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-09-28 07:01:05,259 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2022-09-28 07:01:05,259 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2022-09-28 07:01:05,259 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-09-28 07:01:05,259 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-09-28 07:01:05,262 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-09-28 07:01:05,262 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2022-09-28 07:01:05,262 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2022-09-28 07:01:05,267 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2022-09-28 07:01:05,267 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[#59,Thread Group 1-1,6,main]
java.lang.NoClassDefFoundError: com/comcast/viper/hlsparserj/IPlaylist
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.downloadPlaylist(HlsSampler.java:175) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.downloadMasterPlaylist(HlsSampler.java:163) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.sample(HlsSampler.java:43) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.core.VideoStreamingSampler.sample(VideoStreamingSampler.java:82) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:283) ~[jmeter-bzm-hls-3.2.jar:?]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290) ~[ApacheJMeter_http.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5]
    at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.ClassNotFoundException: com.comcast.viper.hlsparserj.IPlaylist
    ... 11 more
2022-09-28 07:01:05,268 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-09-28 07:01:05,268 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2022-09-28 07:01:12,882 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-09-28 07:01:12,883 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-09-28 07:01:12,883 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-09-28 07:01:12,928 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2022-09-28 07:01:12,928 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2022-09-28 07:01:12,928 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-09-28 07:01:12,928 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-09-28 07:01:12,929 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-09-28 07:01:12,929 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2022-09-28 07:01:12,929 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2022-09-28 07:01:12,930 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2022-09-28 07:01:12,930 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[#62,Thread Group 1-1,6,main]
java.lang.NoClassDefFoundError: com/comcast/viper/hlsparserj/IPlaylist
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.downloadPlaylist(HlsSampler.java:175) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.downloadMasterPlaylist(HlsSampler.java:163) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.sample(HlsSampler.java:43) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.videostreaming.core.VideoStreamingSampler.sample(VideoStreamingSampler.java:82) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:283) ~[jmeter-bzm-hls-3.2.jar:?]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290) ~[ApacheJMeter_http.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5]
    at java.lang.Thread.run(Thread.java:1589) ~[?:?]
2022-09-28 07:01:12,930 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-09-28 07:01:12,930 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2022-09-28 07:02:03,961 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[#29,AWT-EventQueue-0,6,main]
java.lang.NoClassDefFoundError: com/comcast/viper/hlsparserj/IPlaylist
    at com.blazemeter.jmeter.videostreaming.hls.HlsSampler.getVariants(HlsSampler.java:105) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.hls.logic.HlsSampler.getVariantsFromURL(HlsSampler.java:348) ~[jmeter-bzm-hls-3.2.jar:?]
    at com.blazemeter.jmeter.hls.gui.HlsSamplerPanel.actionPerformed(HlsSamplerPanel.java:565) ~[jmeter-bzm-hls-3.2.jar:?]
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) ~[?:?]
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) ~[?:?]
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?]
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?]
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?]
    at com.github.weisj.darklaf.ui.button.DarkButtonListener.mouseReleased(DarkButtonListener.java:72) ~[darklaf-core-2.7.3.jar:2.7.3]
    at java.awt.Component.processMouseEvent(Component.java:6620) ~[?:?]
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3398) ~[?:?]
    at java.awt.Component.processEvent(Component.java:6385) ~[?:?]
    at java.awt.Container.processEvent(Container.java:2266) ~[?:?]
    at java.awt.Component.dispatchEventImpl(Component.java:4995) ~[?:?]
    at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?]
    at java.awt.Component.dispatchEvent(Component.java:4827) ~[?:?]
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) ~[?:?]
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) ~[?:?]
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) ~[?:?]
    at java.awt.Container.dispatchEventImpl(Container.java:2310) ~[?:?]
    at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?]
    at java.awt.Component.dispatchEvent(Component.java:4827) ~[?:?]
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) ~[?:?]
    at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?]
    at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?]
    at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) ~[?:?]
    at java.awt.EventQueue$5.run(EventQueue.java:747) ~[?:?]
    at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?]
    at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:744) ~[?:?]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?]
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?]
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?]
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]

Playlist URL https://peertube2.cpy.re/static/streaming-playlists/hls/dfd70b83-639f-4980-94af-304a56ab4b35/cbb6eaf8-52f8-4146-9d77-cdbae915913a-master.m3u8

RicardoPoleo commented 2 years ago

Hello @kontrollanten,

Thanks for taking the time to report this behavior.

I did a test and this issue didn't appear. Did you update, by any chance, the hlsparserj library? We did some changes there as well.

I would recommend you to do a smoke test using the libraries that were uploaded into the pre-release v3.2, and let us know if this behavior remains.

Just for the record, I used those libraries with JMeter 5.5.

Once again, thanks for taking the time and happy hacking ๐Ÿš€

kontrollanten commented 2 years ago

I see. How do I install the libraries? I'm using MacOS if that affects.

RicardoPoleo commented 2 years ago

Don't worry, it is as simple as copying and pasting files into the JMeter libraries folder (the OS should not affect it). The JMeter Plugins usually do this for you but, since we are in a pre-release, you have to do it manually.

Manual Installation of a library in JMeter

  1. Download the jar (library) that you want to install from the pre-release (in this case in particular, hlsparserj is the one you want)
  2. Go to JMETER_DIRECTORY/lib
  3. Delete the previous version of that library (I think it should be named hlsparserj-c287e78.jar, but delete anything called hlsparserj just to be sure)
  4. Copy the jar that you downloaded from the step 1 there.

And that should be it.

In general terms, what we recommend is to do a smoke test (to avoid the hassle of tracking down which libraries to delete and which ones to copy).

I'm pretty sure you know how to do it but, if you don't mind, I'll leave it here if anyone else needs to do it ๐Ÿ˜‰ ).

Manual Installation of the HLS Plugin

For it to be a Smoke Test, you should download and install brand new JMeter (like 5.5 for example), so it doesn't have any particular modifications.

  1. Download all the .jar files from the pre-release
  2. Unzip your JMeter
  3. Copy all the .jar except jmeter-bzm-hls-3.2.jar into JMETER_DIRECTORY/lib
  4. Copy jmeter-bzm-hls-3.2.jar into JMETER_DIRECTORY/lib/ext
  5. Start JMeter

With that, you are ready to go.

Please, give it a try and let me know how it behaves.

Regards

kontrollanten commented 2 years ago

It seems to be one step forward. But it still doesn't seem to work. Here's my config:

image

When I click "Load playlist" the following is in the jmeter log "2022-09-30 14:46:40,553 INFO c.b.j.h.g.HlsSamplerPanel: Finished loading variants", but nothing on screen changes (maybe it shouldn't). When I press "Start" the counter in the upper right corner counts to 3 and then stops. The following gets logged.

2022-09-30 14:47:35,885 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-09-30 14:47:35,886 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-09-30 14:47:35,886 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-09-30 14:47:35,933 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2022-09-30 14:47:35,933 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2022-09-30 14:47:35,934 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-09-30 14:47:35,934 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-09-30 14:47:35,934 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-09-30 14:47:35,935 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2022-09-30 14:47:35,934 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
RicardoPoleo commented 2 years ago

Yes, that seems to be working fine.

Upon clicking on "Load Playlist", all the variants for that playlist will be loaded into the UI, you just need to check the combo boxes to see them. For instance, I click on the Resolution and the following appears. Screen Shot 2022-09-30 at 11 46 17

The same applies for bandwidth. Screen Shot 2022-09-30 at 11 46 01

Apparently, there are no additional tracks for audio and subtitle.

Regarding the play button, you need to add a View Result Tree to your Test Plan in order to see it working (otherwise, the request will be made, but you wonโ€™t be able to see it, and that would be a shame, isn't it? ๐Ÿ˜‰ ). Screen Shot 2022-09-30 at 11 48 54

I would recommend you to add the View Result Tree and see the results when playing the test plan. As long as there are no errors displayed in the log, we can discard theNullPointerException that we had prior to the pre-release. Screen Shot 2022-09-30 at 11 57 44

Just for good measure, I left each configuration by default, as shown below: Screen Shot 2022-09-30 at 11 55 04

Give it a try and let's see how it goes @kontrollanten

kontrollanten commented 2 years ago

Thanks, I've never used JMeter before. It works! Great, thanks for all your help!

RicardoPoleo commented 2 years ago

Glad I could help @kontrollanten ๐Ÿ˜„.

Since the issue appears to be fixed, I'll be closing this issue, however, if you experience another issue, don't hesitate to open another issue.

Have a great week ๐Ÿš€ !