Workers: creating workers from 'localhost' or an IP address fails

RESOLVED FIXED in Firefox 9

Status

()

Core
DOM: Core & HTML
--
major
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: irakli, Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

({regression, verified-beta})

Trunk
mozilla9
x86
Mac OS X
regression, verified-beta
Points:
---

Firefox Tracking Flags

(firefox8- affected, firefox9- fixed, firefox10 fixed, firefox11 unaffected)

Details

(Whiteboard: [inbound][qa+][qa!:9])

Attachments

(2 attachments)

Any attempts to create a worker from localhost:

new Worker("http://localhost/~gozala/Projects/ace/ace/lib/ace/worker/worker.js")
new Worker("/~gozala/Projects/ace/ace/lib/ace/worker/worker.js")
new Worker("./worker/worker.js")

fails with errors:

[22:01:08.724] Error: Could not get domain!

Both on latest Aurora and Nightly.
 
Also same code works with FF 6.0

What's also interesting is that this issue does not seems to happen if page is accessed via http://jarti.lan/~gozala/Projects/ace/ace/ instead in which case worker URL is:

new Worker("http://jarti.lan/~gozala/Projects/ace/ace/lib/ace/worker/worker.js")

Updated

6 years ago
tracking-firefox8: --- → ?
tracking-firefox9: --- → ?
Keywords: regression
For the localhost case, are you accessing the page via http://localhost, or via file:// ?
(In reply to Boris Zbarsky (:bz) from comment #1)
> For the localhost case, are you accessing the page via http://localhost, or
> via file:// ?

localhost it's

http://localhost/~gozala/Projects/ace/ace/
Looks like WorkerPrivate::Create tries to do something with the tld service.. which presumably fails for localhost.  Ben, what's that code trying to do?
And is this a problem on the beta channel?
We try to limit the number of workers per domain, apparently TLDService doesn't support localhost so we'll just need to add another special case I guess.
Could we just check for NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS and do something sane with it?
Sure. Maybe we should just try to reuse ThirdPartyUtil::GetBaseDomain, it seems much better.
Duplicate of this bug: 683722
Alon, see comment 7?
Summary: creating workers from localhost throws errors → Workers: creating workers from 'localhost' or an IP address fails
Created attachment 557615 [details] [diff] [review]
Patch, v1
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #557615 - Flags: review?(jonas)

Updated

6 years ago
tracking-firefox8: ? → +
tracking-firefox9: ? → +
Duplicate of this bug: 682450
Attachment #557615 - Flags: review?(jonas) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/cfdf675266b2
Whiteboard: [inbound]
Backed out as part of <http://hg.mozilla.org/integration/mozilla-inbound/rev/cc0753a23f8b> because of mochitest-3 crashes like this: <https://tbpl.mozilla.org/php/getParsedLog.php?id=6340142&full=1>
Whiteboard: [inbound]
https://hg.mozilla.org/integration/mozilla-inbound/rev/307b5fa030fd
Whiteboard: [inbound]
Better, this time it was just test_ipAddressOrigin.html timing out. Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/70411e3adb66
Whiteboard: [inbound]
There's some problem with using 127.0.0.1 on linux in our test setup... Other OS seem fine. Not sure what's going on, we'll need to investigate more. For now, checked into inbound without the test:

https://hg.mozilla.org/integration/mozilla-inbound/rev/756d9bfae05d
tracking-firefox8: + → ?
tracking-firefox9: + → ?
OS: Mac OS X → Windows Mobile 6 Professional
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
Version: Trunk → Other Branch
https://hg.mozilla.org/mozilla-central/rev/756d9bfae05d
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
OS: Windows Mobile 6 Professional → Mac OS X
Resolution: --- → FIXED
Target Milestone: mozilla9 → mozilla10
Version: Other Branch → Trunk
Created attachment 567130 [details] [diff] [review]
Patch for branches

This is the patch for branches (simply adds a new interface rather than bumping the existing iid).
Attachment #567130 - Flags: review+
Attachment #567130 - Flags: approval-mozilla-beta?
Attachment #567130 - Flags: approval-mozilla-aurora?
Comment on attachment 567130 [details] [diff] [review]
Patch for branches

Per todays triage meeting this doesn't seem like a large enough problem to take on branches. If we missed something, please renominate and state why this is important to fix now rather than a few weeks later.
Attachment #567130 - Flags: approval-mozilla-beta?
Attachment #567130 - Flags: approval-mozilla-beta-
Attachment #567130 - Flags: approval-mozilla-aurora?
Attachment #567130 - Flags: approval-mozilla-aurora-

Comment 20

6 years ago
---------------------------------[ Triage Comment ]---------------------------------

Though it is a regression the problem seems small and generally not web facing. We will not track this for a specific Firefox version.

The patch appears to have landed on mozilla-central/Firefox 10 in any case.
tracking-firefox8: ? → -
tracking-firefox9: ? → -

Comment 21

6 years ago
WaveMaker studio is a development environment that runs on localhost and uses the ACE Editor (ace.ajax.org) which uses workers.

All of our users who use FireFox were automatically upgraded from a version where the development environment worked to one where it did not (Ok, it works, but with a crippled editor).

We are now able to provide a significantly better user experience to developers using Chrome than FireFox because of this issue.

I'd appreciate any information on which version of FireFox this fix will be available for; I'm going to have to post to my user community telling them NOT to upgrade to FireFox 8, and I'm sure they'd appreciate knowing how long they're going to be  fighting against your automatic upgrade system.
As things currently stand, this will get fixed in Firefox 10. Renominating based on your feedback.
tracking-firefox8: - → ?
tracking-firefox9: - → ?

Comment 23

6 years ago
Stepwells web based application is relying on the use of local web workers.

this bug caused us a lot of trouble, 
we needed to change our entire application design and tell our users to downgrade from firefox 8, 
or force them to use Chrome.

we are eagerly awaiting response on this issue and when will it be fixed.

Comment 24

6 years ago
Also affects the embedded editors of cde.webdetails.org (what we use in the mozilla metrics team to build the dashboards)
We've got reports of multiple broken apps here ... and we're considering taking the fix for blob URI works for 8.0.1, so we should probably consider this too.
Attachment #567130 - Flags: approval-mozilla-beta?
Attachment #567130 - Flags: approval-mozilla-beta-
Attachment #567130 - Flags: approval-mozilla-aurora?
Attachment #567130 - Flags: approval-mozilla-aurora-
Comment on attachment 567130 [details] [diff] [review]
Patch for branches

/me sets the flags he meant to set.
Attachment #567130 - Flags: approval-mozilla-aurora? → approval-mozilla-release?

Updated

6 years ago
Duplicate of this bug: 702011

Updated

6 years ago
Attachment #567130 - Flags: approval-mozilla-release?
Attachment #567130 - Flags: approval-mozilla-release+
Attachment #567130 - Flags: approval-mozilla-beta?
Attachment #567130 - Flags: approval-mozilla-beta+

Comment 28

6 years ago
will this fix be out in the next ff 8.0.1 version? 
or is it still expected in ff 10 ?
I think it's going to be in Firefox 9 now.
status-firefox10: --- → fixed
status-firefox11: --- → unaffected
status-firefox8: --- → affected
status-firefox9: --- → fixed
https://hg.mozilla.org/releases/mozilla-beta/rev/2e0d543637d3
I'm going to assume that the approval-mozilla-release here was a mistake.  LegNeato isn't answering me on IRC :-/
Comment on attachment 567130 [details] [diff] [review]
Patch for branches

That's a safe assumption  - we don't know whether we're re-spinning so denying for approval-mozilla-release for now, but will leave the FF8 tracking flag as ?.
Attachment #567130 - Flags: approval-mozilla-release+ → approval-mozilla-release-

Comment 33

6 years ago
We're watching this closely but for now it did not make 8.0.1. If other issues crop up we will consider this as a ride-along now that the extent of the problem is greater than previously thought.

We are building Firefox 9 beta 2 today and by the end of the week it should be on the beta channel. You can point users to that if you'd like. It should be fixed in Fx 9 proper, due December 20th.
Is this something QA can verify?
Whiteboard: [inbound] → [inbound][qa?]

Updated

6 years ago
tracking-firefox8: ? → -
tracking-firefox9: ? → -
FYI: I'm seeing this error when using http://127.0.0.1 on FF8.0 on Ubuntu Linux, so I'm not sure there's a reasonable path to test WebWorkers on a local machine, short of /etc/hosts, which is kind of unfortunate.

Comment 36

6 years ago
If you just need something to test, WaveMaker is a free download; will take a few minutes to install its dependencies (also free).  To test the webworkers, you can open a new project, click the source tab, and you'll see the ACE editor running with its javascript-worker either running or failing to run.  Everything is open source.

http://wavemaker.com/downloads/
Target Milestone: mozilla10 → mozilla9
Whiteboard: [inbound][qa?] → [inbound][qa+]

Comment 37

6 years ago
Setting resolution to Verified fixed on:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0

I've followed the steps from comment36 and everything works as expected. No errors.
Keywords: verified-beta
Whiteboard: [inbound][qa+] → [inbound][qa+][qa!:9]

Comment 38

6 years ago
I have verified that this now works for me; testing the ACE editor's javascript validation worker running on localhost (using the above posted wavemaker application)

Thank you for fixing this!

Michael
Can we get specific steps to reproduce on this? 

I tried Wavemaker in Mac Fx 8.0.1, and did get a couple of domain errors similar to Comment 0. However, I got them on the initial load of Wavemaker, and had no further errors creating projects or going to the source pane, nor did I see any app misbehavior (to the extent I understand the app).

I did not get these errors in 10.0b2, which I suspect means we're good. However, until I understand exactly where the errors are supposed to appear I do not want to mark it this verified.

Comment 40

6 years ago
1. Visual errors as seen within the application: you should be able to mess up your javascript and webworkers will flag that there are problems with validating javascript by putting red "x" in the left column; the following code has a comma missing and should show a red "x":

dojo.declare("Main", wm.Page, {
	start: function() {
		try {
			
			
		} catch(e) {
			app.toastError(this.name + ".start() Failed: " + e.toString()); 
		}
	}
  _end: 0
});

2. Console errors: I don't have FF 8 running so I can't confirm the errors you should be seeing, but another way to look at this from the console is to type in:

new Worker("/wavemaker/app/lib/ace/worker-javascript.js")

and see what happens.

Comment 41

6 years ago
Hi Geo.

Have you found any new errors?
I was testing this on Firefox 10b6 on MacOSX 10.6.8 and I got the following error  
"Error: not well-formed
Source File: http://localhost:8094/wavemaker/lib/build/Gzipped/lib_build.js
Line: 1, Column: 1
Source Code:
/*"


(In reply to Geo Mealer [:geo] from comment #39)
> Can we get specific steps to reproduce on this? 
> 
> I tried Wavemaker in Mac Fx 8.0.1, and did get a couple of domain errors
> similar to Comment 0. However, I got them on the initial load of Wavemaker,
> and had no further errors creating projects or going to the source pane, nor
> did I see any app misbehavior (to the extent I understand the app).
> 
> I did not get these errors in 10.0b2, which I suspect means we're good.
> However, until I understand exactly where the errors are supposed to appear
> I do not want to mark it this verified.
You need to log in before you can comment on or make changes to this bug.