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

Device registration: User message in case of connection failure #5348

Closed
radinamatic opened this issue Nov 30, 2016 · 24 comments
Closed

Device registration: User message in case of connection failure #5348

radinamatic opened this issue Nov 30, 2016 · 24 comments

Comments

@radinamatic
Copy link
Member

radinamatic commented Nov 30, 2016

Suggested change

Old:

 <p>{% trans "The device needs to have internet access when first being registered. Please ensure it is connected to the internet, and then" %} <a href="." class="refresh-link">{% trans "refresh this page" %}</a>.</p>

New:

<p>{% trans "The device needs internet access in order to be registered. Please ensure you are connected to the internet, and then" %} <a href="." class="refresh-link">{% trans "refresh this page" %}</a>. If you are still getting this message, it might indicate a temporary problem with the central server. Please wait a few minutes and try again later.</p>

...in python-packages/securesync/templates/securesync/register_public_key_client.html

Summary

KA Lite seems unable to connect to register the device in order to download the videos & languages. Refreshing the page has no effect, and the machine is correctly connected to Internet (see the loaded elpais.com in the other window).

Is staging.learningequality.org where the device register happens? It seems to be running OK, so the culprit might be other.

Screenshots

virtualbox_windows 7_30_11_2016_13_46_49

@radinamatic radinamatic self-assigned this Dec 6, 2016
@benjaoming
Copy link
Contributor

Just experienced exactly the same on FF, Ubuntu 0.16.9 installation.

@radinamatic are you able to reproduce this for 0.16.9 in all cases? It might be a server-side issue..

@benjaoming
Copy link
Contributor

Also, try running the server with kalite start --foreground in order to get more logging and see what it says at the exact moments of registration.

@radinamatic
Copy link
Member Author

Apparently, one-click registration on WXP is working today:

virtualbox_wxp_14_12_2016_14_47_52

virtualbox_wxp_14_12_2016_14_49_17

@radinamatic
Copy link
Member Author

Works on Ubuntu too, fresh 0.16.9 install:

virtualbox_gubuntu_14_12_2016_15_04_36

Seems it's most likely the temporary problem with our server, so I suggest changing this line into:

<p>{% trans "The device needs internet access in order to be registered. Please ensure you are connected to the internet, and then" %} <a href="." class="refresh-link">{% trans "refresh this page" %}</a>. If you are still getting this message, it might indicate a temporary problem with the central server. Please wait a few minutes and try again later.</p>

@benjaoming
Copy link
Contributor

@radinamatic okay the string freeze is up, but I think you are hinting at two issues:

  1. a possible issue with network connectivity during registration, could be related to other DNS issues we've discussed
  2. a user message change.

I'm altering the issue to be about the latter, if you have more information to provide on the first subject, please open a new issue.

@benjaoming benjaoming changed the title 0.16.9 cannot connect to register device Device registration: User message in case of connection failure Dec 16, 2016
@benjaoming
Copy link
Contributor

Changed description.

@radinamatic
Copy link
Member Author

@benjaoming User message change is generic enough in order to cover multiple connection issues. If the string freeze is up, does that mean it will not make it for the 0.17?

@benjaoming
Copy link
Contributor

@radinamatic - that would have been the standard policy, however I don't see a problem adding an error message in this case and it gets released untranslated, it's an error message after all.

@benjaoming
Copy link
Contributor

It's freezing up again in 0.16.9. The same in 0.17.0. Still not seeing any useful log messages: No JS error, no server-side error, no connection error from the browser. Everything is stuck at this picture:

screenshot from 2017-01-31 17-56-53

@benjaoming
Copy link
Contributor

I have Wiresharked myself during this error message. No network activity at all during the error message.

@benjaoming
Copy link
Contributor

@benjaoming
Copy link
Contributor

Connection failures seem to be reproducing across the spectre. Downloading all_metadata.json is also failing. Suspecting new CSP / CORS stuff to be the cause.

@benjaoming
Copy link
Contributor

@rtibbles
Copy link
Member

rtibbles commented Feb 2, 2017

Adding dataType to jsonp might be sufficient to fix this: https://github.com/learningequality/ka-lite/blob/master/kalite/updates/static/js/updates/bundle_modules/update_languages.js#L35

So this options object becomes:

{
    cache: false,
    dataType: "jsonp"
}

@benjaoming
Copy link
Contributor

Hmm, I tried to update django-cors-headers to work with Django 1.5.. which was a rabbit hole.

Trying @rtibbles 's suggestion to change to jsonp..

@benjaoming
Copy link
Contributor

@rtibbles oh yes, I tried that yesterday, we need to list out the json fields, too, but seems plausible. Will PR soon..

@benjaoming
Copy link
Contributor

Changed to jsonp but the request is still never received by Pantry, and XHR .fail is still called straight-away.

@benjaoming
Copy link
Contributor

Thanks Chromium, this error message helps a lot :)

XMLHttpRequest cannot load http://pantry.learningequality.org/downloads/ka-lite/0.17/content/contentpa…ata.json?callback=jQuery21407293127653173606_1486484313736&_=1486484313737. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 405.

@benjaoming
Copy link
Contributor

Some gateway in front of the Pantry server seems to be giving a 405 when the browser tries to retrieve CORS policies:

jquery.js:8630 OPTIONS http://pantry.learningequality.org/downloads/ka-lite/0.17/content/contentpa…ta.json?callback=jQuery214017264082951495596_1486485490415&_=1486485490416 405 (Not Allowed)

Can someone please tell me why we even have a gateway in front of Pantry and if we can lower the complexity level a bit here? :)

@radinamatic
Copy link
Member Author

Pinging @aronasorman 🆘

@benjaoming
Copy link
Contributor

Okay, we got through the diversion - actually the problem was a misconfiguration of pantry.learningequality.org and that's been fixed.

We can concentrate on the original issue about the user message.

@radinamatic
Copy link
Member Author

Latest screencast is here.

@mrpau-eugene
Copy link
Contributor

Has anyone filed a PR on updating the user message in case the internet is unavailable or gets disconnected?

@benjaoming
Copy link
Contributor

@mrpau-eugene no, this issue is still unsolved and relevant, PR is welcome!

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