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 not compulsory to download videos and languages - redirect to device registration page not working #5401

Closed
radinamatic opened this issue Feb 2, 2017 · 13 comments
Assignees
Milestone

Comments

@radinamatic
Copy link
Member

Summary

Contrary to what used to happen in 0.16 releases, 0.17 does not require the user to register the device in order to download videos and languages.

System information

Please specify the KA Lite version you were using and your operating system!

  • Operating system: all
  • Version: 0.17b5
  • Browser: all

How to reproduce

  1. Fresh install
  2. Login as Admin
  3. Go to Video or Language tab - you are not redirected to Device Registration

Screenshots

(I'll try to grab a screencast)

Real-life consequences

Users not registering devices and our stats are not up-to-date.

@benjaoming
Copy link
Contributor

Confirmed - will try to see if I can plug the hole by adding a good old redirect on the language and video update pages. There's no harm in this, since these pages are almost useless on a device that doesn't have a connection.

In case a device has videos and content packs, but no internet connection and isn't registered, then the pages are useful for deleting stuff. But it should hardly matter... if someone deploys by copying .kalite folders without registering devices, I can't see why they would make use of the delete function from UI afterwards.

@radinamatic
Copy link
Member Author

Unable to register with today's 0.17b5 installer on Windows 7.

There's no alert message at all, even though the device is reported as not registered, refreshing the register page does nothing, no errors in the console...

w7b

@benjaoming
Copy link
Contributor

Fixed in #5404 :)

@benjaoming
Copy link
Contributor

@radinamatic the actual explanation is that if a device is offline, we don't require registration. Since the online detection part was broken due to a redirect on kalite.learningequality.org, and the function that was supposed to handle and assess the redirect wasn't configured to do so, the function i_am_online assumed the device was offline even though it was online :)

@radinamatic
Copy link
Member Author

Working correctly on the latest .deb:

Online, trying to download a language:

virtualbox_ubuntu 16 10_10_02_2017_11_03_38

Offline, trying to download a language:

virtualbox_ubuntu 16 10_10_02_2017_11_01_53

Offline, trying to download videos:

virtualbox_ubuntu 16 10_10_02_2017_11_01_41

Offline, register page:

virtualbox_ubuntu 16 10_10_02_2017_11_02_16

Once you are online again, auto-registration takes a second! 👍

@radinamatic
Copy link
Member Author

Getting the same error as @mrpau-eduard on OSX Mavericks while registering... 🤔

mavericks

virtualbox_mavericks_10_02_2017_11_48_23

@benjaoming

@radinamatic radinamatic reopened this Feb 10, 2017
@benjaoming
Copy link
Contributor

@radinamatic this seems sort of like a different error - because as you can see from the URL, you are already redirected to the registration page.

But I see a much bigger challenge, namely the fact that we don't even dump a traceback on the error page. I would suggest a <textarea> with the error for easy copy-paste and so it doesn't take up the full screen.

It also seems that the 500 page is missing some of the "friendlyness" that we've been talking about on other pages :)

@radinamatic
Copy link
Member Author

@benjaoming Better traceback would certainly be useful! 👍

@mrpau-richard
Copy link
Contributor

mrpau-richard commented Feb 13, 2017

Hi @benjaoming & @radinamatic I have these error logs when I register the device using this windows installer

Error

Sorry, this page is having an unexpected problem - the error is not your fault

Don't let that stop you, try selecting another video or exercise from ~30,000 videos and exercises to continue your learning...

If you are reporting the error, please make sure to include the following information:


URL: /securesync/register/
querystring: <QueryDict: {}>
Exception: Ben is testing

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\handlers\base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\views.py", line 31, in register_public_key
    return register_public_key_client(request)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\contrib\auth\decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\annoying\decorators.py", line 92, in wrapper
    output = function(request, *args, **kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\views.py", line 46, in register_public_key_client
    raise Exception("Ben is testing")
Exception: Ben is testing

@benjaoming
Copy link
Contributor

facepalming myself

@benjaoming
Copy link
Contributor

Fix is coming, if you want, you can already build against my PR branch, otherwise I'm waiting for the test to pass, then merging ASAP...

#5406

@radinamatic
Copy link
Member Author

I'm guessing there's no need for me to confirm these... 😂

@radinamatic
Copy link
Member Author

Latest installer by @mrpau-eduard on Windows 7

IE11

virtualbox_ie11 - win7_14_02_2017_20_33_57

Firefox

virtualbox_ie11 - win7_14_02_2017_20_28_11

Error seems the same for both browsers:

URL: /securesync/register/
querystring: <QueryDict: {}>
TypeError: __init__() takes exactly 3 arguments (1 given)

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\core\handlers\base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\views.py", line 31, in register_public_key
    return register_public_key_client(request)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\django\contrib\auth\decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\annoying\decorators.py", line 92, in wrapper
    output = function(request, *args, **kwargs)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\views.py", line 61, in register_public_key_client
    reg_response = client.register()
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\api_client.py", line 52, in register
    if not model.object.verify():
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\models.py", line 339, in verify
    return self.get_key().verify(self._hashable_representation(), self.signature)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\securesync\devices\models.py", line 219, in get_key
    self.key = crypto.Key(public_key_string=self.public_key)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\fle_utils\crypto.py", line 29, in __init__
    self.set_public_key_string(public_key_string)
  File "C:\Python27\lib\site-packages\kalite\packages\bundled\fle_utils\crypto.py", line 190, in set_public_key_string
    self._public_key = PYRSA.PublicKey.load_pkcs1(public_key_string)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\rsa\key.py", line 63, in load_pkcs1
    return method(keyfile)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\rsa\key.py", line 202, in _load_pkcs1_pem
    return cls._load_pkcs1_der(der)
  File "C:\Python27\lib\site-packages\kalite\packages\dist\rsa\key.py", line 165, in _load_pkcs1_der
    return cls(*as_ints)
TypeError: __init__() takes exactly 3 arguments (1 given)

@benjaoming benjaoming self-assigned this Feb 14, 2017
benjaoming added a commit that referenced this issue Feb 14, 2017
@benjaoming benjaoming removed the has PR label Feb 16, 2017
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

3 participants