specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
66 stars 36 forks source link

Table 'specify.spdataset' doesn't exist #774

Closed maxpatiiuk closed 3 years ago

maxpatiiuk commented 3 years ago

I'm getting the Table 'specify.spdataset' doesn't exist error when clicking on the WorkBench tab in Specify 7 I'm on the latest commit from wb-upload-for-testing. Also, I have rebuild the container from scratch and deleted the previous database and all of the previous containers, so there can't be any interference from the previous version of Specify 7

ProgrammingError at /api/workbench/dataset/
(1146, "Table 'specify.spdataset' doesn't exist")

Request Method: GET
Request URL: http://localhost/api/workbench/dataset/
Django Version: 2.2.10
Python Executable: /opt/specify7/ve/bin/python
Python Version: 3.6.9
Python Path: ['/opt/specify7', '/opt/specify7', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/opt/specify7/ve/lib/python3.6/site-packages']
Server time: Mon, 1 Feb 2021 13:35:31 -0600
Installed Applications:
('django.contrib.sessions',
 'django.contrib.staticfiles',
 'django.contrib.contenttypes',
 'django.contrib.auth',
 'specifyweb.specify',
 'specifyweb.stored_queries',
 'specifyweb.businessrules',
 'specifyweb.express_search',
 'specifyweb.context',
 'specifyweb.attachment_gw',
 'specifyweb.frontend',
 'specifyweb.barvis',
 'specifyweb.report_runner',
 'specifyweb.interactions',
 'specifyweb.workbench',
 'specifyweb.notifications',
 'specifyweb.export',
 'specifyweb.raven_placeholder',
 'django_jsonfield_backport')
Installed Middleware:
['django.middleware.gzip.GZipMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'specifyweb.context.middleware.ContextMiddleware']

Traceback:

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/mysql/base.py" in execute
  71.             return self.cursor.execute(query, args)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in execute
  250.             self.errorhandler(self, exc, value)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/connections.py" in defaulterrorhandler
  50.         raise errorvalue

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in execute
  247.             res = self._query(query)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in _query
  412.         rowcount = self._do_query(q)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in _do_query
  375.         db.query(q)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/connections.py" in query
  276.             _mysql.connection.query(self, query)

The above exception ((1146, "Table 'specify.spdataset' doesn't exist")) was the direct cause of the following exception:

File "/opt/specify7/ve/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/specify7/specifyweb/specify/views.py" in wrapped
  20.         return view(request, *args, **kwargs)

File "/opt/specify7/specifyweb/specify/views.py" in wrapped
  32.         return view(request, *args, **kwargs)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/views/decorators/http.py" in inner
  40.             return func(request, *args, **kwargs)

File "/usr/lib/python3.6/contextlib.py" in inner
  52.                 return func(*args, **kwds)

File "/opt/specify7/specifyweb/workbench/views.py" in datasets
  44.         return http.JsonResponse([{'id': ds.id, **{attr: getattr(ds, attr) for attr in attrs}} for ds in dss], safe=False)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/models/query.py" in __iter__
  274.         self._fetch_all()

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/models/query.py" in _fetch_all
  1242.             self._result_cache = list(self._iterable_class(self))

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/models/query.py" in __iter__
  55.         results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1133.             cursor.execute(sql, params)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  99.             return super().execute(sql, params)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  67.         return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
  76.         return executor(sql, params, many, context)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/utils.py" in __exit__
  89.                 raise dj_exc_value.with_traceback(traceback) from exc_value

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

File "/opt/specify7/ve/lib/python3.6/site-packages/django/db/backends/mysql/base.py" in execute
  71.             return self.cursor.execute(query, args)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in execute
  250.             self.errorhandler(self, exc, value)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/connections.py" in defaulterrorhandler
  50.         raise errorvalue

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in execute
  247.             res = self._query(query)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in _query
  412.         rowcount = self._do_query(q)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/cursors.py" in _do_query
  375.         db.query(q)

File "/opt/specify7/ve/lib/python3.6/site-packages/MySQLdb/connections.py" in query
  276.             _mysql.connection.query(self, query)

Exception Type: ProgrammingError at /api/workbench/dataset/
Exception Value: (1146, "Table 'specify.spdataset' doesn't exist")
Request information:
USER: Specifyuser object (1)

GET: No GET data

POST: No POST data

FILES: No FILES data

COOKIES:
csrftoken = 'wnL5N1VhhZHdtE6eJJe49w5nTM2G9saZD3zmMKlvjippOfJxzK9y4C24GPT48jtQ'
sessionid = 'v3dptag2nzgizvwk8mgnp59fmmzc8b8y'
collection = '4'

META:
CELERY_BROKER_URL = 'redis://redis/0'
CELERY_RESULT_BACKEND = 'redis://redis/1'
CONTENT_LENGTH = ''
CONTENT_TYPE = 'text/plain'
CSRF_COOKIE = 'wnL5N1VhhZHdtE6eJJe49w5nTM2G9saZD3zmMKlvjippOfJxzK9y4C24GPT48jtQ'
DATABASE_HOST = 'mariadb'
DATABASE_NAME = 'specify'
DATABASE_PORT = '3306'
DJANGO_SETTINGS_MODULE = 'settings'
GATEWAY_INTERFACE = 'CGI/1.1'
HOME = '/home/specify'
HOSTNAME = '9e262aac9f18'
HTTP_ACCEPT = '*/*'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.9,uk;q=0.8'
HTTP_CONNECTION = 'close'
HTTP_COOKIE = 'csrftoken=wnL5N1VhhZHdtE6eJJe49w5nTM2G9saZD3zmMKlvjippOfJxzK9y4C24GPT48jtQ; sessionid=v3dptag2nzgizvwk8mgnp59fmmzc8b8y; collection=4'
HTTP_HOST = 'localhost'
HTTP_REFERER = 'http://localhost/specify/'
HTTP_SEC_CH_UA = '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"'
HTTP_SEC_CH_UA_MOBILE = '?0'
HTTP_SEC_FETCH_DEST = 'empty'
HTTP_SEC_FETCH_MODE = 'cors'
HTTP_SEC_FETCH_SITE = 'same-origin'
HTTP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.23 Safari/537.36'
HTTP_X_FORWARDED_FOR = '172.18.0.1'
HTTP_X_REAL_IP = '172.18.0.1'
HTTP_X_REQUESTED_WITH = 'XMLHttpRequest'
LOG_LEVEL = 'WARNING'
MASTER_NAME = 'master'
MASTER_PASSWORD = 'master'
PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
PATH_INFO = '/api/workbench/dataset/'
PWD = '/opt/specify7'
QUERY_STRING = ''
REMOTE_ADDR = '172.18.0.6'
REMOTE_HOST = ''
REPORT_RUNNER_HOST = 'report-runner'
REPORT_RUNNER_PORT = '8080'
REQUEST_METHOD = 'GET'
RUN_MAIN = 'true'
SCRIPT_NAME = ''
SECRET_KEY = 'change this to some unique random string'
SERVER_NAME = '9e262aac9f18'
SERVER_PORT = '8000'
SERVER_PROTOCOL = 'HTTP/1.0'
SERVER_SOFTWARE = 'WSGIServer/0.2'
SP7_DEBUG = 'true'
TZ = 'America/Chicago'
wsgi.errors = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='ANSI_X3.4-1968'>
wsgi.file_wrapper = ''
wsgi.input = <django.core.handlers.wsgi.LimitedStream object at 0x7f93abf6b128>
wsgi.multiprocess = False
wsgi.multithread = True
wsgi.run_once = False
wsgi.url_scheme = 'http'
wsgi.version = '(1, 0)'

Settings:
Using settings module settings
ABSOLUTE_URL_OVERRIDES = {}
ADMINS = '()'
ADMIN_MEDIA_PREFIX = '/static/admin/'
ALLOWED_HOSTS = ['*']
ALLOW_SPECIFY6_PASSWORDS = '********************'
ALLOW_SUPPORT_LOGIN = False
ANONYMOUS_USER = None
APPEND_SLASH = True
AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
AUTH_LDAP_SERVER_URI = None
AUTH_PASSWORD_VALIDATORS = '********************'
AUTH_USER_MODEL = 'specify.Specifyuser'
CACHES = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
CELERY_BROKER_URL = 'redis://redis/0'
CELERY_RESULT_BACKEND = 'redis://redis/1'
CELERY_TASK_DEFAULT_QUEUE = 'specify'
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': {'ENGINE': 'specifyweb.hibernateboolsbackend.backends.mysql', 'NAME': 'specify', 'USER': 'master', 'PASSWORD': '********************', 'HOST': 'mariadb', 'PORT': '3306', 'TEST': {'CHARSET': None, 'COLLATION': None, 'NAME': None, 'MIRROR': None}, 'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'OPTIONS': {}, 'TIME_ZONE': None}}
DATABASE_HOST = 'mariadb'
DATABASE_NAME = 'specify'
DATABASE_PORT = '3306'
DATABASE_ROUTERS = []
DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
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 = ['%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']
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_TABLESPACE = ''
DEPOSITORY_DIR = '/volumes/static-files/depository'
DISABLE_AUDITING = False
DISALLOWED_USER_AGENTS = []
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_HOST_PASSWORD = '********************'
EMAIL_HOST_USER = ''
EMAIL_PORT = 25
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 = False
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'
IGNORABLE_404_URLS = []
INSTALLED_APPS = "('django.contrib.sessions', 'django.contrib.staticfiles', 'django.contrib.contenttypes', 'django.contrib.auth', 'specifyweb.specify', 'specifyweb.stored_queries', 'specifyweb.businessrules', 'specifyweb.express_search', 'specifyweb.context', 'specifyweb.attachment_gw', 'specifyweb.frontend', 'specifyweb.barvis', 'specifyweb.report_runner', 'specifyweb.interactions', 'specifyweb.workbench', 'specifyweb.notifications', 'specifyweb.export', 'specifyweb.raven_placeholder', 'django_jsonfield_backport')"
INTERNAL_IPS = []
JAVA_PATH = '/usr/bin/java'
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'), ('hy', 'Armenian'), ('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 = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'standard': {'format': '[%(asctime)s] [%(levelname)s] [%(name)s:%(lineno)s] %(message)s', 'datefmt': '%d/%b/%Y %H:%M:%S'}}, 'handlers': {'console': {'level': 'WARNING', 'class': 'logging.StreamHandler', 'formatter': 'standard'}}, 'loggers': {'specifyweb': {'handlers': ['console'], 'level': 'DEBUG', 'propagate': True}}}
LOGGING_CONFIG = 'logging.config.dictConfig'
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/accounts/login/'
LOGOUT_REDIRECT_URL = None
MANAGERS = '()'
MASTER_NAME = 'master'
MASTER_PASSWORD = '********************'
MEDIA_ROOT = ''
MEDIA_URL = ''
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE = ['django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'specifyweb.context.middleware.ContextMiddleware']
MIGRATION_MODULES = {}
MONTH_DAY_FORMAT = 'F j'
NOTIFICATION_TTL_DAYS = 7
NUMBER_GROUPING = 0
PASSWORD_HASHERS = '********************'
PASSWORD_RESET_TIMEOUT_DAYS = '********************'
PREPEND_WWW = False
RAVEN_CONFIG = None
REPORT_RUNNER_HOST = 'report-runner'
REPORT_RUNNER_PORT = '8080'
ROOT_URLCONF = 'specifyweb.urls'
RO_MODE = False
SA_DATABASE_URL = 'mysql://master:master@mariadb:3306/specify?charset=utf8'
SA_POOL_RECYCLE = 3600
SCHEMA_LANGUAGE = 'en'
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.file'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_FILE_PATH = None
SESSION_SAVE_EVERY_REQUEST = False
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE = 'settings'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
SHORT_DATE_FORMAT = 'm/d/Y'
SIGNING_BACKEND = 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS = []
SITE_ID = 1
SPECIFY_CONFIG_DIR = '/opt/Specify/config'
SPECIFY_THICK_CLIENT = '/opt/Specify'
STATICFILES_DIRS = "(('config', '/opt/Specify/config'),)"
STATICFILES_FINDERS = "('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')"
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATS_URL = 'https://stats.specifycloud.org/capture'
SUPPORT_LOGIN_TTL = 300
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages']}}]
TEST_NON_SERIALIZED_APPS = []
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
THICK_CLIENT_LOCATION = '/opt/Specify'
THOUSAND_SEPARATOR = ','
TIME_FORMAT = 'P'
TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE = 'America/Chicago'
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = False
USE_TZ = False
USE_X_FORWARDED_HOST = False
USE_X_FORWARDED_PORT = False
VERSION = '(debug)'
WB_UPLOAD_LOG_DIR = '/home/specify/wb_upload_logs'
WEB_ATTACHMENT_COLLECTION = None
WEB_ATTACHMENT_KEY = '********************'
WEB_ATTACHMENT_REQUIRES_KEY_FOR_GET = '********************'
WEB_ATTACHMENT_URL = None
WSGI_APPLICATION = None
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.
maxpatiiuk commented 3 years ago

Is it a problem with the initial .sql file I use to create the database? Should I automatically create the needed table if it doesn't exist?

maxpatiiuk commented 3 years ago

Running ./ve/bin/python manage.py migrate workbench fixed the issue. Although, all of the datasets that were present in the database, no longer show up. Screen Shot 2021-02-01 at 10 24 07 PM

benanhalt commented 3 years ago

That's expected. The data sets are stored in a different table now.

maxpatiiuk commented 3 years ago

I recreated a container from scratch and needed to run ./ve/bin/python manage.py migrate workbench again to fix this issue. Seems like it doesn't migrate automatically

benanhalt commented 3 years ago

It should apply the migrations when the Specify 7 Docker container is started normally. If the Docker CMD is overridden, it will not. This is so that the main Docker container and the worker container don't both try to apply the migrations. I'm not really sure the best way to handle this because it would still be a problem if there were multiple instances of the Docker container started with the default CMD.

https://github.com/specify/specify7/blob/wb-upload-for-testing/docker-entrypoint.sh#L4

maxpatiiuk commented 3 years ago

By default CMD, do you mean docker run ...?

I run it with docker-compose up --build -d (with all of the previous volumes deleted)

If there isn't an easy solution, maybe that migrations script can be made to check if the table exists, and if it does not, create it

benanhalt commented 3 years ago

The default CMD starts gunicorn (https://github.com/specify/specify7/blob/wb-upload-for-testing/Dockerfile#L124). When it is started by the development docker-compose (https://github.com/specify/specify7/blob/wb-upload-for-testing/docker-compose.yml#L18) it is overridden to start the development server. That causes the docker-entrypoint script to skip the migrate commands.

The migrate commands do check if the tables exist, but if more than one process runs them at the same time, there is a race condition and both process may see a table not existing and both decide to create it. It might be okay if MySQL had DDL transactions, but it doesn't.

maxpatiiuk commented 3 years ago

Fixed in ca5da30e