learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
771 stars 647 forks source link

Setup wizard fails in the final step, returns 500 error #10459

Closed marcellamaki closed 1 year ago

marcellamaki commented 1 year ago

Observed behavior

When setting up a new LOD account on @rtibbles's server, the setup wizard failed for me at the final stage. There was nothing in the UI to indicate a problem, although I was getting a 500 error in the console.

Errors and logs

kolibri.txt

When I start over to create the user, it says the newly created username already exists

Screenshot 2023-04-12 at 9 49 30 AM
``` DoesNotExist at /api/device/deviceprovision/\nFacility matching query does not exist. \n\nRequest Method: POST\nRequest URL: http://127.0.0.1:8000/api/device/deviceprovision/ \nDjango Version: 1.11.29\nPython Executable: /Users/marcellamaki/.pyenv/versions/3.9.9/envs/ kolibri-develop/bin/python3.9\nPython Version: 3.9.9\nPython Path: ['/Users/marcellamaki/ Documents/learning-equality/kolibri/kolibri/dist', '/Users/marcellamaki/.pyenv/versions/3.9.9/ envs/kolibri-develop/bin', '/Users/marcellamaki/.pyenv/versions/3.9.9/lib/python39.zip', '/ Users/marcellamaki/.pyenv/versions/3.9.9/lib/python3.9', '/Users/marcellamaki/.pyenv/versions/ 3.9.9/lib/python3.9/lib-dynload', '/Users/marcellamaki/.pyenv/versions/3.9.9/envs/ kolibri-develop/lib/python3.9/site-packages', '/Users/marcellamaki/Documents/ learning-equality/kolibri-release-utils', '/Users/marcellamaki/Documents/learning-equality/ kolibri']\nServer time: Wed, 12 Apr 2023 09:41:18 -0400\nInstalled Applications:\n['kolibri. core',\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'django_filters',\n 'kolibri.core.auth.apps.KolibriAuthConfig',\n 'kolibri.core.bookmarks',\n 'kolibri.core.content',\n 'kolibri.core.logger',\n 'kolibri.core.notifications.apps. KolibriNotificationsConfig',\n 'kolibri.core.tasks.apps.KolibriTasksConfig',\n 'kolibri.core. deviceadmin',\n 'kolibri.core.webpack',\n 'kolibri.core.exams',\n 'kolibri.core.device',\n 'kolibri.core.discovery',\n 'kolibri.core.lessons',\n 'kolibri.core.analytics',\n 'rest_framework',\n 'django_js_reverse',\n 'jsonfield',\n 'morango',\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n , \n ,\n 'drf_yasg']\nInstalled Middleware:\n['kolibri.core. analytics.middleware.cherrypy_access_log_middleware',\n 'kolibri.core.device.middleware. ProvisioningErrorHandler',\n 'kolibri.core.device.middleware.DatabaseBusyErrorHandler',\n 'django.middleware.cache.UpdateCacheMiddleware',\n 'kolibri.core.analytics.middleware. MetricsMiddleware',\n 'kolibri.core.auth.middleware.KolibriSessionMiddleware',\n 'kolibri.core. device.middleware.KolibriLocaleMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'kolibri.core.auth.middleware.CustomAuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.security. SecurityMiddleware',\n 'django.middleware.cache.FetchFromCacheMiddleware',\n 'kolibri.core. webpack.middleware.WebpackErrorHandler',\n 'kolibri.core.auth.middleware. XhrPreventLoginPromptMiddleware']\n\n\nTraceback: \n\nFile \"/Users/marcellamaki/.pyenv/ versions/3.9.9/envs/kolibri-develop/lib/python3.9/site-packages/django/core/handlers/exception. py\" in inner\n 41. response = get_response(request)\n\nFile \"/Users/ marcellamaki/.pyenv/versions/3.9.9/envs/kolibri- develop/lib/python3.9/site-packages/django/ core/handlers/base.py\" in _get_response\n 187. response = self. process_exception_by_middleware(e, request)\n\nFile \"/Users/marcellamaki/.pyenv/versions/3.9. 9/envs/kolibri-develop/lib/python3.9/site-packages/django/core/handlers/base.py\" in _get_response\n 185. response = wrapped_callback(request, *callback_args, **callback_kwargs)\n\nFile \"/Users/marcellamaki/.pyenv/versions/3.9.9/envs/kolibri-develop/ lib/python3.9/site-packages/django/views/decorators/csrf.py\" in wrapped_view\n 58. return view_func(*args, **kwargs)\n\nFile \"/Users/marcellamaki/.pyenv/versions/3.9.9/envs/ kolibri-develop/lib/python3.9/site- packages/rest_framework/viewsets.py\" in view\n 116. return self.dispatch(request, *args, **kwargs)\n\nFile \"/Users/marcellamaki/. pyenv/versions/3.9.9/envs/kolibri-develop/lib/python3.9/site-packages/rest_framework/views. py\" in dispatch\n 495. response = self.handle_exception(exc)\n\nFile \"/Users/ marcellamaki/.pyenv/versions/3.9.9/envs/kolibri-develop/lib/python3.9/site-packages/ rest_framework/views.py\" in handle_exception\n 455. self.raise_uncaught_exception (exc)\n\nFile \"/Users/marcellamaki/.pyenv/versions/3.9.9/envs/kolibri-develop/lib/python3 .9/ site-packages/rest_framework/views.py\" in dispatch\n 492. response = handler (request, *args, **kwargs)\n\nFile \"/Users/marcellamaki/Documents/learning-equality/kolibri/ kolibri/core/device/api.py\" in create\n 91. data = serializer.save()\n\nFile \"/ Users/marcellamaki/.pyenv/versions/3.9.9/envs/kolibri-develop/lib/python3.9/site-packages/ rest_framework/serializers.py\" in save\n 214. self.instance = self.create (validated_data)\n\nFile \"/Users/marcellamaki/Documents/learning-equality/kolibri/kolibri/ core/device/serializers.py\" in create\n 117. facility = Facility.objects.get (pk=facility_id)\n\nFile \"/Users/marcellamaki/.pyenv/versions/3.9.9/envs/kolibri-develop/lib/ python3.9/site-packages/django/db/models/manager.py\" in manager_method\n 85. return getattr(self.get_queryset(), name)(*args, **kwargs)\n\nFile \"/Users/marcellamaki/. pyenv/versions/3.9.9/envs/kolibri-develop/lib/python3.9/site-packages/django/db/models/query. py\" in get\n 378. raise self.model.DoesNotExist(\n\nException Type: DoesNotExist at /api/device/deviceprovision/\nException Value: Facility matching query does not exist. \nRequest information:\nUSER: AnonymousUser\n\nGET: No GET data\n\nPOST: No POST data\n\nFILES: No FILES data\n\nCOOKIES:\nvisitor_id = '6752f323ee2447d4a6b21b3463cb7fb2'\n_ga = 'GA1.1.474446880.1680185841'\ncsrftoken = 'xSt45Cy1yZhaWgnwCQCwOWXuFClCqw7ky7Ci4m8YbNEiQB17DkzN2G9xvVerL2LP'\nkolibri_studio_sessionid = 'agpfvyil1vikykj2lpicnyq6cu5i1bcb'\nkolibri_csrftoken = 'GRSzpsKSArKBmW2vw8OJj0P76j83bYZeeuuHfrOOQIuxsv9LPUbr8puo5La9man5'\n\nMETA:\nACTUAL_SERVER_PROT OCOL = 'HTTP/1.1'\nCONTENT_LENGTH = '386'\nCONTENT_TYPE = 'application/json'\nCSRF_COOKIE = 'GRSzpsKSArKBmW2vw8OJj0P76j83bYZeeuuHfrOOQIuxsv9LPUbr8puo5La9man5'\nHTTP_ACCEPT = 'application/ json, text/plain, */*'\nHTTP_ACCEPT_ENCODING = 'gzip, deflate, br'\nHTTP_ACCEPT_LANGUAGE = 'en- US,en;q=0.9,la;q=0.8'\nHTTP_CONNECTION = 'keep-alive'\nHTTP_COOKIE = 'visitor_id=6752f323ee2447d4a6b21b3463cb7fb2; _ga=GA1.1.474446880.1680185841; csrftoken=xSt45Cy1yZhaWgnwCQCwOWXuFClCqw7ky7Ci4m8YbNEiQB17DkzN2G9xvVerL2LP; kolibri_studio_sessionid=agpfvyil1vikykj2lpicnyq6cu5i1bcb; kolibri_csrftoken=GRSzpsKSArKBmW2vw8OJj0P76j83bYZeeuuHfrOOQIuxsv9LPUbr8puo5La9man5'\nHTTP_DNT = '1'\nHTTP_HOST = '127.0.0.1:8000'\nHTTP_ORIGIN = 'http://127.0.0.1:8000'\nHTTP_REFERER = 'http://127.0.0.1:8000/en/setup/'\nHTTP_SEC_CH_UA = '\"Google Chrome\";v=\"111\", \"Not (A:Brand\";v=\"8\", \"Chromium\";v=\"111\"'\nHTTP_SEC_CH_UA_MOBILE = '? 0'\nHTTP_SEC_CH_UA_PLATFORM = '\"macOS\"'\nHTTP_SEC_FETCH_DEST = 'empty'\nHTTP_SEC_FETCH_MODE = 'cors'\nHTTP_SEC_FETCH_SITE = 'same-origin'\nHTTP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537. 36'\nHTTP_X_CSRFTOKEN = 'GRSzpsKSArKBmW2vw8OJj0P76j83bYZeeuuHfrOOQIuxsv9LPUbr8puo5La9man5'\nHTTP_X_REQUESTED_WITH = 'XMLHttpRequest'\nPATH_INFO = '/api/device/deviceprovision/'\nQUERY_STRING = ''\nREMOTE_ADDR = '127.0.0.1'\nREMOTE_PORT = '62753'\nREQUEST_METHOD = 'POST'\nREQUEST_URI = '/api/device/ deviceprovision/'\nSCRIPT_NAME = ''\nSERVER_NAME = 'Cheroot/8.6.0'\nSERVER_PORT = '8000'\nSERVER_PROTOCOL = 'HTTP/1.1'\nSERVER_SOFTWARE = 'Cheroot/8.6.0 Server'\nwsgi.errors = <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>\nwsgi.input = \nwsgi.input_terminated = False\nwsgi.multiprocess = False\nwsgi.multithread = True\nwsgi.run_once = False\nwsgi.url_scheme = 'http'\nwsgi.version = '(1, 0)'\n\nSettings:\nUsing settings module kolibri.deployment.default.settings. dev\nABSOLUTE_URL_OVERRIDES = {}\nADDITIONAL_SQLITE_DATABASES = \"('syncqueue', 'networklocation', 'notifications')\"\nADMINS = []\nALLOWED_HOSTS = ['*']\nAPPEND_SLASH = True\nAUTHENTICATION_BACKENDS = ['kolibri.core.auth.backends.FacilityUserBackend'] \nAUTH_ANONYMOUS_USER_MODEL = 'kolibriauth.KolibriAnonymousUser'\nAUTH_PASSWORD_VALIDATORS = '********************'\nAUTH_USER_MODEL = 'kolibriauth.FacilityUser'\nBASE_DIR = '/Users/ marcellamaki/Documents/learning-equality/kolibri'\nCACHES = {'default': {'BACKEND': 'django. core.cache.backends.locmem.LocMemCache'}, 'process_cache': {'BACKEND': 'diskcache. DjangoCache', 'LOCATION': '/Users/marcellamaki/.kolibri/process_cache', 'TIMEOUT': 300, 'SHARDS': 8, 'OPTIONS': {'MAX_ENTRIES': 1000, 'disk_pickle_protocol': 2}}} \nCACHE_MIDDLEWARE_ALIAS = 'default'\nCACHE_MIDDLEWARE_KEY_PREFIX = '********************'\nCACHE_MIDDLEWARE_SECONDS = 0\nCSRF_COOKIE_AGE = 31449600\nCSRF_COOKIE_DOMAIN = None\nCSRF_COOKIE_HTTPONLY = False\nCSRF_COOKIE_NAME = 'kolibri_csrftoken'\nCSRF_COOKIE_PATH = '/'\nCSRF_COOKIE_SECURE = False\nCSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'\nCSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'\nCSRF_TRUSTED_ORIGINS = []\nCSRF_USE_SESSIONS = False\nDATABASES = {'default': {'ENGINE': 'django.db.backends. sqlite3', 'NAME': '/Users/marcellamaki/.kolibri/db.sqlite3', 'OPTIONS': {'timeout': 100}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'USER': '', 'PASSWORD': '********************', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}, 'syncqueue': {'ENGINE': 'django.db.backends. sqlite3', 'NAME': '/Users/marcellamaki/.kolibri/syncqueue.sqlite3', 'OPTIONS': {'timeout': 100}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'USER': '', 'PASSWORD': '********************', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}, 'networklocation': {'ENGINE': 'django. db.backends.sqlite3', 'NAME': '/Users/marcellamaki/.kolibri/networklocation.sqlite3', 'OPTIONS': {'timeout': 100}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'USER': '', 'PASSWORD': '********************', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}, 'notifications': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/Users/marcellamaki/.kolibri/notifications. sqlite3', 'OPTIONS': {'timeout': 100}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'USER': '', 'PASSWORD': '********************', 'HOST': '', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}}} \nDATABASE_ROUTERS = \"('kolibri.core.notifications.models.NotificationsRouter', 'kolibri.core. device.models.SyncQueueRouter', 'kolibri.core.discovery.models.NetworkLocationRouter') \"\nDATA_UPLOAD_MAX_MEMORY_SIZE = 2621440\nDATA_UPLOAD_MAX_NUMBER_FIELDS = 1000\nDATETIME_FORMAT = 'N j, Y, P'\nDATETIME_INPUT_FORMATS = ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/ %d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/ %d/%y']\nDATE_FORMAT = 'N j, Y'\nDATE_INPUT_FORMATS = ['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y'] \nDEBUG = True\nDEBUG_PROPAGATE_EXCEPTIONS = False\nDECIMAL_SEPARATOR = '.'\nDEFAULT_CHARSET = 'utf-8'\nDEFAULT_CONTENT_TYPE = 'text/html'\nDEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views. debug.SafeExceptionReporterFilter'\nDEFAULT_FILE_STORAGE = 'django.core.files.storage. FileSystemStorage'\nDEFAULT_FROM_EMAIL = 'webmaster@localhost'\nDEFAULT_INDEX_TABLESPACE = ''\nDEFAULT_TABLESPACE = ''\nDEVELOPER_MODE = True\nDISALLOWED_USER_AGENTS = []\nEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'\nEMAIL_HOST = 'localhost'\nEMAIL_HOST_PASSWORD = '********************'\nEMAIL_HOST_USER = ''\nEMAIL_PORT = 25\nEMAIL_SSL_CERTFILE = None\nEMAIL_SSL_KEYFILE = '********************'\nEMAIL_SUBJECT_PREFIX = '[Django] '\nEMAIL_TIMEOUT = None\nEMAIL_USE_LOCALTIME = False\nEMAIL_USE_SSL = False\nEMAIL_USE_TLS = False\nENABLE_DATA_BOOTSTRAPPING = True\nEXTRA_LANG_INFO = {'ff-cm': {'bidi': False, 'code': 'ff-cm', 'name': 'Fulfulde (Cameroon)', 'name_local': 'Fulfulde Mbororoore', 'name_translated': 'Fulfulde (Cameroon)'}, 'el': {'bidi': False, 'code': 'el', 'name': 'Greek', 'name_local': 'Ελληνικά', 'name_translated': 'Greek'}, 'es-419': {'bidi': False, 'code': 'es-419', 'name': 'Spanish (Latin America)', 'name_local': 'Español', 'name_translated': 'Spanish (Latin America)'}, 'es-es': {'bidi': False, 'code': 'es-es', 'name': 'Spanish (Spain)', 'name_local': 'Español (España)', 'name_translated': 'Spanish (Spain)'}, 'fr-ht': {'bidi': False, 'code': 'fr-ht', 'name': 'Haitian Creole', 'name_local': 'Kreyòl ayisyen'}, 'gu-in': {'bidi': False, 'code': 'gu-in', 'name': 'Gujarati', 'name_local': 'ગુજરાતી', 'name_translated': 'Gujarati'}, 'ha': {'bidi': False, 'code': 'ha', 'name': 'Hausa', 'name_local': 'Hausa', 'name_translated': 'Hausa'}, 'ht': {'bidi': False, 'code': 'ht', 'name': 'Haitian Creole', 'name_local': 'Kreyòl Ayisyen', 'name_translated': 'Haitian Creole'}, 'id': {'bidi': False, 'code': 'id', 'name': 'Indonesian', 'name_local': 'Bahasa Indonesia', 'name_translated': 'Indonesian'}, 'ka': {'bidi': False, 'code': 'ka', 'name': 'Georgian', 'name_local': 'ქართული', 'name_translated': 'Georgian'}, 'km': {'bidi': False, 'code': 'km', 'name': 'Khmer', 'name_local': 'ភាសាខ្មែរ', 'name_translated': 'Khmer'}, 'nyn': {'bidi': False, 'code': 'nyn', 'name': 'Chichewa, Chewa, Nyanja', 'name_local': 'Chinyanja', 'name_translated': 'Chichewa, Chewa, Nyanja'}, 'pt-mz': {'bidi': False, 'code': 'pt-mz', 'name': 'Portuguese (Mozambique)', 'name_local': 'Português (Moçambique)', 'name_translated': 'Portuguese (Mozambique)'}, 'uk': {'bidi': False, 'code': 'uk', 'name': 'Ukrainian', 'name_local': 'Украї́нська мо́ва', 'name_translated': 'Ukrainian'}, 'zh': {'bidi': False, 'code': 'zh-hans', 'name': 'Simplified Chinese', 'name_local': '简体中文'}, 'yo': {'bidi': False, 'code': 'yo', 'name': 'Yoruba', 'name_local': 'Yorùbá', 'name_translated': 'Yoruba'}, 'zu': {'bidi': False, 'code': 'zu', 'name': 'Zulu', 'name_local': 'isiZulu'}}\nFILE_CHARSET = 'utf-8'\nFILE_UPLOAD_DIRECTORY_PERMISSIONS = None\nFILE_UPLOAD_HANDLERS = ['django.core.files. uploadhandler.TemporaryFileUploadHandler']\nFILE_UPLOAD_MAX_MEMORY_SIZE = 2621440\nFILE_UPLOAD_PERMISSIONS = None\nFILE_UPLOAD_TEMP_DIR = None\nFIRST_DAY_OF_WEEK = 0\nFIXTURE_DIRS = []\nFORCE_SCRIPT_NAME = None\nFORMAT_MODULE_PATH = None\nFORM_RENDERER = 'django.forms.renderers.DjangoTemplates'\nIGNORABLE_404_URLS = []\nINSTALLED_APPS = ['kolibri. core', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django. contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_filters', 'kolibri.core.auth.apps.KolibriAuthConfig', 'kolibri.core.bookmarks', 'kolibri.core.content', 'kolibri.core.logger', 'kolibri.core.notifications.apps.KolibriNotificationsConfig', 'kolibri. core.tasks.apps.KolibriTasksConfig', 'kolibri.core.deviceadmin', 'kolibri.core.webpack', 'kolibri.core.exams', 'kolibri.core.device', 'kolibri.core.discovery', 'kolibri.core.lessons', 'kolibri.core.analytics', 'rest_framework', 'django_js_reverse', 'jsonfield', 'morango', , , , , , , , , , , , , , , 'drf_yasg']\nINTERNAL_IPS = ['127.0.0.1'] \nJS_REVERSE_EXCLUDE_NAMESPACES = ['admin']\nKOLIBRI_MODULE_PATH = '/Users/marcellamaki/Documents/learning-equality/kolibri/kolibri'\nLANGUAGES = [('ar', 'العَرَبِيَّة\\u200e\\u200e'), ('bg-bg', 'Български'), ('bn-bd', 'বাংলা'), ('de', 'Deutsch'), ('el', 'Ελληνικά'), ('en', 'English'), ('es-419', 'Español'), ('es-es', 'Español (España)'), ('fa', 'فارسی'), ('ff-cm', 'Fulfulde Mbororoore'), ('fr-fr', 'Français'), ('gu-in', 'ગુજરાતી'), ('ha', 'Hausa'), ('hi-in', 'हिंदी (भारत)'), ('ht', 'Kreyòl Ayisyen'), ('id', 'Bahasa Indonesia'), ('it', 'Italiano'), ('ka', 'ქართული'), ('km', 'ភាសាខ្មែរ'), ('ko', '한국어'), ('mr', 'मराठी'), ('my', 'ဗမာစာ'), ('nyn', 'Chinyanja'), ('pt-br', 'Português (Brazil)'), ('pt-mz', 'Português (Moçambique)'), ('sw-tz', 'Kiswahili'), ('te', 'తెలుగు'), ('uk', 'Украї́нська мо́ва'), ('ur-pk', 'اُردو (پاکستان)\\u200f'), ('vi', 'Tiếng Việt'), ('yo', 'Yorùbá'), ('zh-hans', '简体中文')]\nLANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']\nLANGUAGE_CODE = 'en'\nLANGUAGE_COOKIE_AGE = None\nLANGUAGE_COOKIE_DOMAIN = None\nLANGUAGE_COOKIE_NAME = 'django_language'\nLANGUAGE_COOKIE_PATH = '/'\nLOCALE_PATHS = ['/Users/marcellamaki/Documents/ learning-equality/kolibri/kolibri/locale']\nLOGGING = {'version': 1, 'disable_existing_loggers': False, 'filters': {'require_debug_true': {'()': .RequireDebugTrue'>}, 'no_exceptions': {'()': }, 'require_debug_false': {'()': 'django. utils.log.RequireDebugFalse'}}, 'formatters': {'verbose': {'format': '%(levelname)s %(asctime) s %(name)s %(process)d %(thread)d %(message)s'}, 'simple_date': {'format': '%(levelname)s % (asctime)s %(name)s %(message)s'}, 'color': {'()': 'colorlog.TTYColoredFormatter', 'format': '% (log_color)s%(levelname)-8s %(asctime)s %(message)s', 'log_colors': {'DEBUG': 'blue', 'INFO': 'white', 'WARNING': 'yellow', 'ERROR': 'red', 'CRITICAL': 'bold_red'}}}, 'handlers': {'console-error': {'level': 'ERROR', 'class': 'kolibri.utils.logger.EncodingStreamHandler', 'formatter': 'color', 'stream': 'ext://sys.stderr'}, 'console': {'level': 'DEBUG', 'filters': ['no_exceptions'], 'class': 'kolibri.utils.logger.EncodingStreamHandler', 'formatter': 'color', 'stream': 'ext://sys.stdout'}, 'file': {'level': 'INFO', 'filters': [], 'class': 'kolibri.utils.logger.KolibriTimedRotatingFileHandler', 'filename': '/Users/marcellamaki/. kolibri/logs/kolibri.txt', 'formatter': 'simple_date', 'when': 'midnight', 'backupCount': 30, 'encoding': 'utf-8'}, 'file_debug': {'level': 'DEBUG', 'filters': ['require_debug_true'], 'class': 'logging.FileHandler', 'filename': '/Users/marcellamaki/.kolibri/logs/debug.txt', 'formatter': 'simple_date', 'encoding': 'utf-8'}, 'mail_admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false']}}, 'loggers': {'': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG'}, 'kolibri': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG', 'propagate': False}, 'cherrypy.access': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG', 'propagate': False}, 'kolibri.core.tasks.worker': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'INFO', 'propagate': False}, 'morango': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG', 'propagate': False}, 'django': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG', 'propagate': False}, 'django.db.backends': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'INFO', 'propagate': False}, 'django.request': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'DEBUG', 'propagate': False}, 'django.template': {'handlers': ['file', 'console', 'console-error', 'file_debug', 'mail_admins', 'mail_admins', 'mail_admins'], 'level': 'INFO', 'propagate': False}}}\nLOGGING_CONFIG = 'logging.config.dictConfig'\nLOGIN_REDIRECT_URL = '/ accounts/profile/'\nLOGIN_URL = '/accounts/login/'\nLOGOUT_REDIRECT_URL = None\nMANAGERS = []\nMEDIA_ROOT = '/Users/marcellamaki/.kolibri/media'\nMEDIA_URL = '/media/'\nMESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'\nMIDDLEWARE = ['kolibri.core. analytics.middleware.cherrypy_access_log_middleware', 'kolibri.core.device.middleware. ProvisioningErrorHandler', 'kolibri.core.device.middleware.DatabaseBusyErrorHandler', 'django.middleware.cache.UpdateCacheMiddleware', 'kolibri.core.analytics.middleware. MetricsMiddleware', 'kolibri.core.auth.middleware.KolibriSessionMiddleware', 'kolibri.core. device.middleware.KolibriLocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'kolibri.core.auth.middleware. CustomAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'kolibri.core.webpack. middleware.WebpackErrorHandler', 'kolibri.core.auth.middleware. XhrPreventLoginPromptMiddleware']\nMIDDLEWARE_CLASSES = ['django.middleware.common. CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware']\nMIGRATION_MODULES = {} \nMONTH_DAY_FORMAT = 'F j'\nMORANGO_CLEANUP_OPERATIONS = \"('kolibri.core.auth. sync_operations:KolibriSyncOperations', 'morango.sync.operations:CleanupOperation', 'morango. sync.operations:NetworkCleanupOperation')\"\nMORANGO_DEQUEUE_OPERATIONS = \"('kolibri.core. auth.sync_operations:KolibriSyncOperations', 'morango.sync. operations:ProducerDequeueOperation', 'morango.sync.operations:ReceiverDequeueOperation', 'morango.sync.operations:LegacyNetworkDequeueOperation', 'morango.sync. operations:NetworkDequeueOperation')\"\nMORANGO_DESERIALIZE_OPERATIONS = \"('kolibri.core.auth. sync_operations:KolibriSyncOperations', 'morango.sync. operations:ProducerDeserializeOperation', 'morango.sync.operations:ReceiverDeserializeOperation', 'morango.sync. operations:LegacyNetworkDeserializeOperation', 'morango.sync. operations:NetworkDeserializeOperation')\"\nMORANGO_INITIALIZE_OPERATIONS = \"('kolibri.core.auth.sync_operations:KolibriSyncOperations', 'morango.sync.operations:InitializeOperation', 'morango.sync.operations:LegacyNetworkInitializeOperation', 'morango.sync. operations:NetworkInitializeOperation')\"\nMORANGO_INSTANCE_INFO = 'kolibri.core.auth. constants.morango_sync:CUSTOM_INSTANCE_INFO'\nMORANGO_QUEUE_OPERATIONS = \"('kolibri.core.auth. sync_operations:KolibriSyncOperations', 'morango.sync.operations:ProducerQueueOperation', 'morango.sync.operations:ReceiverQueueOperation', 'morango.sync. operations:LegacyNetworkQueueOperation', 'morango.sync.operations:NetworkQueueOperation') \"\nMORANGO_SERIALIZE_OPERATIONS = \"('kolibri.core.auth. sync_operations:KolibriSyncOperations', 'morango.sync.operations:SerializeOperation', 'morango. sync.operations:LegacyNetworkSerializeOperation', 'morango.sync. operations:NetworkSerializeOperation')\"\nMORANGO_TRANSFERRING_OPERATIONS = \"('kolibri.core. auth.sync_operations:KolibriSyncOperations', 'morango.sync.operations:PullProducerOperation', 'morango.sync.operations:PushProducerOperation', 'morango.sync. operations:PushReceiverOperation', 'morango.sync.operations:PullReceiverOperation', 'morango. sync.operations:NetworkPushTransferOperation', 'morango.sync. operations:NetworkPullTransferOperation')\"\nNUMBER_GROUPING = 0\nPASSWORD_HASHERS = '********************'\nPASSWORD_RESET_TIMEOUT_DAYS = '********************'\nPREPEND_WWW = False\nREST_FRAMEWORK = {'UNAUTHENTICATED_USER': 'kolibri.core.auth.models. KolibriAnonymousUser', 'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication. BasicAuthentication', 'rest_framework.authentication.SessionAuthentication'], 'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer', 'rest_framework. renderers.BrowsableAPIRenderer'), 'EXCEPTION_HANDLER': 'kolibri.core.utils.exception_handler. custom_exception_handler'}\nROOT_URLCONF = 'kolibri.deployment.default.dev_urls'\nSECRET_KEY = '********************'\nSECURE_BROWSER_XSS_FILTER = False\nSECURE_CONTENT_TYPE_NOSNIFF = True\nSECURE_HSTS_INCLUDE_SUBDOMAINS = False\nSECURE_HSTS_PRELOAD = False\nSECURE_HSTS_SECONDS = 0\nSECURE_PROXY_SSL_HEADER = None\nSECURE_REDIRECT_EXEMPT = []\nSECURE_SSL_HOST = None\nSECURE_SSL_REDIRECT = False\nSERVER_EMAIL = 'root@localhost'\nSESSION_CACHE_ALIAS = 'default'\nSESSION_COOKIE_AGE = 1200\nSESSION_COOKIE_DOMAIN = None\nSESSION_COOKIE_HTTPONLY = True\nSESSION_COOKIE_NAME = 'kolibri'\nSESSION_COOKIE_PATH = '/'\nSESSION_COOKIE_SECURE = False\nSESSION_ENGINE = 'django.contrib.sessions.backends. file'\nSESSION_EXPIRE_AT_BROWSER_CLOSE = True\nSESSION_FILE_PATH = '/Users/marcellamaki/. kolibri/sessions'\nSESSION_SAVE_EVERY_REQUEST = False\nSESSION_SERIALIZER = 'django.contrib. sessions.serializers.JSONSerializer'\nSETTINGS_MODULE = 'kolibri.deployment.default.settings. dev'\nSHORT_DATETIME_FORMAT = 'm/d/Y P'\nSHORT_DATE_FORMAT = 'm/d/Y'\nSIGNING_BACKEND = 'django.core.signing.TimestampSigner'\nSILENCED_SYSTEM_CHECKS = ['auth.W004'] \nSTATICFILES_DIRS = []\nSTATICFILES_FINDERS = ['django.contrib.staticfiles.finders. FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] \nSTATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'\nSTATIC_ROOT = '/Users/marcellamaki/.kolibri/static'\nSTATIC_URL = '/static/'\nSWAGGER_SETTINGS = {'DEFAULT_INFO': 'kolibri.deployment.default.dev_urls.api_info'}\nSYNC_OPERATIONS = \" ('kolibri.core.auth.sync_operations:KolibriSyncOperations',)\"\nTEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template. context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib. messages.context_processors.messages', 'kolibri.core.context_processors. custom_context_processor.developer_mode']}}]\nTEST_NON_SERIALIZED_APPS = []\nTEST_RUNNER = 'django.test.runner.DiscoverRunner'\nTHOUSAND_SEPARATOR = ','\nTIME_FORMAT = 'P'\nTIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']\nTIME_ZONE = 'America/ New_York'\nUSE_ETAGS = False\nUSE_I18N = True\nUSE_L10N = True\nUSE_THOUSAND_SEPARATOR = False\nUSE_TZ = True\nUSE_X_FORWARDED_HOST = False\nUSE_X_FORWARDED_PORT = False\nWSGI_APPLICATION = 'kolibri.deployment.default.wsgi.application'\nX_FRAME_OPTIONS = 'SAMEORIGIN'\nYEAR_MONTH_FORMAT = 'F Y'\n\n\nYou're seeing this error because you have DEBUG = True in your\nDjango settings file. Change that to False, and Django will\ndisplay a standard page generated by the handler for this status code.\n\n ```

Expected behavior

User-facing consequences

Users having to create multiple accounts/confusion between accounts

Steps to reproduce

I am not sure why this happened, so at this stage, I am not sure how to reliably reproduce. I will add more detail as I am able to.

Context

Latest develop

rtibbles commented 1 year ago

I think this may be another instance of the issue with the PIN set to None looking at the logs:

WARNING 2023-04-12 09:41:01,967 morango.models.core Error deserializing instance of FacilityDataset with id 7e5258574c0fad31877c19af6c3d2772: {'extra_fields': ["None does not match type 'string'"]}
WARNING 2023-04-12 09:41:01,974 morango.models.core Error deserializing instance of Facility with id 88c74c2dffda743f3d7b9185520f4928: {'dataset': ["facility dataset instance with id '7e5258574c0fad31877c19af6c3d2772' does not exist."]}
WARNING 2023-04-12 09:41:01,986 morango.models.core Error deserializing instance of Facility with id 88c74c2dffda743f3d7b9185520f4928: {'dataset': ["facility dataset instance with id '7e5258574c0fad31877c19af6c3d2772' does not exist."]}

The deserialization of the sync failed because of that issue.

radinamatic commented 1 year ago

Running into similar issue trying to create or import LoD user from Kolibri running in production on my dev VM (latest develop). I was trying to set up a new Kolibri LoD device in Ubuntu 20.04 VM where the asset from https://github.com/learningequality/kolibri/pull/10471 was installed for testing. Getting the 500 error apparently at the same point as @marcellamaki on both trying to create a new user for, or import one from my dev VM server.

https://user-images.githubusercontent.com/1457929/232096687-f58ca49d-1667-47a2-a8a5-17107ab3a2ec.mp4


One notable thing that can be noticed in the recording, is that since I have 2 facilities in my dev VM, setup wizard kind of latches on the first one, even though I selected the second one. This may be a separate issue, that I'll report if I manage to replicate consistently.