BU-ISCIII / iskylims

is an open-source LIMS (laboratory Information Management System) for Next Generation Sequencing sample management, statistics and reports, and bioinformatics analysis service management.
https://github.com/BU-ISCIII/iSkyLIMS/wiki
GNU General Public License v3.0
72 stars 35 forks source link

Bug in statistics by service requested dashboard #239

Closed Shettland closed 1 year ago

Shettland commented 1 year ago

Description of the bug

The web crashes when you try to search for statistics in the dashboard "Statistics by service requested" using a negative date range e.g. From date 10/10/2023 to date 08/08/2023.

image

Command used and terminal output

Request information
USER

bioinfoadm
GET

No GET data
POST
Variable    Value
csrfmiddlewaretoken     

'Lrt458ApAgnmI5NPUakdFIlHC0SnIJRS9bp9VaZRIMorapte3Y1wvJrsxVbvb5Sb'

action  

'service_statistics'

start_date  

'2023-10-20'

end_date    

'2023-10-02'

FILES

No FILES data
COOKIES
Variable    Value
csrftoken   

'********************'

sessionid   

'********************'

META
Variable    Value
CONTENT_LENGTH  

'627'

CONTENT_TYPE    

('multipart/form-data; '
 'boundary=---------------------------83695474016390042764250335570')

CONTEXT_DOCUMENT_ROOT   

'/opt/iskylims'

CONTEXT_PREFIX  

''

CSRF_COOKIE     

'yU6f0czCiGbfCuQzjYRt0bgV55tiDwbt'

DOCUMENT_ROOT   

'/opt/iskylims'

GATEWAY_INTERFACE   

'CGI/1.1'

HTTP_ACCEPT     

'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8'

HTTP_ACCEPT_ENCODING    

'gzip, deflate'

HTTP_ACCEPT_LANGUAGE    

'en-US,en;q=0.5'

HTTP_CONNECTION     

'keep-alive'

HTTP_COOKIE     

'********************'

HTTP_HOST   

'iskylims.isciiides.es'

HTTP_ORIGIN     

'http://iskylims.isciiides.es'

HTTP_REFERER    

'http://iskylims.isciiides.es/drylab/stats-services-time'

HTTP_UPGRADE_INSECURE_REQUESTS  

'1'

HTTP_USER_AGENT     

'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0'

PATH_INFO   

'/drylab/stats-services-time'

PATH_TRANSLATED     

'/opt/iskylims/iskylims/wsgi.py/drylab/stats-services-time'

QUERY_STRING    

''

REMOTE_ADDR     

'10.22.140.220'

REMOTE_PORT     

'45970'

REQUEST_METHOD  

'POST'

REQUEST_SCHEME  

'http'

REQUEST_URI     

'/drylab/stats-services-time'

SCRIPT_FILENAME     

'/opt/iskylims/iskylims/wsgi.py'

SCRIPT_NAME     

''

SERVER_ADDR     

'172.20.10.40'

SERVER_ADMIN    

'bioinformatica@isciii.es'

SERVER_NAME     

'iskylims.isciiides.es'

SERVER_PORT     

'80'

SERVER_PROTOCOL     

'HTTP/1.1'

SERVER_SIGNATURE    

'********************'

SERVER_SOFTWARE     

'Apache'

UNIQUE_ID   

'ZR5z6kpO@b6IJTwUmz3JfgAAAMM'

apache.version  

(2, 4, 37)

mod_wsgi.application_group  

'iskylims.isciiides.es|'

mod_wsgi.callable_object    

'application'

mod_wsgi.daemon_connects    

'1'

mod_wsgi.daemon_restarts    

'0'

mod_wsgi.daemon_start   

'1696494570291714'

mod_wsgi.enable_sendfile    

'0'

mod_wsgi.handler_script     

''

mod_wsgi.ignore_activity    

'0'

mod_wsgi.listener_host  

''

mod_wsgi.listener_port  

'80'

mod_wsgi.path_info  

'/drylab/stats-services-time'

mod_wsgi.process_group  

'iskylims.isciiides.es'

mod_wsgi.queue_start    

'1696494570291564'

mod_wsgi.request_handler    

'wsgi-script'

mod_wsgi.request_id     

'ZR5z6kpO@b6IJTwUmz3JfgAAAMM'

mod_wsgi.request_start  

'1696494570291115'

mod_wsgi.script_name    

''

mod_wsgi.script_reloading   

'1'

mod_wsgi.script_start   

'1696494570292096'

mod_wsgi.thread_id  

7

mod_wsgi.thread_requests    

35

mod_wsgi.total_requests     

1514

mod_wsgi.version    

(4, 9, 4)

wsgi.errors     

<_io.TextIOWrapper name='<wsgi.errors>' encoding='utf-8'>

wsgi.file_wrapper   

<class 'mod_wsgi.FileWrapper'>

wsgi.input  

<mod_wsgi.Input object at 0x7ff17da72420>

wsgi.input_terminated   

True

wsgi.multiprocess   

False

wsgi.multithread    

True

wsgi.run_once   

False

wsgi.url_scheme     

'http'

wsgi.version    

(1, 0)

Settings
Using settings module iskylims.settings
Setting     Value
ABSOLUTE_URL_OVERRIDES  

{}

ADMINS  

[]

ALLOWED_EMAIL_DOMAINS   

[]

ALLOWED_HOSTS   

['iskylims.isciiides.es', '127.0.0.1', '172.20.10.40']

APPEND_SLASH    

True

APPS_NAMES  

[['wetlab', 'Genomics unit: massive sequencing'],
 ['drylab', 'Bioinformatics unit: analysis requests']]

AUTHENTICATION_BACKENDS     

['django.contrib.auth.backends.ModelBackend']

AUTH_PASSWORD_VALIDATORS    

'********************'

AUTH_USER_MODEL     

'auth.User'

BASE_DIR    

'/opt/iskylims'

CACHES  

{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}

CACHE_MIDDLEWARE_ALIAS  

'default'

CACHE_MIDDLEWARE_KEY_PREFIX     

'********************'

CACHE_MIDDLEWARE_SECONDS    

600

CRISPY_ALLOWED_TEMPLATE_PACKS   

'bootstrap5'

CRISPY_TEMPLATE_PACK    

'bootstrap5'

CRONJOBS    

[('*/15 * * * *',
  'wetlab.cron.looking_for_new_runs',
  '>>/opt/iskylims/logs/crontab.log'),
 ('0 0 1 * *',
  'wetlab.cron.delete_invalid_run',
  '>>/opt/iskylims/logs/crontab_cleanup.log')]

CRONTAB_COMMAND_SUFFIX  

'2>&1'

CSRF_COOKIE_AGE     

31449600

CSRF_COOKIE_DOMAIN  

None

CSRF_COOKIE_HTTPONLY    

False

CSRF_COOKIE_MASKED  

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': {'ATOMIC_REQUESTS': False,
             'AUTOCOMMIT': True,
             'CONN_HEALTH_CHECKS': False,
             'CONN_MAX_AGE': 0,
             'ENGINE': 'django.db.backends.mysql',
             'HOST': 'dmysqlps.isciiides.es',
             'NAME': 'iskylims',
             'OPTIONS': {},
             'PASSWORD': '********************',
             'PORT': '3306',
             'TEST': {'CHARSET': None,
                      'COLLATION': None,
                      'MIGRATE': True,
                      'MIRROR': None,
                      'NAME': 'iSkyLIMS_test'},
             'TIME_ZONE': None,
             'USER': 'iskylims'}}

DATABASE_ROUTERS    

[]

DATA_UPLOAD_MAX_MEMORY_SIZE     

7000000

DATA_UPLOAD_MAX_NUMBER_FIELDS   

1000

DATA_UPLOAD_MAX_NUMBER_FILES    

100

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',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M']

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_AUTO_FIELD  

'django.db.models.AutoField'

DEFAULT_CHARSET     

'utf-8'

DEFAULT_EXCEPTION_REPORTER  

'django.views.debug.ExceptionReporter'

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  

''

DISALLOWED_USER_AGENTS  

[]

EMAIL_BACKEND   

'django.core.mail.backends.console.EmailBackend'

EMAIL_HOST  

'iskylims.isciiides.es'

EMAIL_HOST_PASSWORD     

'********************'

EMAIL_HOST_USER     

'bioinfo'

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_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     

420

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  

['core',
 'wetlab',
 'drylab',
 'django_utils',
 'mptt',
 'crispy_forms',
 'crispy_bootstrap5',
 'django_crontab',
 'django_mptt_admin',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_extensions',
 'rest_framework',
 'drf_yasg',
 'django_cleanup']

INTERNAL_IPS    

[]

LANGUAGES   

[('af', 'Afrikaans'),
 ('ar', 'Arabic'),
 ('ar-dz', 'Algerian Arabic'),
 ('ast', 'Asturian'),
 ('az', 'Azerbaijani'),
 ('bg', 'Bulgarian'),
 ('be', 'Belarusian'),
 ('bn', 'Bengali'),
 ('br', 'Breton'),
 ('bs', 'Bosnian'),
 ('ca', 'Catalan'),
 ('ckb', 'Central Kurdish (Sorani)'),
 ('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'),
 ('ig', 'Igbo'),
 ('io', 'Ido'),
 ('is', 'Icelandic'),
 ('it', 'Italian'),
 ('ja', 'Japanese'),
 ('ka', 'Georgian'),
 ('kab', 'Kabyle'),
 ('kk', 'Kazakh'),
 ('km', 'Khmer'),
 ('kn', 'Kannada'),
 ('ko', 'Korean'),
 ('ky', 'Kyrgyz'),
 ('lb', 'Luxembourgish'),
 ('lt', 'Lithuanian'),
 ('lv', 'Latvian'),
 ('mk', 'Macedonian'),
 ('ml', 'Malayalam'),
 ('mn', 'Mongolian'),
 ('mr', 'Marathi'),
 ('ms', 'Malay'),
 ('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'),
 ('tg', 'Tajik'),
 ('th', 'Thai'),
 ('tk', 'Turkmen'),
 ('tr', 'Turkish'),
 ('tt', 'Tatar'),
 ('udm', 'Udmurt'),
 ('uk', 'Ukrainian'),
 ('ur', 'Urdu'),
 ('uz', 'Uzbek'),
 ('vi', 'Vietnamese'),
 ('zh-hans', 'Simplified Chinese'),
 ('zh-hant', 'Traditional Chinese')]

LANGUAGES_BIDI  

['he', 'ar', 'ar-dz', 'ckb', 'fa', 'ur']

LANGUAGE_CODE   

'en-us'

LANGUAGE_COOKIE_AGE     

None

LANGUAGE_COOKIE_DOMAIN  

None

LANGUAGE_COOKIE_HTTPONLY    

False

LANGUAGE_COOKIE_NAME    

'django_language'

LANGUAGE_COOKIE_PATH    

'/'

LANGUAGE_COOKIE_SAMESITE    

None

LANGUAGE_COOKIE_SECURE  

False

LOCALE_PATHS    

[]

LOGGING     

{}

LOGGING_CONFIG  

'logging.config.dictConfig'

LOGIN_REDIRECT_URL  

'/'

LOGIN_URL   

'/accounts/login/'

LOGOUT_REDIRECT_URL     

None

LOG_CLEAN_FILE  

'/opt/iskylims/logs/crontab_cleanup.log'

LOG_CRONTAB_FILE    

'/opt/iskylims/logs/crontab.log'

MANAGERS    

[]

MEDIA_ROOT  

'/opt/iskylims/documents/'

MEDIA_URL   

'/documents/'

MESSAGE_STORAGE     

'django.contrib.messages.storage.fallback.FallbackStorage'

MIDDLEWARE  

['django.middleware.security.SecurityMiddleware',
 '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']

MIGRATION_MODULES   

{}

MONTH_DAY_FORMAT    

'F j'

NUMBER_GROUPING     

0

PASSWORD_HASHERS    

'********************'

PASSWORD_RESET_TIMEOUT  

'********************'

PREPEND_WWW     

False

ROOT_URLCONF    

'iskylims.urls'

SECRET_KEY  

'********************'

SECRET_KEY_FALLBACKS    

'********************'

SECURE_CONTENT_TYPE_NOSNIFF     

True

SECURE_CROSS_ORIGIN_OPENER_POLICY   

'same-origin'

SECURE_HSTS_INCLUDE_SUBDOMAINS  

False

SECURE_HSTS_PRELOAD     

False

SECURE_HSTS_SECONDS     

0

SECURE_PROXY_SSL_HEADER     

None

SECURE_REDIRECT_EXEMPT  

[]

SECURE_REFERRER_POLICY  

'same-origin'

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     

'iskylims.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     

'/opt/iskylims/static/'

STATIC_URL  

'/static/'

STORAGES    

{'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'},
 'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}}

SWAGGER_SETTINGS    

{'SECURITY_DEFINITIONS': {'basic': {'type': 'basic'}}}

TEMPLATES   

[{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': ['/opt/iskylims/documents/drylab/services_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',
                                     'django.template.context_processors.i18n']}}]

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   

'Europe/Madrid'

USE_DEPRECATED_PYTZ     

False

USE_I18N    

True

USE_L10N    

True

USE_THOUSAND_SEPARATOR  

False

USE_TZ  

False

USE_X_FORWARDED_HOST    

False

USE_X_FORWARDED_PORT    

False

WSGI_APPLICATION    

'iskylims.wsgi.application'

X_FRAME_OPTIONS     

'DENY'

YEAR_MONTH_FORMAT   

'F Y'

Relevant files

No response

System information

No response

luissian commented 1 year ago

Corrected in the next PR