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

Error on one-click device registration #306

Closed
benjaoming opened this issue Sep 3, 2019 · 2 comments
Closed

Error on one-click device registration #306

benjaoming opened this issue Sep 3, 2019 · 2 comments

Comments

@benjaoming
Copy link
Contributor

Server traceback shows that "version" string is too long...

[ERROR] [2019-09-03 15:24:27,769] django.request: Internal Server Error: /securesync/api/register
Traceback (most recent call last):
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/views/decorators/csrf.py", line 77, in wrapped_view
    return view_func(*args, **kwargs)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/securesync/devices/api_views.py", line 97, in register_device
    client_device.save(imported=True)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/securesync/devices/models.py", line 348, in save
    super(Device, self).save(*args, **kwargs)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/securesync/engine/models.py", line 354, in save
    super(SyncedModel, self).save(*args, **kwargs)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/models/base.py", line 546, in save
    force_update=force_update, update_fields=update_fields)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/models/base.py", line 650, in save_base
    result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/models/manager.py", line 215, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/models/query.py", line 1661, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/models/sql/compiler.py", line 937, in execute_sql
    cursor.execute(sql, params)
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/backends/mysql/base.py", line 130, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "/var/www/ka-lite-central/centralserver/../ka-lite-submodule/python-packages/django/db/backends/mysql/base.py", line 120, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 226, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorvalue
DatabaseError: (1406, "Data too long for column 'version' at row 1")

image


The error message was: <!DOCTYPE HTML> <html> <head> <!--[if lt IE 9]> <script src="/static/js/html5shiv.js"></script> <![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Error | KA Lite: An Offline, Installable Version of Khan Academy</title> <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-datepicker3.min.css" /> <link rel="stylesheet" type="text/css" href="/static/css/style.css" /> <link rel="stylesheet" type="text/css" href="/_generated/dynamic.css"> <link rel="shortcut icon" href="/static/images/favicon.ico"> <script src="/static/django_js_reverse/js/reverse.js"></script> <script type="text/javascript" src="/_generated/dynamic.js"></script> <script type="text/javascript" src="/static/js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="/static/js/jquery-ui/jquery-ui.min.js"></script> <script type="text/javascript" src="/static/js/underscore-min.js"></script> <script type="text/javascript" src="/static/js/purl.js"></script> <script type="text/javascript" src="/static/js/bootstrap.min.js"></script> <script type="text/javascript" src='/static/js/bootstrap-timepicker.min.js'></script> <script type="text/javascript" src="/static/js/i18n/en.js"></script> <script src="/static/js/distributed/bundles/bundle_common.js"></script> <script src="/static/js/distributed/bundles/bundle_base.js"></script> <script type="text/javascript"> window.sessionModel.set({ USER_URL : "/securesync/api/user/", STATIC_URL : "/static/", GET_VIDEO_LOGS_URL : "/api/videolog/", GET_EXERCISE_LOGS_URL : "/api/exerciselog/", GET_CONTENT_LOGS_URL : "/api/contentlog/", GET_ATTEMPT_LOGS_URL : "/api/attemptlog/", CURRENT_LANGUAGE : "en", CHANNEL : "khan" }); </script> <script type="text/javascript" src="/static/js/central/base.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-36937407-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); // track time on site/page more accurately (function (tos) { window.setInterval(function () { tos = (function (t) { return t[0] == 50 ? (parseInt(t[1]) + 1) + ':00' : (t[1] || '0') + ':' + (parseInt(t[0]) + 10); })(tos.split(':').reverse()); window.pageTracker ? pageTracker._trackEvent('Time', 'Log', tos) : _gaq.push(['_trackEvent', 'Time', 'Log', tos]); }, 10000); })('00'); // track outbound link clicks (function($) { $(function() { $('a[href^="http"]:not([href*="' + document.domain + '"])').click(function(e) { // When a user clicks an external link if ($(this).attr('target') !== '_blank') { e.preventDefault(); // If the link is not set to target='_blank' // set a 300ms delay before loading this page // which allows Google Analytics to register the event (function(a) { setTimeout(function() { document.location = a.attr('href'); },300) })($(this)); } window.pageTracker ? pageTracker._trackEvent('Outbound', $(this).attr('href'), "#" + $(this).closest('[id!=""]').attr('id')) : _gaq.push(['_trackEvent', 'Outbound', $(this).attr('href'), "#" + $(this).closest('[id!=""]').attr('id')]); }); }) })(jQuery) // track real user loadtimes in Pingdom var _prum = [['id', '53619b09abe53d25686956f7'], ['mark', 'firstbyte', (new Date()).getTime()]]; (function() { var s = document.getElementsByTagName('script')[0] , p = document.createElement('script'); p.async = 'async'; p.src = '//rum-static.pingdom.net/prum.min.js'; s.parentNode.insertBefore(p, s); })(); </script> </head> <body class=""> <div id="wrapper"> <div class="navbar kalite-navbar header-footer-bg" role="banner"> <div class="container"> <div class="row"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" aria-hidden="true" id="navbar_toggle"> <span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span> </button> <div class="navbar-brand"> <a href="/"> <img src="/static/images/horizontal-logo-small.png" alt="Home"> </a> <div class="pull-right visible-xs sitepoint" id="points-xs"></div> </div> </div> <div class="collapse navbar-collapse top-nav" role="navigation" aria-label="Main menu"> <ul class="nav navbar-nav navbar-right nav-tabs header__horizontal-menu" role="tablist"> <li> <a href="https://learningequality.org/ka-lite/" target="_blank"> About </a> </li> <li> <a href="/accounts/login/" id="login" class=""> Login </a> </li> <li> <a href="/accounts/register/" id="sign_up" class=""> Sign Up </a> </li> </ul> </div> </div> </div> </div> <div class="row-fluid" id="navbar-container"> <div class="max-width-container"> <div class="row-fluid"> <div class="span12"> </div> </div> </div> </div> <div id="content-container" class="container content content-padding" role="main"> <div id="message_container"> </div> <h1>Error</h1> <p>Sorry, but there was an error while trying to load the page.</p> <footer class="row-fluid"> <div class="span12 float-right"> <p></p> <p> &copy; 2016 <a href="//learningequality.org/">Learning Equality</a> </p> <p> Except where otherwise noted, content on this site is licensed under a<br /> <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International license.</a> </p> </div> </footer> </div> </div> </body> </html>
@benjaoming
Copy link
Contributor Author

Fixed in: learningequality/ka-lite#5597

@benjaoming
Copy link
Contributor Author

Fixed, deployed and tested!

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

No branches or pull requests

1 participant