Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent: Failed to load ‘https://knilxof.org:4443/ping’. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: NetworkError #174

Open
JohanLorenzo opened this issue Jun 10, 2016 · 12 comments

Comments

@JohanLorenzo
Copy link
Contributor

JohanLorenzo commented Jun 10, 2016

Steps to reproduce

Manually:

  1. Restart your computer (it enabled reproduction 4/4 times -- thanks for the trick @npark-mozilla ).
  2. Dowload this Firefox profile and start Firefox with it
  3. In foxbox: cargo build
  4. In the app: gulp
  5. In foxbox: ./run.sh
  6. In Firefox: go to https://localhost:8000

Automatically:

  1. Restart your computer.
  2. Apply [Blocked] Selenium tests: Use Marionette instead of add-on based driver #161
  3. npm test | grep -v 'firefox_profile'

Results

The "connect to your foxbox" button remains greyed out. This makes the Seleniums tests in #161 flaky (around 1/3 times).

The webconsole shows:

Error occurred while fetching content:  TypeError: NetworkError when attempting to fetch resource.app.js:2:11054

ie</t.prototype[ne.fetch]/<()app.js:2
(Async: promise callback) ie</t.prototype[ne.fetch]()app.js:2
ie</t.prototype.fetchJSON()app.js:2
Ce</t.prototype._initDiscovery()app.js:3
Ce</t.prototype.init()app.js:3
Ee</t.prototype.main()app.js:3
<anonymous>app.js:3
c()alameda.js:1
(Async: promise callback) h()alameda.js:1
newContext/P/<()alameda.js:1
newContext/P()alameda.js:1
i()alameda.js:1
newContext/A</<()alameda.js:1
(Async: EventListener.handleEvent) newContext/A<()alameda.js:1
newContext/j()alameda.js:1
h()alameda.js:1
newContext/P/<()alameda.js:1
newContext/P()alameda.js:1
(Async: promise callback) o/t()alameda.js:1
<anonymous>bootstrap.js:1
(Async: promise callback) <anonymous>bootstrap.js:1
c()alameda.js:1
newContext/P()alameda.js:1
i()alameda.js:1
(Async: EventListener.handleEvent) newContext/A<()alameda.js:1
newContext/j()alameda.js:1
h()alameda.js:1
newContext/P/<()alameda.js:1
newContext/P()alameda.js:1
(Async: promise callback) o/t()alameda.js:1
<anonymous>alameda.js:1
<anonymous>alameda.js:1


Retrying box discovery... Reason is  TypeError: NetworkError when attempting to fetch resource.app.js:3:3225
TypeError: NetworkError when attempting to fetch resource.sww.js:405:37

Failed to load ‘https://knilxof.org:4443/ping’. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: NetworkError when attempting to fetch resource.’.sww.js:392:2
Error occurred while fetching content:  TypeError: NetworkError when attempting to fetch resource.app.js:2:11054

Retrying box discovery... Reason is  TypeError: NetworkError when attempting to fetch resource.app.js:3:3225
TypeError: NetworkError when attempting to fetch resource.sww.js:405:37

[Looping over and over for more than 60s]
@JohanLorenzo
Copy link
Contributor Author

@arcturus It seems the SW is correctly registered but can't fetch the content of https://knilxof.org:4443/ping. Would it be possible to print out what's the response given?

@arcturus
Copy link
Contributor

@JohanLorenzo you can enable debug on SW following the next steps to build a version of the library with debug:

  • go to node_modules/serviceworkers-ware
  • npm install
  • gulp bundle-debug

And rebuild the app

@azasypkin azasypkin self-assigned this Jun 14, 2016
@azasypkin
Copy link
Member

Looking at this.

@azasypkin
Copy link
Member

Hey @JohanLorenzo what I see is that https://knilxof.org:4443/ has invalid certificate that's why we can't get any data from it. Once you add exception - it works fine.

Or you see something different?

@azasypkin
Copy link
Member

Note I'm using your PR #161 locally

@azasypkin
Copy link
Member

Also I'm wondering why do we need real registration server?

I feel tests will be too flaky if we rely on external thing....

@JohanLorenzo
Copy link
Contributor Author

That might be it. One one hand, https://knilxof.org:4443/ may not be an issue because it intermittently passed. On the other hand, that's one clear change between the old tests set up and the new one.

If that's the problem, re-issuing a Let's Encrypt certificate should make the PR pass for the next few days. I remember @gmarty and @michielbdejong were talking about it, last week. I don't recall if it was addressed, though.

On your second point, I agree the real registration server shouldn't be used. That's a good follow up, IMO.

So, I'd propose we fix the certificate on knilxof and see if it makes things better. If not, we change mock out the registration server.

@azasypkin
Copy link
Member

If that's the problem, re-issuing a Let's Encrypt certificate should make the PR pass for the next few days.

I'm not sure if that's enough :) I suspect that your PR is relying on real foxbox instance now and its signup and login pages are quite different from what we had in simulator. I didn't go through your PR so maybe you already have necessary changes in tests, if so that's great!

On your second point, I agree the real registration server shouldn't be used. That's a good follow up, IMO.
So, I'd propose we fix the certificate on knilxof and see if it makes things better. If not, we change mock out the registration server.

Yep, it can surely be a follow-up, agree.

So @michielbdejong could you please help with updating certificate at https://knilxof.org:4443/?

@azasypkin azasypkin removed their assignment Jun 15, 2016
@azasypkin
Copy link
Member

So nothing to do for me here, unassigning.

@JohanLorenzo
Copy link
Contributor Author

I'm not sure if that's enough :) I suspect that your PR is relying on real foxbox instance.

The PR hasn't (shouldn't have 😃 ) changed the role of the simulator. We still use it for the integration tests.

@azasypkin
Copy link
Member

OK then I think I'm missing something in the integration tests setup.. Let's talk on irc once you come back from London :)

@michielbdejong
Copy link
Contributor

re-issuing a Let's Encrypt certificate should make the PR pass for the next few days. I remember @gmarty and @michielbdejong were talking about it, last week. I don't recall if it was addressed, though.

It was, current certificate is valid 3 June - 1 Sep 2016, you can check this by viewing the padlock details on https://knilxof.org:4443/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants