Closed alejandropan closed 5 years ago
Hi Alejandro,
So this bug happens because the previous session starts close to midnight on the 7th and ends on the 8th early morning. This is an Alyx bug, I've just fixed it, you don't need to pull a new version of ibllib and you should be able to register fine now.
Make sure you rename
C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_03\2019-01-08\001\register_me.error
in
C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_03\2019-01-08\001\register_me.flag
before doing so.
2019-01-10T15:08:40,751 INFO [extract_session.py:73] Extracting C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_01\2019-01-08\001 2019-01-10T15:08:43,390 WARNING [raw_data_loaders.py:175] _iblrig_encoderPositions.raw.ssv has missing/incomplete records C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_01\2019-01-08\001\raw_behavior_data_iblrig_encoderPositions.raw.ssv 2019-01-10T15:08:44,861 INFO [extract_session.py:73] Extracting C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_02\2019-01-08\001 2019-01-10T15:08:49,322 INFO [extract_session.py:73] Extracting C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_03\2019-01-08\001 2019-01-10T15:08:50,779 WARNING [training_wheel.py:102] Time-stamp arrays have inconsistent size. Trimming to the smallest size 2019-01-10T15:08:50,854 INFO [extract_session.py:73] Extracting C:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_03\2019-01-08\002 Connected to https://alyx.internationalbrainlab.org as alejandro 2019-01-10T15:08:59,121 INFO [registration.py:39] registeringC:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_01\2019-01-08\001 2019-01-10T15:09:01,926 INFO [registration.py:100] creating sessionibl_witten_01\2019-01-08\001 2019-01-10T15:09:04,499 INFO [registration.py:39] registeringC:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_02\2019-01-08\001 2019-01-10T15:09:09,298 INFO [registration.py:39] registeringC:\Users\apv2\Documents\IBL\Data\Subjects\ibl_witten_03\2019-01-08\001 https://alyx.internationalbrainlab.org/register-file ValueError at /register-file A base session for ibl_witten_03 on 2019-01-08 does not exist
Request Method: POST Request URL: https://alyx.internationalbrainlab.org/register-file Django Version: 2.1.1 Python Executable: /usr/bin/python3 Python Version: 3.5.2 Python Path: ['/var/www/alyx-main/alyx', '/var/www/alyx-main/venv/lib/python35.zip', '/var/www/alyx-main/venv/lib/python3.5', '/var/www/alyx-main/venv/lib/python3.5/plat-x86_64-linux-gnu', '/var/www/alyx-main/venv/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/var/www/alyx-main/venv/lib/python3.5/site-packages'] Server time: Thu, 10 Jan 2019 20:09:11 +0000 Installed Applications: ('test_without_migrations', 'dal', 'dal_select2', 'reversion', 'django_admin_listfilter_dropdown', 'rangefilter', 'subjects', 'django_filters', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polymorphic', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_docs', 'actions', 'data', 'misc') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'alyx.base.QueryPrintingMiddleware')
Traceback:
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/django/views/decorators/csrf.py" in wrapped_view
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/rest_framework/viewsets.py" in view
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/rest_framework/views.py" in dispatch
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/rest_framework/views.py" in handle_exception
File "/var/www/alyx-main/venv/lib/python3.5/site-packages/rest_framework/views.py" in dispatch
File "/var/www/alyx-main/alyx/data/views.py" in create
File "/var/www/alyx-main/alyx/data/models.py" in _get_session
Exception Type: ValueError at /register-file Exception Value: A base session for ibl_witten_03 on 2019-01-08 does not exist Request information: USER: alejandro
GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES: No cookie data
META: CONTENT_LENGTH = '538' CONTENT_TYPE = 'application/json' CONTEXT_DOCUMENT_ROOT = '/var/www/html' CONTEXT_PREFIX = '' DOCUMENT_ROOT = '/var/www/html' GATEWAY_INTERFACE = 'CGI/1.1' HTTP_ACCEPT = 'application/json' HTTP_ACCEPT_ENCODING = 'gzip, deflate' HTTP_AUTHORIZATION = 'Token bd495b7e06cb1dde48ae754dea75c53a75c6d267' HTTP_CONNECTION = 'keep-alive' HTTP_HOST = 'alyx.internationalbrainlab.org' HTTP_USER_AGENT = 'python-requests/2.19.1' PATH_INFO = '/register-file' PATH_TRANSLATED = '/var/www/alyx-main/alyx/alyx/wsgi.py/register-file' QUERY_STRING = '' REMOTE_ADDR = '128.112.216.239' REMOTE_PORT = '53196' REQUEST_METHOD = 'POST' REQUEST_SCHEME = 'https' REQUEST_URI = '/register-file' SCRIPT_FILENAME = '/var/www/alyx-main/alyx/alyx/wsgi.py' SCRIPT_NAME = '' SERVER_ADDR = '172.31.1.209' SERVER_ADMIN = 'webmaster@internationalbrainlab.org' SERVER_NAME = 'alyx.internationalbrainlab.org' SERVER_PORT = '443' SERVER_PROTOCOL = 'HTTP/1.1' SERVER_SIGNATURE = '
Apache/2.4.18 (Ubuntu) Server at alyx.internationalbrainlab.org Port 443\n' SERVER_SOFTWARE = 'Apache/2.4.18 (Ubuntu)' SSL_TLS_SNI = 'alyx.internationalbrainlab.org' apache.version = '(2, 4, 18)' mod_wsgi.application_group = 'alyx.internationalbrainlab.org|' mod_wsgi.callable_object = 'application' mod_wsgi.connection_id = 'bc7kJoDKmTk' mod_wsgi.daemon_connects = '1' mod_wsgi.daemon_restarts = '0' mod_wsgi.daemon_start = '1547150951911285' mod_wsgi.enable_sendfile = '0' mod_wsgi.handler_script = '' mod_wsgi.ignore_activity = '0' mod_wsgi.listener_host = '' mod_wsgi.listener_port = '443' mod_wsgi.path_info = '/register-file' mod_wsgi.process_group = 'alyxmain' mod_wsgi.queue_start = '1547150951911118' mod_wsgi.request_handler = 'wsgi-script' mod_wsgi.request_id = 'HQ7nJoDKmTk' mod_wsgi.request_start = '1547150951910941' mod_wsgi.script_name = '' mod_wsgi.script_reloading = '1' mod_wsgi.script_start = '1547150951911411' mod_wsgi.thread_id = 7 mod_wsgi.thread_requests = 281 mod_wsgi.total_requests = 13574 mod_wsgi.version = '(4, 6, 4)' wsgi.errors = <_io.TextIOWrapper name='Settings: Using settings module alyx.settings ABSOLUTE_URL_OVERRIDES = {} ADMINS = [] ALLOWED_HOSTS = ['localhost', 'alyx.internationalbrainlab.org'] APPEND_SLASH = True AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend'] AUTH_PASSWORD_VALIDATORS = '****' AUTH_USER_MODEL = 'misc.LabMember' BASE_DIR = '/var/www/alyx-main/alyx' CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} CACHE_MIDDLEWARE_ALIAS = 'default' CACHE_MIDDLEWARE_KEY_PREFIX = '****' CACHE_MIDDLEWARE_SECONDS = 600 CSRF_COOKIE_AGE = 31449600 CSRF_COOKIE_DOMAIN = None CSRF_COOKIE_HTTPONLY = False CSRF_COOKIE_NAME = 'csrftoken' CSRF_COOKIE_PATH = '/' CSRF_COOKIE_SAMESITE = 'Lax' CSRF_COOKIE_SECURE = False CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure' CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN' CSRF_TRUSTED_ORIGINS = [] CSRF_USE_SESSIONS = False DATABASES = {'default': {'HOST': '127.0.0.1', 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'PASSWORD': '****', 'TIME_ZONE': None, 'NAME': 'ibl', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}, 'ATOMIC_REQUESTS': False, 'OPTIONS': {}, 'CONN_MAX_AGE': 0, 'AUTOCOMMIT': True, 'PORT': '5432', 'USER': 'ibl_dev'}, 'cortexlab': {'HOST': '127.0.0.1', 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'PASSWORD': '****', 'TIME_ZONE': None, 'NAME': 'cortexlab', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}, 'ATOMIC_REQUESTS': False, 'OPTIONS': {}, 'CONN_MAX_AGE': 0, 'AUTOCOMMIT': True, 'PORT': '5432', 'USER': 'ibl_dev'}} DATABASE_ROUTERS = [] DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440 DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000 DATETIME_FORMAT = 'N j, Y, P' DATETIME_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'] DATE_FORMAT = 'N j, Y' DATE_INPUT_FORMATS = "('%d/%m/%Y',)" DEBUG = True DEBUG_PROPAGATE_EXCEPTIONS = False DECIMAL_SEPARATOR = '.' DEFAULT_CHARSET = 'utf-8' DEFAULT_CONTENT_TYPE = 'text/html' DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter' DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL = 'webmaster@localhost' DEFAULT_INDEX_TABLESPACE = '' DEFAULT_PROTOCOL = '1' DEFAULT_SOURCE = 'IBL' DEFAULT_TABLESPACE = '' DISALLOWED_USER_AGENTS = [] EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'mail.gandi.net' EMAIL_HOST_PASSWORD = '****' EMAIL_HOST_USER = 'alyx@internationalbrainlab.org' EMAIL_PORT = 587 EMAIL_SSL_CERTFILE = None EMAIL_SSL_KEYFILE = '****' EMAIL_SUBJECT_PREFIX = '[Django] ' EMAIL_TIMEOUT = None EMAIL_USE_LOCALTIME = False EMAIL_USE_SSL = False EMAIL_USE_TLS = True FILE_CHARSET = 'utf-8' FILE_UPLOAD_DIRECTORY_PERMISSIONS = None FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 FILE_UPLOAD_PERMISSIONS = None FILE_UPLOAD_TEMP_DIR = None FIRST_DAY_OF_WEEK = 0 FIXTURE_DIRS = [] FORCE_SCRIPT_NAME = None FORMAT_MODULE_PATH = None FORM_RENDERER = 'django.forms.renderers.DjangoTemplates' GLOBUS_CLIENT_ID = '525cc517-8ccb-4d11-8036-af332da5eafd' IGNORABLE_404_URLS = [] INSTALLED_APPS = "('test_without_migrations', 'dal', 'dal_select2', 'reversion', 'django_admin_listfilter_dropdown', 'rangefilter', 'subjects', 'django_filters', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polymorphic', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_docs', 'actions', 'data', 'misc')" INTERNAL_IPS = [] LANGUAGES = [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')] LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur'] LANGUAGE_CODE = 'en-us' LANGUAGE_COOKIE_AGE = None LANGUAGE_COOKIE_DOMAIN = None LANGUAGE_COOKIE_NAME = 'django_language' LANGUAGE_COOKIE_PATH = '/' LOCALE_PATHS = [] LOGGING = {'handlers': {'console': {'level': 'DEBUG', 'formatter': 'simple', 'class': 'logging.StreamHandler'}, 'file': {'level': 'DEBUG', 'formatter': 'simple', 'class': 'logging.handlers.RotatingFileHandler', 'filename': '/var/log/alyx.log', 'maxBytes': 16777216}}, 'version': 1, 'loggers': {'django': {'level': 'INFO', 'handlers': ['file'], 'propagate': True}}, 'formatters': {'simple': {'()': 'colorlog.ColoredFormatter', 'format': '%(log_color)s%(asctime)s [%(levelname)s] %(message)s', 'log_colors': {'INFO': 'white', 'ERROR': 'red', 'WARNING': 'yellow', 'DEBUG': 'cyan', 'CRITICAL': 'bold_red'}, 'datefmt': '%d/%m %H:%M:%S'}}, 'root': {'level': 'INFO', 'handlers': ['file', 'console'], 'propagate': True}, 'disable_existing_loggers': False} LOGGING_CONFIG = 'logging.config.dictConfig' LOGIN_REDIRECT_URL = '/accounts/profile/' LOGIN_URL = '/accounts/login/' LOGOUT_REDIRECT_URL = None MANAGERS = [] MEDIA_ROOT = '/var/www/alyx-main/uploaded' MEDIA_URL = '/uploaded/' MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage' MIDDLEWARE = "('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'alyx.base.QueryPrintingMiddleware')" MIGRATION_MODULES = {} MONTH_DAY_FORMAT = 'F j' NUMBER_GROUPING = 0 PASSWORD_HASHERS = '****' PASSWORD_RESET_TIMEOUT_DAYS = '****' PREPEND_WWW = False REST_FRAMEWORK = {'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',), 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication'), 'STRICT_JSON': False} ROOT_URLCONF = 'alyx.urls' SECRET_KEY = '****' SECURE_BROWSER_XSS_FILTER = False SECURE_CONTENT_TYPE_NOSNIFF = False SECURE_HSTS_INCLUDE_SUBDOMAINS = False SECURE_HSTS_PRELOAD = False SECURE_HSTS_SECONDS = 0 SECURE_PROXY_SSL_HEADER = None SECURE_REDIRECT_EXEMPT = [] SECURE_SSL_HOST = None SECURE_SSL_REDIRECT = False SERVER_EMAIL = 'root@localhost' SESSION_CACHE_ALIAS = 'default' SESSION_COOKIE_AGE = 1209600 SESSION_COOKIE_DOMAIN = None SESSION_COOKIE_HTTPONLY = True SESSION_COOKIE_NAME = 'sessionid' SESSION_COOKIE_PATH = '/' SESSION_COOKIE_SAMESITE = 'Lax' SESSION_COOKIE_SECURE = False SESSION_ENGINE = 'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE = False SESSION_FILE_PATH = None SESSION_SAVE_EVERY_REQUEST = False SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' SETTINGS_MODULE = 'alyx.settings' SHORT_DATETIME_FORMAT = 'm/d/Y P' SHORT_DATE_FORMAT = 'm/d/Y' SIGNING_BACKEND = 'django.core.signing.TimestampSigner' SILENCED_SYSTEM_CHECKS = [] STATICFILES_DIRS = [] STATICFILES_FINDERS = ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_ROOT = '/var/www/alyx-main/alyx/static/' STATIC_URL = '/static/' STOCK_MANAGERS = "('olivier',)" SUBJECT_REQUEST_EMAIL_FROM = 'alyx@internationalbrainlab.org' SUPERUSERS = 'root' TEMPLATES = [{'APP_DIRS': True, 'DIRS': ['/var/www/alyx-main/alyx/templates'], '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']}, 'BACKEND': 'django.template.backends.django.DjangoTemplates'}] TEST_NON_SERIALIZED_APPS = [] TEST_RUNNER = 'django.test.runner.DiscoverRunner' THOUSAND_SEPARATOR = ',' TIME_FORMAT = 'P' TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] TIME_ZONE = 'GB' UPLOADED_IMAGE_WIDTH = 800 USE_I18N = False USE_L10N = False USE_THOUSAND_SEPARATOR = False USE_TZ = False USE_X_FORWARDED_HOST = False USE_X_FORWARDED_PORT = False WEIGHT_THRESHOLD = 0.75 WSGI_APPLICATION = 'alyx.wsgi.application' X_FRAME_OPTIONS = 'SAMEORIGIN' YEAR_MONTH_FORMAT = 'F Y'
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.
Traceback (most recent call last):
File "", line 11, in
rc.register_sync(ROOT_DATA_FOLDER)
File "c:\users\apv2\ibllib\python\oneibl\registration.py", line 40, in register_sync status_str = self.register_session(flag_file.parent)
File "c:\users\apv2\ibllib\python\oneibl\registration.py", line 21, in func_wrapper f = func(self, sessionpath, *args, **kwargs)
File "c:\users\apv2\ibllib\python\oneibl\registration.py", line 164, in registersession self.one.alyx.post('/register-file', data=r)
File "c:\users\apv2\ibllib\python\oneibl\webclient.py", line 260, in post return self._generic_request(requests.post, rest_query, data=data)
File "c:\users\apv2\ibllib\python\oneibl\webclient.py", line 176, in _generic_request raise Exception(r)
Exception: <Response [500]>