Closed Bug 1678254 Opened 4 years ago Closed 3 years ago

Debugger not finding sources in localhost

Categories

(DevTools :: Debugger, defect, P2)

Firefox 83
defect

Tracking

(Fission Milestone:M7a, firefox-esr78 unaffected, firefox88 wontfix, firefox89 wontfix, firefox90 fixed)

RESOLVED FIXED
90 Branch
Fission Milestone M7a
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- wontfix
firefox89 --- wontfix
firefox90 --- fixed

People

(Reporter: mattia.basaglia, Assigned: ochameau)

References

(Regression)

Details

(Keywords: regression, regressionwindow-wanted, Whiteboard: dt-fission-m3-mvp)

Attachments

(3 files)

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

Steps to reproduce:

I was testing a web page on localhost, and opened the debugger tab in the developer tools.

Actual results:

it said "this page has no source", this happens for every page in localhost. but the same code under some other domain works fine.

It happens if I access the pages as localhost and 127.0.0.1, but if I use some other alias I have in /etc/hosts it works fine.

Expected results:

it should show the js files for that page.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Debugger
Product: Firefox → DevTools

Based on the user agent, this is linux, so likely not related to bug 1677806.
Could you try to use https://mozilla.github.io/mozregression/ to identify when this started happening? Thanks

Flags: needinfo?(valentin.gosu) → needinfo?(mattia.basaglia)

I reinstalled firefox and now sources appear sometimes but don't appear other times, bisecting might be difficult.

I've also discovered that the issue happens per tab, if I open a new tab to the same page it works fine.

QA Whiteboard: [qa-regression-triage]

I'm reproducing this frequently with the following:

  • Refresh the page a few times, working on a project with WebConsole open.
  • Add a debugger statement to the original sources.
  • Refresh the page.
  • The debugger catches and pauses.
  • No sources are listed anywhere.
  • The following error is in the browser console.
Error: Resource "server0.conn13.child3/source100" already exists, cannot insert {"id":"server0.conn13.child3/source100","actor":"server0.conn13.child3/source100","thread":"server0.conn13.child3/thread22","source":"sourceURL-resource://gre/modules/ExtensionContent.jsm","isBlackBoxed":false,"sourceMapBaseURL":"resource://gre/modules/ExtensionContent.jsm","sourceMapURL":null,"url":"resource://gre/modules/ExtensionContent.jsm","breakpointPositions":{},"breakableLines":null}
    insertResources resource://devtools/client/debugger/src/utils/resource/core.js:42
    update resource://devtools/client/debugger/src/reducers/source-actors.js:34
    Redux 2
    waitUntilService resource://devtools/client/debugger/src/actions/utils/middleware/wait-service.js:71
    promiseMiddleware resource://devtools/client/debugger/src/actions/utils/middleware/promise.js:46
    context resource://devtools/client/debugger/src/actions/utils/middleware/context.js:35
    thunk resource://devtools/client/debugger/src/actions/utils/middleware/thunk.js:29
    dispatch Redux
    insertSourceActors resource://devtools/client/debugger/src/actions/source-actors.js:21
    thunk resource://devtools/client/debugger/src/actions/utils/middleware/thunk.js:29
    dispatch Redux
    newGeneratedSources resource://devtools/client/debugger/src/actions/sources/newSources.js:350
    thunk resource://devtools/client/debugger/src/actions/utils/middleware/thunk.js:29
    bindActionCreator Redux
    onSourceAvailable resource://devtools/client/debugger/src/client/firefox.js:157
Promise-backend.js:964:35

This was on Mac, Dev Edition, Firefox 84.0b6.

I've reproduced this both on a built webpack project, and a non-built project with <script type="module">. These were all on localhost, but I'm not sure that it matters.

Closing the tab, and re-opening can make the problem go away. I suspect a race condition in source loading as I have trouble reproducing it reliably.

ni: ochameau since we were chatting about this on Matrix, and I wanted to bring it to your attention. This user seems to be experiencing the same issue as me.

Flags: needinfo?(poirot.alex)

Hmmm... re-reading the details of the original post I realize my steps are a bit different here.

mattia.basaglia, are your also having troubles with a website using sourcemaps ?
(I'm trying to understand if that only fails with sourcemaps)

I'm not able to reproduce this easily.

Greg, Are you having some addons installed?
Your exception mention resource://gre/modules/ExtensionContent.jsm source.
You are only using regular devtools and not the Browser toolbox? It is a bit surprising to see this file appear in the regular devtools!

I tried simple sourcemapped/or not sourcemapped test pages locally without success,
I also tried debugging an online profile of the profiler, same, the debugger breaks and the sources appear.

If you have something I can reproduce (even intermittently) with a website available online, that could help.

(In reply to Alexandre Poirot [:ochameau] from comment #7)

mattia.basaglia, are your also having troubles with a website using sourcemaps ?
(I'm trying to understand if that only fails with sourcemaps)

No, it's just normal files. It doesn't even show the html page in the list of sources

I think this has been regressed by bug 1620280.
And bug 1644188, which landed today, not very intentionaly fixed that regression.
We might still want to proceed with comment 11's patch in order to fix backward compat usecases.

Regressed by: 1620280
Has Regression Range: --- → yes
See Also: → 1677469
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Whiteboard: dt-fission-m3-mvp

Tracking dt-fission-m3-mvp bugs for Fission MVP.

Fission Milestone: --- → MVP

This is more about clean up at this point and we can move it to the reserve list.

Whiteboard: dt-fission-m3-mvp → dt-fission-m3-reserve

Moving "dt-fission-m3-reserve" bugs to "dt-fission-future" because they don't block Fission MVP.

Fission Milestone: MVP → Future
Whiteboard: dt-fission-m3-reserve → dt-fission-future

Removing needinfo since it's showing up in my bug dashboard.

Flags: needinfo?(poirot.alex)
Attachment #9192015 - Attachment description: Bug 1678254 - Stop unwatching/rewatching for resources on each page load from the source map service. → Bug 1678254 - [devtools] Stop unwatching/rewatching for resources on each page load from the source map service.
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Blocks: 1692841
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9825dda94577
[devtools] Stop unwatching/rewatching for resources on each page load from the source map service. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/699bd6ddd665
[devtools] Pass `commands` instead of `toolbox` to SourceMapUrlService. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/60197e4e1341
[devtools] Check descriptor type instead of current target. r=jdescottes
Whiteboard: dt-fission-future → dt-fission-m3-triage
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Fission Milestone: Future → M7a

Hi Alex. Could you add a note in the team stand-up about the point complexity for this bug. Thanks.

Flags: needinfo?(poirot.alex)

Ah nevermind bug 1700955 is more likely for that, I hadn't realized these changes were for AWSY.

Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Flags: needinfo?(poirot.alex)
QA Whiteboard: [qa-regression-triage] → [qa-regression-triage] [qa-90b-p2]
Flags: needinfo?(mattia.basaglia)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: