Open Bug 1920387 Opened 2 months ago Updated 15 days ago

"Firefox Profiler Couldn’t retrieve the profile from ⁨Firefox⁩." [Failed to get the active browserId while starting the profiler recording-utils.js:]

Categories

(Thunderbird :: General, defect)

Thunderbird 128
defect

Tracking

(Not tracked)

People

(Reporter: mbfdias, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

Attached image LckP0ixshOhzD0Ed.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0

Steps to reproduce:

when I start the profiler, I can do through start recording and capture recording, but then I end up on a page with "Firefox Profiler

Couldn’t retrieve the profile from ⁨Firefox⁩.

Error: /from-browser only works in Firefox browsers

The full stack has been written to the Web Console.
Back to home"

and can't actually do any profiling :-(

Actual results:

Firefox Profiler

Couldn’t retrieve the profile from ⁨Firefox⁩.

Error: /from-browser only works in Firefox browsers

The full stack has been written to the Web Console.
Back to home

and the console has this error: (also attached the screen shot of the error)

Failed to get the active browserId while starting the profiler. recording-utils.js:29:11
getActiveBrowserID resource://devtools/shared/performance-new/recording-utils.js:29
startProfiler resource://devtools/server/actors/perf.js:64
handler resource://devtools/shared/protocol/Actor.js:196
onPacket resource://devtools/server/devtools-server-connection.js:371
_onJSONObjectReady resource://devtools/shared/transport/transport.js:463
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103

Expected results:

profiled data should be sent to https://profiler.firefox.com

Similar to bug 1787457, but that reporter didn't have trouble starting it.

I get the same error on error console about browserid, so I think that is just normal. I was able to profile on Mac daily build. I haven't tested esr.

Component: Untriaged → General
See Also: → 1787457
Summary: Failed to get the active browserId while starting the profiler → "Firefox Profiler Couldn’t retrieve the profile from ⁨Firefox⁩." [Failed to get the active browserId while starting the profiler recording-utils.js:]
See Also: → 1920296
See Also: → 1771304

Looks like the profiler website has started to do user-agent sniffing. Daily identifies as Firefox so it's still working there.

It's interesting, because the code that does this error hasn't changed since 2021. Maybe it never worked in some versions of thunderbird? I can reproduce with my version of Thunderbird, so I'll follow-up on the github bug.

The browserId error is a red herring: it's about the currently active tab, but thunderbird doesn't usually have tabs hence the error.

As a temporary workaround, you can profile with these steps:

  1. launch thunderbird with --start-debugger-server
  2. connect to thunderbird from firefox' about:debugging page (to localhost:6000)
  3. click "profile performance" at the top of the page

We can definitely sniff Thunderbird in our code, but I do think that Thunderbird's user agent should include Firefox/<something> like all other Gecko and Firefox-based browsers I've looked for. What do you think Wayne? Is there a reason this isn't the case?

Flags: needinfo?(vseerror)

The current user agent looks like so
"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Thunderbird/128.2.3"
IMO it should look something like this:
"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 Thunderbird/128.2.3"

Looks like this was changed in https://bugzilla.mozilla.org/show_bug.cgi?id=1903451
No I misread the patch.

Keywords: regression
Regressed by: 1903451

No, it was not. That was already the state on non-Nightly builds.

Only Daily identifies as Firefox, because we needed it for FxA to implement Sync, and the Sync code only exists on Nightly.

Status: UNCONFIRMED → NEW
Ever confirmed: true
No longer regressed by: 1903451

Yeah sorry, I misread the patch.

Just curious, is there any specific reason not to set general.useragent.compatMode.firefox to true and add Firefox/x.y.z in every channels of Thunderbird in general?

I found the regression comes from a commit in the recent patch https://github.com/firefox-devtools/profiler/pull/5105, indeed the user agent sniffing code is there since 2021 but before that patch we were giving it always the Firefox user agent, so this was working in thunderbird.

I'm adding the check for Thunderbird in https://github.com/firefox-devtools/profiler/pull/5105.

My question in comment 5 and 6 about Thunderbird'd user agent is still valid :-)

Fix landed and deployed.

Let's keep the bug open until the question about user agents is answered :-)

(In reply to Julien Wajsberg [:julienw] from comment #5)

We can definitely sniff Thunderbird in our code, but I do think that Thunderbird's user agent should include Firefox/<something> like all other Gecko and Firefox-based browsers I've looked for. What do you think Wayne? Is there a reason this isn't the case?

Thanks. I think this is best answered by Rob or Magnus.

Flags: needinfo?(vseerror)
Flags: needinfo?(rob)
Flags: needinfo?(mkmelin+mozilla)

(In reply to Julien Wajsberg [:julienw] from comment #12)

Fix landed and deployed.

Let's keep the bug open until the question about user agents is answered :-)

I can confirm :) it works now :D

I'll defer to Magnus on this as the userAgent string can appear in mail headers as well. I doubt that would affect much, but who knows...

Flags: needinfo?(rob)
Blocks: tb128found

Thanks Julien, I'd found that commit and suspected it was the cause but never looked at the whole patch, only one of the file changes.

AIUI not having Firefox in the UA string comes from a time when Firefox and Thunderbird were both Mozilla's headline products, built on top of a shared code base. Thunderbird wasn't (and isn't) Firefox with some changes. IMO we should keep our identities separate, even if it does cause some minor problems like this one occasionally. There's enough information in our UA string about our rendering engine (Gecko/20100101) but I can understand why a site like profiler.firefox.com might go looking for the Firefox part of the string.

It's possible setting general.useragent.compatMode.firefox would be beneficial to compatibility, but yeah, we hadn't had too much problems with the current setting.

Flags: needinfo?(mkmelin+mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: