Open Bug 1353635 Opened 3 years ago Updated 2 years ago

JavaScript error: chrome://marionette/content/proxy.js, line 195: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (sendAsync)

Categories

(Testing :: Marionette, enhancement, P3)

Version 3
enhancement

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

Details

In some cases I see the following Javascript error thrown:

[task 2017-04-04T21:19:28.140129Z] 21:19:28     INFO -  JavaScript error: chrome://marionette/content/proxy.js, line 195: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIMessageSender.sendAsyncMessage]

It happens for:

>    // here sendAsync is actually the content frame's
>    // sendAsyncMessage(path, message) global
>    this.sendAsync(path, msg);

I  believe this happens when remoteness is changed and the message cannot be send back to the driver. Given that there is no way to fix it, I would propose we log this as info. So something like:

`Sending response to the chrome process failed: ${e.message}`

Andreas, what do you think?
Flags: needinfo?
I think there should be a general message receiver in chrome space that we can send errors to when they arise during the lifetime of a promise.

When we fail to send back a message, there is often a promise somewhere that waits for the response.  It would be good if we had the ability to abort/reject such promises whenever an internal problem arise in proxy.js.

A first pass on this would be to register a global error message handler in driver.js and have proxy.js use that when this.sendAsync fails.
Flags: needinfo?
So you would handle this and bug 1336137 differently? I think having such a global message receiver for errors, the promise code in proxy.js could fully make use of it, so we don't even experience a hang and also wouldn't need a timeout.

But what I wonder about this is how we can send a message to such a general receiver in chrome scope when the local message sender doesn't work anymore.
The solution I sketched out in https://bugzilla.mozilla.org/show_bug.cgi?id=1336137#c4 requires the same infrastructure: it needs a global handler in chrome that can receive messages at any point in time.  A failed call to sendAsync from the frame script could hit this, and a series of actions could be taken.

The first basic action would be to log a better error message than “NS_ERROR_ILLEGAL_VALUE: Component returned failure code”, but might also involve cancelling promises or mitigate experiences of a hang.
Summary: JavaScript error: chrome://marionette/content/proxy.js, line 195: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 → JavaScript error: chrome://marionette/content/proxy.js, line 195: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (sendAsync)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.