docker / hub-feedback

Feedback and bug reports for the Docker Hub
https://hub.docker.com
232 stars 40 forks source link

Cannot access MySQL db container within docker compose container during a Docker Hub Automated Test #2248

Closed rdmolony closed 2 years ago

rdmolony commented 2 years ago

Problem description

I am trying to test & build my Django application via Docker Hub Autobuild/Autotest. On Docker Hub I can't access my MySQL db container from within my web container & so I cannot successfully run any tests. I can docker compose -f docker-compose.test.yml run sut fine locally so I'm at a loss as to why the behaviour differs here.

On a related note, I couldn't find any documentation on the default build & test commands? This would be really helpful in understanding how to override the defaults via hooks/

Debug Information

URL: https://hub.docker.com/repository/registry-1.docker.io/rdmolony/stationmanager/builds/f414f183-a945-424a-b6bc-daff53f9283b

Timetamp or time range: UTC+1

Public IP:

Hub Username: rdmolony

Error messages (on screen or in browser console)

All tests fail with E MySQLdb._exceptions.OperationalError: (2005, "Unknown MySQL server host 'db' (-3)")

Traceback on Docker Hub ```bash Image for service sut was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. Creating bs6kpwutehj5ttqnsk3pmwt_mssql_1 ... Creating bs6kpwutehj5ttqnsk3pmwt_selenium_1 ... Creating bs6kpwutehj5ttqnsk3pmwt_db_1 ... Creating bs6kpwutehj5ttqnsk3pmwt_db_1 ... done Creating bs6kpwutehj5ttqnsk3pmwt_mssql_1 ... done Creating bs6kpwutehj5ttqnsk3pmwt_selenium_1 ... done Creating bs6kpwutehj5ttqnsk3pmwt_sut_run ... Creating bs6kpwutehj5ttqnsk3pmwt_sut_run ... done WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release 841 static files copied to '/static', 1855 post-processed. ============================= test session starts ============================== platform linux -- Python 3.7.12, pytest-6.1.2, py-1.11.0, pluggy-0.13.1 -- /venv/bin/python cachedir: .pytest_cache django: settings: EAGnet.settings (from ini) rootdir: /app, configfile: pytest.ini plugins: factoryboy-2.2.1, anyio-3.5.0, Faker-13.11.0, django-4.5.2 collecting ... collected 73 items tests/test_dump.py::test_dump_station XFAIL [ 1%] tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags ERROR [ 2%] tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes ERROR [ 4%] tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes ERROR [ 5%] tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes ERROR [ 6%] tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes ERROR [ 8%] tests/stationmanager/test_models.py::TestDataFile::test_read_west_bakr_era5 ERROR [ 9%] tests/stationmanager/test_models.py::TestDataFile::test_read_taiba_tai100_dnv ERROR [ 10%] tests/stationmanager/test_models.py::TestTimezone::test_extract_offset_from_alias[GMT+01-1] ERROR [ 12%] tests/stationmanager/test_models.py::TestTimezone::test_extract_offset_from_alias[GMT-01--1] ERROR [ 13%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[UTC-0] ERROR [ 15%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[GMT+01-1] ERROR [ 16%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[GMT-01--1] ERROR [ 17%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset_raises_error_on_empty_alias ERROR [ 19%] tests/stationmanager/test_views.py::test_windog_export_on_wind_station ERROR [ 20%] tests/stationmanager/test_views.py::test_windog_export_on_pv_station ERROR [ 21%] tests/stationmanager/test_views.py::test_windog_export_on_cached_clean_data ERROR [ 23%] tests/stationmanager/test_views.py::test_windog_flags_are_uploaded_to_the_flags_table ERROR [ 24%] tests/stationmanager/test_views.py::test_cannot_upload_duplicate_windog_flags ERROR [ 26%] tests/stationmanager/test_views.py::test_upload_station_xlsx_finds_all_nodes_in_file ERROR [ 27%] tests/stationmanager/test_views.py::test_main_tree_json ERROR [ 28%] tests/stationmanager/test_views.py::test_list_countries ERROR [ 30%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Wind Speed 65.0 m N avg-Wind Speed-65-0] ERROR [ 31%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Wind Speed 65.0 m S avg-Wind Speed-65-180] ERROR [ 32%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Wind Direction 78.0 m avg-Wind Direction-78-None] ERROR [ 34%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Pressure 80.0 m N avg-Pressure-80-None] ERROR [ 35%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Temperature 80.0 m avg-Temperature-80-None] ERROR [ 36%] tests/stationmanager/test_windog.py::test_map_windog_column_to_ch020_01_nodes[Humidity 80.0 m avg-Relative Humidity-80-None] ERROR [ 38%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Humidity 2.0 m avg-Relative Humidity-2-None-None] ERROR [ 39%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Global Horizontal Irradiation 1.7 m 0_0 avg-Global Horizontal Irradiation-1.72-0-None] ERROR [ 41%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Diffuse Horizontal Irradiation 1.7 m 0_0 avg-Global Diffuse Irradiation-1.72-0-None] ERROR [ 42%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Direct Normal Irradiation 1.5 m 0_0 avg-Direct Normal Irradiation-1.52-0-None] ERROR [ 43%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Albedometer Reflected Irradiation 1.5 m 0_0-Albedometer Reflected Irradiation-1.5-0-None] ERROR [ 45%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Albedo 1.5 m avg-Albedo-1.5-None-None] ERROR [ 46%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Albedo 1.5 m 0_0 avg-Albedo-1.5-0-None] ERROR [ 47%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Global Albedo Irradiation 1.5 m 0_0 avg-Global Albedo Irradiation-1.5-0-None] ERROR [ 49%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Global Tilted Irradiation 1.8 m 0_28 avg-Global Tilted Irradiation-1.76-0-28] ERROR [ 50%] tests/stationmanager/test_windog.py::test_map_windog_column_to_chpv11_01_nodes[Solar Cell Reflected Irradiation 1.5 m 0_0 avg-Solar Cell Reflected Irradiation-1.5-0-None] ERROR [ 52%] tests/stationmanager/test_windog.py::test_map_windog_column_to_nodes_raises_error_if_no_match_found[Humidity 1000.0 m avg] ERROR [ 53%] tests/stationmanager/test_windog.py::test_map_windog_column_to_nodes_raises_error_if_no_match_found[Wind Speed 65.0 m N avg] ERROR [ 54%] tests/stationmanager/test_windog.py::test_redirected_to_station_page_upon_uploading_windog_flags ERROR [ 56%] tests/stationmanager/test_windog.py::test_windog_flags_are_uploaded_to_the_flags_table[ch020_01-ch020_01_factory-ch020_01_windog_flags_txt] ERROR [ 57%] tests/stationmanager/test_windog.py::test_windog_flags_are_uploaded_to_the_flags_table[ch012_02-ch012_02_factory-ch012_02_windog_flags_tsv] ERROR [ 58%] tests/stationmanager/test_windog.py::test_cannot_upload_duplicate_windog_flags ERROR [ 60%] tests/stationmanager/test_windog.py::test_raises_error_on_uploading_a_non_supported_flag_quality[Synthesized] ERROR [ 61%] tests/stationmanager/test_windog.py::test_raises_error_on_uploading_a_non_supported_flag_quality[Tower Shading] ERROR [ 63%] tests/stationmanager/test_windog.py::test_error_raised_on_uploading_non_vanilla_flags ERROR [ 64%] tests/functional_tests.py::test_admin_user_can_login ERROR [ 65%] tests/functional_tests.py::test_select_project_via_dynatree ERROR [ 67%] tests/functional_tests.py::test_select_station_via_dynatree ERROR [ 68%] tests/functional_tests.py::test_select_station_via_map ERROR [ 69%] tests/functional_tests.py::test_download_to_windographer_button_on_wind_station ERROR [ 71%] tests/functional_tests.py::test_download_to_windographer_button_on_pv_station ERROR [ 72%] tests/functional_tests.py::test_download_project_kml ERROR [ 73%] tests/functional_tests.py::test_homepage_for_broken_links ERROR [ 75%] tests/functional_tests.py::test_stationpage_for_broken_links ERROR [ 76%] tests/functional_tests.py::test_upload_ch020_01_windog_flags ERROR [ 78%] tests/functional_tests.py::test_upload_ch008_01_windog_flags ERROR [ 79%] tests/functional_tests.py::test_user_can_save_qc_app_flags ERROR [ 80%] tests/functional_tests.py::test_user_can_sync_qc_app ERROR [ 82%] tests/functional_tests.py::test_error_message_is_raised_for_invalid_station_config ERROR [ 83%] tests/functional_tests.py::test_upload_station_excel ERROR [ 84%] tests/functional_tests.py::test_link_station_to_csv_logger ERROR [ 86%] tests/functional_tests.py::test_power_curve_tool_displays_turbine_metadata ERROR [ 87%] tests/functional_tests.py::test_power_curve_tool_compares_turbines ERROR [ 89%] tests/functional_tests.py::test_upload_power_curve_and_export_to_openwind ERROR [ 90%] tests/functional_tests.py::test_create_station ERROR [ 91%] tests/functional_tests.py::test_mrp_jv_projects_appear_on_dynatree_sidebar XFAIL [ 93%] tests/functional_tests.py::test_mrp_jv_projects_appear_on_map ERROR [ 94%] tests/functional_tests.py::test_notebook_dependencies_import PASSED [ 95%] tests/stationmanager/test_windog.py::test_parse_datetime[5/5/2020 09:05-expected0] PASSED [ 97%] tests/stationmanager/test_windog.py::test_parse_datetime[11/12/2020 15:00-expected1] PASSED [ 98%] tests/stationmanager/test_windog.py::test_parse_datetime_raises_error_on_invalid_str PASSED [100%] ==================================== ERRORS ==================================== ________ ERROR at setup of TestDatalog.test_cannot_save_duplicate_flags ________ self = def ensure_connection(self): """Guarantee that a connection to the database is established.""" if self.connection is None: with self.wrap_database_errors: > self.connect() /venv/lib/python3.7/site-packages/django/db/backends/base/base.py:217: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Connect to the database. Assume that the connection is closed.""" # Check for invalid configurations. self.check_settings() # In case the previous connection was closed while in an atomic block self.in_atomic_block = False self.savepoint_ids = [] self.needs_rollback = False # Reset parameters defining when to close the connection max_age = self.settings_dict['CONN_MAX_AGE'] self.close_at = None if max_age is None else time.time() + max_age self.closed_in_transaction = False self.errors_occurred = False # Establish the connection conn_params = self.get_connection_params() > self.connection = self.get_new_connection(conn_params) /venv/lib/python3.7/site-packages/django/db/backends/base/base.py:195: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = conn_params = {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {: , , : , ...}, 'host': 'db', ...} def get_new_connection(self, conn_params): > return Database.connect(**conn_params) /venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py:227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = () kwargs = {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {: , , : , ...}, 'host': 'db', ...} Connection = def Connect(*args, **kwargs): """Factory function for connections.Connection.""" from MySQLdb.connections import Connection > return Connection(*args, **kwargs) /venv/lib/python3.7/site-packages/MySQLdb/__init__.py:84: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_mysql.connection open to '(null)' at 0x555f96405640>, args = () kwargs = {'charset': 'utf8mb4', 'client_flag': 2, 'conv': {: , , : , ...}, 'host': 'db', ...} CLIENT = FIELD_TYPE = conversions = {: , : , : , : , ...} _bytes_or_str = ((128, ), (None, )) proxy = kwargs2 = {'charset': 'utf8mb4', 'client_flag': 196610, 'conv': {: , , : , ...}, 'host': 'db', ...} conv = {: , : , : , : , ...} conv2 = {: , : , : , : , ...} k = 245, v = def __init__(self, *args, **kwargs): """ Create a connection to the database. It is strongly recommended that you only use keyword parameters. Consult the MySQL C API documentation for more information. :param str host: host to connect :param str user: user to connect as :param str password: password to use :param str passwd: alias of password, for backward compatibility :param str database: database to use :param str db: alias of database, for backward compatibility :param int port: TCP/IP port to connect to :param str unix_socket: location of unix_socket to use :param dict conv: conversion dictionary, see MySQLdb.converters :param int connect_timeout: number of seconds to wait before the connection attempt fails. :param bool compress: if set, compression is enabled :param str named_pipe: if set, a named pipe is used to connect (Windows only) :param str init_command: command which is run once the connection is created :param str read_default_file: file from which default client values are read :param str read_default_group: configuration group to use from the default file :param type cursorclass: class object, used to create cursors (keyword only) :param bool use_unicode: If True, text-like columns are returned as unicode objects using the connection's character set. Otherwise, text-like columns are returned as bytes. Unicode objects will always be encoded to the connection's character set regardless of this setting. Default to False on Python 2 and True on Python 3 so that you can always get python `str` object by default. :param str charset: If supplied, the connection character set will be changed to this character set. On Python 2, this option changes default value of `use_unicode` option from False to True. :param str auth_plugin: If supplied, the connection default authentication plugin will be changed to this value. Example values: `mysql_native_password` or `caching_sha2_password` :param str sql_mode: If supplied, the session SQL mode will be changed to this setting. For more details and legal values, see the MySQL documentation. :param int client_flag: flags to use or 0 (see MySQL docs or constants/CLIENTS.py) :param dict ssl: dictionary or mapping contains SSL connection parameters; see the MySQL documentation for more details (mysql_ssl_set()). If this is set, and the client does not support SSL, NotSupportedError will be raised. :param bool local_infile: enables LOAD LOCAL INFILE; zero disables :param bool autocommit: If False (default), autocommit is disabled. If True, autocommit is enabled. If None, autocommit isn't set and server default is used. :param bool binary_prefix: If set, the '_binary' prefix will be used for raw byte query arguments (e.g. Binary). This is disabled by default. There are a number of undocumented, non-standard methods. See the documentation for the MySQL C API for some hints on what they do. """ from MySQLdb.constants import CLIENT, FIELD_TYPE from MySQLdb.converters import conversions, _bytes_or_str from weakref import proxy kwargs2 = kwargs.copy() if 'database' in kwargs2: kwargs2['db'] = kwargs2.pop('database') if 'password' in kwargs2: kwargs2['passwd'] = kwargs2.pop('password') if 'conv' in kwargs: conv = kwargs['conv'] else: conv = conversions conv2 = {} for k, v in conv.items(): if isinstance(k, int) and isinstance(v, list): conv2[k] = v[:] else: conv2[k] = v kwargs2['conv'] = conv2 cursorclass = kwargs2.pop('cursorclass', self.default_cursor) charset = kwargs2.get('charset', '') if charset or not PY2: use_unicode = True else: use_unicode = False use_unicode = kwargs2.pop('use_unicode', use_unicode) sql_mode = kwargs2.pop('sql_mode', '') self._binary_prefix = kwargs2.pop('binary_prefix', False) client_flag = kwargs.get('client_flag', 0) client_version = tuple([ numeric_part(n) for n in _mysql.get_client_info().split('.')[:2] ]) if client_version >= (4, 1): client_flag |= CLIENT.MULTI_STATEMENTS if client_version >= (5, 0): client_flag |= CLIENT.MULTI_RESULTS kwargs2['client_flag'] = client_flag # PEP-249 requires autocommit to be initially off autocommit = kwargs2.pop('autocommit', False) > super(Connection, self).__init__(*args, **kwargs2) E MySQLdb._exceptions.OperationalError: (2005, "Unknown MySQL server host 'db' (-3)") ```
docker-compose.test.yml ```yml version: "3.7" services: db: image: mysql volumes: - ./db:/var/lib/mysql - ./backups:/docker-entrypoint-initdb.d environment: - MYSQL_DATABASE=$MYSQL_NAME - MYSQL_USER=$MYSQL_USER - MYSQL_PASSWORD=$MYSQL_PASSWORD - MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD command: --default-authentication-plugin=mysql_native_password mssql: image: mcr.microsoft.com/mssql/server environment: - ACCEPT_EULA=Y - SA_PASSWORD=$TEST_MSSQL_PASSWORD selenium: image: selenium/standalone-chrome:4.1.0-20211123 ports: - 4444:4444 - 7900:7900 volumes: - /dev/shm:/dev/shm sut: build: context: . volumes: - .:/app environment: - CACHE_DIR - CDEC_PASSWORD - CDEC_USERNAME - DEBUG - MEDIA_ROOT - MYSQL_HOST - MYSQL_NAME - MYSQL_PASSWORD - MYSQL_USER - MYSQL_PORT - MYSQL_ROOT_PASSWORD - PDFLATEX_PATH - PLATFORM - SECRET_KEY - SESSION_COOKIE_DOMAIN - SESSION_COOKIE_NAME - STATIC_ROOT - STATION_CACHE - STOREPATH - TEST_MSSQL_DRIVER - TEST_MSSQL_HOST - TEST_MSSQL_NAME - TEST_MSSQL_PASSWORD - TEST_MSSQL_PORT - TEST_MSSQL_USER command: sh run_tests.sh depends_on: - db - mssql - selenium ```
Dockerfile ```Dockerfile # syntax = docker/dockerfile:1.4 FROM python:3.7.12-slim-buster AS base # -> PYTHONUNBUFFERED ensures that python output is sent straight to the terminal # so that we can see the output of this application (e.g. django logs) in real time # -> PATH adds the virtualenv’s bin/ directory to the start of the list of directories # which are searched for commands to run SO don't have to activate it during each RUN ENV PYTHONFAULTHANDLER=1 \ PYTHONHASHSEED=random \ PYTHONUNBUFFERED=1 \ VIRTUAL_ENV=/venv WORKDIR /app/ ENV PIP_DEFAULT_TIMEOUT=100 \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ POETRY_VERSION=1.1.12 RUN --mount=type=cache,target=/root/.cache \ pip install "poetry==$POETRY_VERSION" RUN python -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" RUN --mount=type=cache,target=/var/cache/apt \ --mount=type=cache,target=/var/lib/apt \ apt-get update && apt-get install -y wget \ && mkdir /app/wheels \ && wget -O /app/wheels/basemap-1.2.0rel.tar.gz https://github.com/matplotlib/basemap/archive/refs/tags/v1.2.0rel.tar.gz \ && rm -rf /var/lib/apt/lists/* ARG IS_PRODUCTION ENV IS_PRODUCTION=${IS_PRODUCTION} # unixodbc-dev for pyodbc # default-libmysqlclient-dev for running mysqlclient # tk-dev for running tkinter # libgeos-dev for running matplotlib-basemap # git for poetry install github+https://... # msodbcsql17 for ODBC 17 driver for SQL Server # g++ for compiling pyodbc # python3-dev, build-essential for compiling MySQL # wget for fetching matplotlib/basemap RUN --mount=type=cache,target=/var/cache/apt \ --mount=type=cache,target=/var/lib/apt \ apt-get update && apt-get install -y \ curl \ unixodbc-dev \ default-libmysqlclient-dev \ libgeos-dev \ tk-dev \ git \ g++ \ python3-dev \ build-essential \ dialog \ openssh-server \ && curl https://packages.microsoft.com/keys/microsoft.asc \ | apt-key add - \ && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17 \ && rm -rf /var/lib/apt/lists/* COPY pyproject.toml poetry.lock /app/ RUN --mount=type=cache,target=/root/.cache \ poetry install \ $(test $IS_PRODUCTION && echo '--no-dev') \ --no-interaction COPY manage.py /app/ COPY ssl/ /app/ssl/ COPY .env /app/ COPY startup.sh /app/ RUN chmod +x /app/startup.sh COPY run_tests.sh /app/ RUN chmod +x /app/run_tests.sh COPY static/ /app/static COPY templates/ /app/templates COPY EAGnet/ /app/EAGnet/ COPY dataimporter/ /app/dataimporter/ COPY stationmanager/ /app/stationmanager/ COPY mrp/ /app/mrp/ ```
Traceback Locally ```bash ❯ docker compose -f docker-compose.test.yml build sut [+] Building 7.1s (30/30) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.69kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 176B 0.0s => resolve image config for docker.io/docker/dockerfile:1.4 4.4s => [auth] docker/dockerfile:pull token for registry-1.docker.io 0.0s => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:443aab4ca211 0.0s => [internal] load build definition from Dockerfile 0.0s => [internal] load .dockerignore 0.0s => [internal] load metadata for docker.io/library/python:3.7.12-slim-buster 1.2s => [auth] library/python:pull token for registry-1.docker.io 0.0s => [base 1/19] FROM docker.io/library/python:3.7.12-slim-buster@sha256:9bb8 0.0s => [internal] load build context 0.1s => => transferring context: 404.64kB 0.0s => CACHED [base 2/19] WORKDIR /app/ 0.0s => CACHED [base 3/19] RUN --mount=type=cache,target=/root/.cache pip in 0.0s => CACHED [base 4/19] RUN python -m venv /venv 0.0s => CACHED [base 5/19] RUN --mount=type=cache,target=/var/cache/apt --mo 0.0s => CACHED [base 6/19] RUN --mount=type=cache,target=/var/cache/apt --mo 0.0s => CACHED [base 7/19] COPY pyproject.toml poetry.lock /app/ 0.0s => CACHED [base 8/19] RUN --mount=type=cache,target=/root/.cache poetry 0.0s => CACHED [base 9/19] COPY manage.py /app/ 0.0s => CACHED [base 10/19] COPY ssl/ /app/ssl/ 0.0s => CACHED [base 11/19] COPY .env /app/ 0.0s => CACHED [base 12/19] COPY startup.sh /app/ 0.0s => CACHED [base 13/19] RUN chmod +x /app/startup.sh 0.0s => [base 14/19] COPY static/ /app/static 0.1s => [base 15/19] COPY templates/ /app/templates 0.1s => [base 16/19] COPY EAGnet/ /app/EAGnet/ 0.0s => [base 17/19] COPY dataimporter/ /app/dataimporter/ 0.1s => [base 18/19] COPY stationmanager/ /app/stationmanager/ 0.1s => [base 19/19] COPY mrp/ /app/mrp/ 0.3s => exporting to image 0.5s => => exporting layers 0.4s => => writing image sha256:4ce619757ad9f3362cf08d86da9c31393c6ac2877a65c3d92 0.0s => => naming to docker.io/library/stationmanager_sut 0.0s Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them ❯ dco -f docker-compose.test.yml run --rm sut [+] Running 3/0 ⠿ Container stationmanager-selenium-1 Running 0.0s ⠿ Container stationmanager-mssql-1 Running 0.0s ⠿ Container stationmanager-db-1 Run... 0.0s 841 static files copied to '/static', 1855 post-processed. =============================== test session starts ================================ platform linux -- Python 3.7.12, pytest-6.1.2, py-1.11.0, pluggy-0.13.1 -- /venv/bin/python cachedir: .pytest_cache django: settings: EAGnet.settings (from ini) rootdir: /app, configfile: pytest.ini plugins: django-4.5.2, Faker-13.11.0, factoryboy-2.2.1, anyio-3.5.0 collected 73 items tests/test_dump.py::test_dump_station XFAIL [ 1%] tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags PASSED [ 2%] tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes PASSED [ 4%] tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes PASSED [ 5%] tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes PASSED [ 6%] tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes PASSED [ 8%] tests/stationmanager/test_models.py::TestDataFile::test_read_west_bakr_era5 PASSED [ 9%] tests/stationmanager/test_models.py::TestDataFile::test_read_taiba_tai100_dnv PASSED [ 10%] tests/stationmanager/test_models.py::TestTimezone::test_extract_offset_from_alias[GMT+01-1] PASSED [ 12%] tests/stationmanager/test_models.py::TestTimezone::test_extract_offset_from_alias[GMT-01--1] PASSED [ 13%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[UTC-0] PASSED [ 15%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[GMT+01-1] PASSED [ 16%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset[GMT-01--1] PASSED [ 17%] tests/stationmanager/test_models.py::TestTimezone::test_get_utc_offset_raises_error_on_empty_alias PASSED [ 19%] tests/stationmanager/test_views.py::test_windog_export_on_wind_station ^C ================================= warnings summary ================================= tests/test_dump.py::test_dump_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_time received a naive datetime (2018-10-01 00:00:00) while time zone support is active. RuntimeWarning) tests/test_dump.py::test_dump_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_first_timestamp received a naive datetime (2011-06-18 00:00:00) while time zone support is active. RuntimeWarning) tests/test_dump.py::test_dump_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_last_timestamp received a naive datetime (2016-08-15 00:00:00) while time zone support is active. RuntimeWarning) tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_time received a naive datetime (2022-02-02 00:00:00) while time zone support is active. RuntimeWarning) tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_first_timestamp received a naive datetime (2012-05-31 00:00:00) while time zone support is active. RuntimeWarning) tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Station.cache_last_timestamp received a naive datetime (2012-06-01 00:00:00) while time zone support is active. RuntimeWarning) tests/stationmanager/test_models.py::TestDatalog::test_cannot_save_duplicate_flags tests/stationmanager/test_models.py::TestDatalog::test_can_save_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_save_without_nodes tests/stationmanager/test_models.py::TestDatalog::test_can_overwrite_nodes tests/stationmanager/test_models.py::TestDatalog::test_raises_error_on_instantiating_with_non_sequence_nodes tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Logger.commissioned received a naive datetime (2000-01-01 00:00:00) while time zone support is active. RuntimeWarning) tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/pandas/io/sql.py:1201: SADeprecationWarning: The Engine.run_callable() method is deprecated and will be removed in a future release. Use the Engine.begin() context manager instead. (deprecated since: 1.4) schema or self.meta.schema, tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/pandas/io/sql.py:568: SADeprecationWarning: Table.tometadata() is renamed to Table.to_metadata() (deprecated since: 1.4) self.table = self.table.tometadata(self.pd_sql.meta) tests/stationmanager/test_views.py::test_windog_export_on_wind_station /venv/lib/python3.7/site-packages/pandas/io/sql.py:1182: SADeprecationWarning: The Engine.table_names() method is deprecated and will be removed in a future release. Please refer to Inspector.get_table_names(). (deprecated since: 1.4) connection=conn, -- Docs: https://docs.pytest.org/en/stable/warnings.html !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :508: KeyboardInterrupt (to show a full traceback on KeyboardInterrupt use --full-trace) ==================== 13 passed, 1 xfailed, 30 warnings in 3.44s ==================== ```

Screenshots of the issue (if applicable)

Task List

rdmolony commented 2 years ago

Nvm, this one's on me! I was passing root as a user to my MySQL which prevented it from running...