NAVADMC / ADSM

A simulation of disease spread in livestock populations. Includes detection and containment simulation.
Other
10 stars 5 forks source link

Import of legacy scenario failure #484

Closed casesp closed 9 years ago

casesp commented 9 years ago

This issue is for: ADSM_3.2.22-RC5.2 build 7e47384

I tried to import a legacy scenario from NAADSM 3.2.19 (exported to XML) and recieved the following error messages: (It says something about special characters in the filename, I think. The filenames are: "Turkey 3.2.19 partial units scenario file.xml" and "Turkey 3.2.19 partial units unit file.xml" No special characters here.)

The data from these files (different filenames previously) did import into previous builds of ADSM.

import of legacy scenario failure

Capture of debug messages follows:

ValueError at /app/ImportScenario/ Special characters are not allowed: Turkey 3.2.19 partial units scenario file with Turkey 3.2.19 partial units unit file Request Method: POST Request URL: http://127.0.0.1:8000/app/ImportScenario/ Django Version: 1.7.1 Exception Type: ValueError Exception Value:
Special characters are not allowed: Turkey 3.2.19 partial units scenario file with Turkey 3.2.19 partial units unit file Exception Location: C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSMSettings\models.py in scenario_filename, line 77 Python Executable: C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\adsm.exe Python Version: 3.4.2 Python Path:
['C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\adsm.exe', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\adsm.zip', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\library.zip', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\DLLs', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\plat-win', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\lib-tk', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\bin', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Scripts', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages\cx_Freeze-4.3.4-py3.4-win-amd64.egg', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages\numpy-1.9.1-py3.4-win-amd64.egg', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages\pip-1.5.6-py3.4.egg', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages\pywin32-219-py3.4-win-amd64.egg', 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src'] Server time: Wed, 8 Apr 2015 14:20:40 +0000 Traceback Switch to copy-and-paste view

C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\Lib\site-packages\django\core\handlers\base.py in get_response response = wrapped_callback(request, _callback_args, *_callback_kwargs) ... ▶ Local vars C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSMSettings\views.py in import_naadsm_scenario return run_importer(request) ... ▶ Local vars C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSMSettings\views.py in run_importer import_legacy_scenario(param_path, popul_path) ... ▶ Local vars C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSMSettings\views.py in import_legacy_scenario scenario_filename('%s with %s' % names_without_extensions) ... ▶ Local vars C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSMSettings\models.py in scenario_filename raise ValueError("Special characters are not allowed: " + new_value) ... ▶ Local vars Request information

GET No GET data POST No POST data FILES Variable Value parameters_xml
<TemporaryUploadedFile: Turkey 3.2.19 partial units scenario file.xml (text/xml)> population_xml
<TemporaryUploadedFile: Turkey 3.2.19 partial units unit file.xml (text/xml)> COOKIES No cookie data META Variable Value CONTENT_LENGTH
'6731920' wsgi.url_scheme 'http' SERVER_PROTOCOL 'HTTP/1.0' SERVER_PORT '8001' HTTP_REFERER
'http://127.0.0.1:8000/app/ImportScenario/' wsgi.errors

<_io.TextIOWrapper name='' mode='w' encoding='cp437'> HTTP_X_FORWARDED_FOR '127.0.0.1' REQUEST_URI '/app/ImportScenario/' wsgi.multithread True REQUEST_METHOD 'POST' HTTP_X_REAL_IP '127.0.0.1' PATH_INFO '/app/ImportScenario/' REMOTE_ADDR '127.0.0.1' HTTP_ORIGIN 'http://127.0.0.1:8000' HTTP_CACHE_CONTROL 'max-age=0' HTTP_HOST '127.0.0.1:8000' QUERY_STRING '' HTTP_ACCEPT_ENCODING 'gzip,deflate' REMOTE_PORT '49426' wsgi.version (1, 0) SCRIPT_NAME '' HTTP_ACCEPT_LANGUAGE 'en-us,en;q=0.8' ACTUAL_SERVER_PROTOCOL 'HTTP/1.1' SERVER_SOFTWARE 'CherryPy/3.6.0 Server' SERVER_NAME '127.0.0.1' HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like ' 'Gecko) Chrome/37.0.2062.94 Safari/537.36' wsgi.run_once False CONTENT_TYPE 'multipart/form-data; boundary=----WebKitFormBoundaryv3nm3twlaDbxdKBB' HTTP_CONNECTION 'close' wsgi.input HTTP_ACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,_/_;q=0.8' wsgi.multiprocess False Settings Using settings module ADSM.settings Setting Value DATABASE_ROUTERS ['ScenarioCreator.router.ScenarioRouter'] SESSION_COOKIE_AGE 1209600 ABSOLUTE_URL_OVERRIDES {} CSRF_COOKIE_PATH '/' CACHES {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} USE_TZ True TEMPLATE_STRING_IF_INVALID '' AUTH_USER_MODEL 'auth.User' NUMBER_GROUPING 0 CRISPY_TEMPLATE_PACK 'bootstrap' EMAIL_BACKEND 'django.core.mail.backends.smtp.EmailBackend' DEBUG_PROPAGATE_EXCEPTIONS False SESSION_SAVE_EVERY_REQUEST False INTERNAL_IPS () SESSION_SERIALIZER 'django.contrib.sessions.serializers.JSONSerializer' CSRF_FAILURE_VIEW 'django.views.csrf.csrf_failure' CSIDL_PERSONAL 5 STATICFILES_DIRS ('C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\ADSM\static',) PROFANITIES_LIST '*******************_' FILE_UPLOAD_TEMP_DIR None LOGGING {} TEMPLATE_DIRS ('C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\templates',) FIXTURE_DIRS () DATETIME_FORMAT 'N j, Y, P' LANGUAGE_COOKIE_PATH '/' LOGOUT_URL '/accounts/logout/' EMAIL_HOST_USER '' FORCE_SCRIPT_NAME None DATE_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') TEMPLATE_DEBUG True DB_BASE_DIR 'C:\Users\scase\Documents\ADSM Workspace\settings' SESSION_COOKIE_HTTPONLY True USE_L10N True DEFAULT_CONTENT_TYPE 'text/html' IGNORABLE_404_URLS () PASSWORD_RESET_TIMEOUT_DAYS '**_****************_' MEDIA_URL '/media/' SHORT_DATETIME_FORMAT 'm/d/Y P' SESSION_COOKIE_NAME 'sessionid' DATABASES {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': 'C:\Users\scase\Documents\ADSM ' 'Workspace\settings\settings.sqlite3', 'OPTIONS': {}, 'PASSWORD': '**_****************_', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': 'C:\Users\scase\Documents\ADSM ' 'Workspace\settings\test_settings.sqlite3'}, 'TIME_ZONE': 'UTC', 'USER': ''}, 'scenario_db': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': 'C:\Users\scase\Documents\ADSM ' 'Workspace\settings\activeSession.sqlite3', 'OPTIONS': {'timeout': 300}, 'PASSWORD': '**_****************_', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': 'C:\Users\scase\Documents\ADSM ' 'Workspace\settings\test_activeSession.sqlite3'}, 'TIME_ZONE': 'UTC', 'USER': ''}} TRANSACTIONS_MANAGED False SESSION_COOKIE_SECURE False MIGRATION_MODULES {} STATIC_ROOT 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\static' LOCALE_PATHS () USE_I18N True TIME_FORMAT 'P' TIME_ZONE 'UTC' PASSWORD_HASHERS '**_****************_' APPEND_SLASH True MANAGERS () DEFAULT_FILE_STORAGE 'django.core.files.storage.FileSystemStorage' STATICFILES_FINDERS ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder') MESSAGE_STORAGE 'django.contrib.messages.storage.fallback.FallbackStorage' STATIC_URL '/static/' LANGUAGE_COOKIE_AGE None SERVER_EMAIL 'root@localhost' THOUSAND_SEPARATOR ',' CACHE_MIDDLEWARE_ALIAS 'default' SHORT_DATE_FORMAT 'm/d/Y' TEMPLATE_LOADERS ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader') CSRF_COOKIE_HTTPONLY False MONTH_DAY_FORMAT 'F j' ADMINS () SIGNING_BACKEND 'django.core.signing.TimestampSigner' EMAIL_PORT 25 FIRST_DAY_OF_WEEK 0 MIDDLEWARE_CLASSES ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'ADSMSettings.disable.DisableCSRF') FILE_UPLOAD_HANDLERS ('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler') CSRF_COOKIE_NAME 'csrftoken' DEFAULT_EXCEPTION_REPORTER_FILTER 'django.views.debug.SafeExceptionReporterFilter' EMAIL_USE_SSL False DISALLOWED_USER_AGENTS () ROOT_URLCONF 'ADSM.urls' ADMIN_FOR () AUTHENTICATION_BACKENDS ('django.contrib.auth.backends.ModelBackend',) USE_THOUSAND_SEPARATOR False BASE_DIR 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src' LOGIN_REDIRECT_URL '/accounts/profile/' SESSION_ENGINE 'django.contrib.sessions.backends.db' TIME_INPUT_FORMATS ('%H:%M:%S', '%H:%M:%S.%f', '%H:%M') SESSION_CACHE_ALIAS 'default' EMAIL_HOST_PASSWORD '**_****************_' CSRF_COOKIE_AGE 31449600 LANGUAGE_COOKIE_DOMAIN None LANGUAGE_CODE 'en-us' EMAIL_SUBJECT_PREFIX '[Django] ' LANGUAGE_COOKIE_NAME 'django_language' SHGFP_TYPE_CURRENT 0 FILE_CHARSET 'utf-8' SECURE_PROXY_SSL_HEADER None SESSION_COOKIE_PATH '/' TEST_RUNNER 'django.test.runner.DiscoverRunner' CSRF_COOKIE_SECURE False STATICFILES_STORAGE 'django.contrib.staticfiles.storage.StaticFilesStorage' ALLOWED_HOSTS [] DEFAULT_INDEX_TABLESPACE '' CSRF_COOKIE_DOMAIN None COMMENTS_ALLOW_PROFANITIES False MEDIA_ROOT 'C:\Users\scase\Desktop\ADSM_3.2.22-RC5.2\src\media' CACHE_MIDDLEWARE_KEY_PREFIX '**_****************_' 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'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian 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'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('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 Bokmal'), ('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-cn', 'Simplified Chinese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese'), ('zh-tw', 'Traditional Chinese')) EMAIL_HOST 'localhost' DECIMAL_SEPARATOR '.' FILE_UPLOAD_MAX_MEMORY_SIZE 2621440 SEND_BROKEN_LINK_EMAILS False SESSION_EXPIRE_AT_BROWSER_CLOSE False YEAR_MONTH_FORMAT 'F Y' FILE_UPLOAD_PERMISSIONS None PREPEND_WWW False WSGI_APPLICATION 'ADSM.wsgi.application' X_FRAME_OPTIONS 'SAMEORIGIN' SILENCED_SYSTEM_CHECKS [] DEBUG True SETTINGS_MODULE 'ADSM.settings' FILE_UPLOAD_DIRECTORY_PERMISSIONS None SESSION_FILE_PATH None ALLOWED_INCLUDE_ROOTS () SECRET_KEY '**_*****************' DATE_FORMAT 'N j, Y' DEFAULT_CHARSET 'utf-8' LOGGING_CONFIG 'logging.config.dictConfig' TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.request', 'ADSMSettings.context_processor.adsm_context', 'ScenarioCreator.context_processor.basic_context', 'Results.context_processor.results_context') USE_ETAGS False LOGIN_URL '/accounts/login/' USE_X_FORWARDED_HOST False INSTALLED_APPS ('ScenarioCreator', 'Results', 'ADSMSettings', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'floppyforms', 'crispy_forms', 'productionserver') EMAIL_USE_TLS False 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') SESSION_COOKIE_DOMAIN None CACHE_MIDDLEWARE_SECONDS 600 FORMAT_MODULE_PATH None LANGUAGES_BIDI ('he', 'ar', 'fa', 'ur') DEFAULT_TABLESPACE '' TEST_NON_SERIALIZED_APPS [] DEFAULT_FROM_EMAIL 'webmaster@localhost' ## 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 500 page.
missyschoenbaum commented 9 years ago

@casesp as a reference point, the special characters that are not allowed in production type names are: comma , doubletick " singletick ' slash \ This is under discussion in #5

missyschoenbaum commented 9 years ago

@casesp kick this back to me if you do find that one of the 4 special characters is a production type name. I am not certain what exactly else would be failing a special character, but it needs to fail it more nicely than a yellow screen.

casesp commented 9 years ago

@missyschoenbaum The special characters listed are not found in the file or within the filename used. So the error message confusion still stands. Why did this attempt fail? It used to work in RC5.1, and it works in NAADSM 3.2.19

casesp commented 9 years ago

I'm closing this issue...I believe it is issue #510 that is the real culprit in this case.