ROOT Browser can't be used

ROOT experts,

I am trying to display data in ROOT, but when i try to use new TBrowser I get the message: “The ROOT browser cannot run in batch mode” although I at no point attempt to use batch mode. I am aware of the posts already discussing this issue, but the advice given did not fix it. Following the last recommendations using the --web command always results in “–web is disabled for security reasons” how do I enable it? Or is there a better way to address this problem? I am working on windows 10 with Ubuntu.

Thanks in advance for any help!

Welcome to the ROOT forum !

How did you start ROOT ?
Are you using it remotely via ssh ?

I don’t think so, I followed the install guide by physics matters for WSL and only need to source to access root.

Can you copy/paste here what you get in the terminal window from the point where you entered the root command ?

Of course!

$ root -l data_01.root
root [0]
Attaching file data_01.root as _file0…
(TFile *) 0x7ffff122d930
root [1] new TBrowser
Warning in <TBrowser::TBrowser >: The ROOT browser cannot run in batch mode
(TBrowser *) 0x7ffff185b410

Unless you have gROOT->SetBatch(); in your rootlogon.C or you connect to your machine using shh without the options -X -Y , I do not see any thing wrong…

I found ROOT.gROOT.SetBatch(True) in rootlogon.C in the tutorials folder of ROOT-6.30.04. Furthermore echo $SSH_CONNECTION does not return an anwser.

That’s why you are in batch mode. Remove this line.

I’m sorry I made a mistake it was a .rootlogon file. Removing the line did not fix it.

Can you try adding the option -n when you start root ?

Of course!

It unfortunately still looks the same.

$root -n -l data_01.root
root [0]
Attaching file data_01.root as _file0…
(TFile *) 0x7ffff3d0f7e0
root [1] new TBrowser
Warning in <TBrowser::TBrowser >: The ROOT browser cannot run in batch mode
(TBrowser *) 0x7ffff428e450

Did you look at ROOT on Windows 11 WSL2 / WSLg?

I tried adding the lines to .bashrc and changed the XLaunch settings to Disable server access control, but it did not fix the issue.

There are several posts on the forum about WSL/WSL2. Most of the time it is not related to ROOT, but only to the system configuration. E.g. just try to open a Web browser or any other GUI application. If it works, then the problem is in ROOT, otherwise this is an issue with your set-up

I tried to install and run chrome over Ubuntu, since sudo snap install firefox is not supported on the subsystem for Linux and got this error: $google-chrome
[0325/163021.680361:ERROR:exception_handler_server.cc(362)] getsockopt: Invalid argument (22)
[0325/163021.680781:ERROR:socket.cc(153)] unhandled cmsg -1431655766, -1431655766
[0325/163021.681775:ERROR:exception_handler_server.cc(362)] getsockopt: Invalid argument (22)
[2928:2928:0325/163021.681907:ERROR:socket.cc(153)] unhandled cmsg -1431655766, -1431655766
Trace/breakpoint trap (core dumped)
I am unsure however if this is due to an oversight on my end or an issue in the set-up…

Can you simply try Xeyes?

Yes, Xeyes works for me!

OK, so TBrowser should work as well…

It in fact does work now. I can’t explain why, all I did was reverse the changes made in the post you linked above so Xeyes could start, but that was checking a setting that wasn’t active before and adding lines, which I now removed again…

Anyways I’m glad it works now, thanks for the help!

1 Like

OK, glad to see you fixed the issue!