From 6a42a170e7d1c177fc46fb0cb4c51775d19f8717 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 12:38:44 +0100 Subject: [PATCH 01/14] Unify Dockerfile --- .github/workflows/build_and_push.yml | 2 +- docker/.env.example | 140 +++++++++++++++++++++++++++ docker/Dockerfile | 110 +++++++++++++++++++++ docker/docker-compose.yml | 95 ++++++++++-------- 4 files changed, 304 insertions(+), 43 deletions(-) create mode 100644 docker/.env.example create mode 100644 docker/Dockerfile diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 3c04cdb6..23cb3a36 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -96,7 +96,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: ./docker/Dockerfile.dev + file: ./docker/Dockerfile push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/.env.example b/docker/.env.example new file mode 100644 index 00000000..cfd1c6be --- /dev/null +++ b/docker/.env.example @@ -0,0 +1,140 @@ +# Dawarich Docker Compose Configuration +# Copy this file to .env and customize for your environment + +# ============================================================================= +# ENVIRONMENT CONFIGURATION +# ============================================================================= + +# Rails environment: development, staging, or production +RAILS_ENV=development + +# ============================================================================= +# DATABASE CONFIGURATION +# ============================================================================= + +# PostgreSQL credentials +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password + +# Database name - will default to dawarich_${RAILS_ENV} +# For development: dawarich_development +# For staging: dawarich_staging +# For production: dawarich_production +POSTGRES_DB=dawarich_development + +# Database connection settings (used by Rails app) +DATABASE_HOST=dawarich_db +DATABASE_PORT=5432 +DATABASE_USERNAME=postgres +DATABASE_PASSWORD=password +DATABASE_NAME=dawarich_development + +# ============================================================================= +# REDIS CONFIGURATION +# ============================================================================= + +# Redis connection URL +REDIS_URL=redis://dawarich_redis:6379 + +# ============================================================================= +# APPLICATION SETTINGS +# ============================================================================= + +# Port to expose the application on +DAWARICH_APP_PORT=3000 + +# Application hosts (comma-separated) +# Development: localhost +# Production: your-domain.com,www.your-domain.com +APPLICATION_HOSTS=localhost,::1,127.0.0.1 + +# Application protocol (http or https) +APPLICATION_PROTOCOL=http + +# Time zone +TIME_ZONE=Europe/London + +# Minimum minutes spent in city for statistics +MIN_MINUTES_SPENT_IN_CITY=60 + +# Self-hosted flag (true for docker deployments) +SELF_HOSTED=true + +# Store geodata (reverse geocoding results) +STORE_GEODATA=true + +# ============================================================================= +# SECURITY +# ============================================================================= + +# Secret key base for production/staging +# Generate with: openssl rand -hex 64 +# Leave empty for development (will auto-generate) +SECRET_KEY_BASE= + +# ============================================================================= +# BACKGROUND JOBS +# ============================================================================= + +# Sidekiq concurrency (number of threads) +BACKGROUND_PROCESSING_CONCURRENCY=10 + +# ============================================================================= +# MONITORING & LOGGING +# ============================================================================= + +# Prometheus exporter settings +PROMETHEUS_EXPORTER_ENABLED=false +PROMETHEUS_EXPORTER_HOST=0.0.0.0 +PROMETHEUS_EXPORTER_PORT=9394 +PROMETHEUS_EXPORTER_HOST_SIDEKIQ=dawarich_app + +# Uncomment to expose Prometheus port +# PROMETHEUS_PORT=9394 + +# Rails logging +RAILS_LOG_TO_STDOUT=true + +# Docker logging settings +LOG_MAX_SIZE=100m +LOG_MAX_FILE=5 + +# ============================================================================= +# RESOURCE LIMITS +# ============================================================================= + +# CPU and memory limits for the app container +APP_CPU_LIMIT=0.50 +APP_MEMORY_LIMIT=4G + +# ============================================================================= +# EXAMPLE CONFIGURATIONS BY ENVIRONMENT +# ============================================================================= + +# --- DEVELOPMENT --- +# RAILS_ENV=development +# POSTGRES_DB=dawarich_development +# DATABASE_NAME=dawarich_development +# APPLICATION_HOSTS=localhost,::1,127.0.0.1 +# APPLICATION_PROTOCOL=http +# SECRET_KEY_BASE= +# SELF_HOSTED=true + +# --- STAGING --- +# RAILS_ENV=staging +# POSTGRES_DB=dawarich_staging +# DATABASE_NAME=dawarich_staging +# APPLICATION_HOSTS=staging.example.com +# APPLICATION_PROTOCOL=https +# SECRET_KEY_BASE=your-generated-secret-key +# SELF_HOSTED=true + +# --- PRODUCTION --- +# RAILS_ENV=production +# POSTGRES_DB=dawarich_production +# DATABASE_NAME=dawarich_production +# APPLICATION_HOSTS=dawarich.example.com,www.dawarich.example.com +# APPLICATION_PROTOCOL=https +# SECRET_KEY_BASE=your-generated-secret-key +# SELF_HOSTED=true +# PROMETHEUS_EXPORTER_ENABLED=true diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..774129a1 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,110 @@ +FROM ruby:3.4.6-slim + +ARG RAILS_ENV=production + +ENV APP_PATH=/var/app +ENV BUNDLE_VERSION=2.5.21 +ENV BUNDLE_PATH=/usr/local/bundle/gems +ENV RAILS_LOG_TO_STDOUT=true +ENV RAILS_PORT=3000 +ENV RAILS_ENV=${RAILS_ENV} + +# Development-specific environment variables +RUN if [ "$RAILS_ENV" = "development" ]; then \ + echo "export SELF_HOSTED=true" >> /etc/profile.d/rails.sh && \ + echo "export SIDEKIQ_USERNAME=sidekiq" >> /etc/profile.d/rails.sh && \ + echo "export SIDEKIQ_PASSWORD=password" >> /etc/profile.d/rails.sh && \ + echo "export PGSSENCMODE=disable" >> /etc/profile.d/rails.sh; \ + fi + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + curl \ + wget \ + build-essential \ + git \ + postgresql-client \ + libpq-dev \ + libxml2-dev \ + libxslt-dev \ + libyaml-dev \ + libgeos-dev libgeos++-dev \ + imagemagick \ + tzdata \ + less \ + libjemalloc2 libjemalloc-dev \ + cmake \ + ca-certificates \ + && mkdir -p $APP_PATH \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js with architecture-specific logic for development +# For production/staging, use LTS version +RUN if [ "$RAILS_ENV" = "development" ]; then \ + ARCH=$(dpkg --print-architecture) && \ + if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ]; then \ + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ + apt-get install -y nodejs; \ + else \ + apt-get update && \ + apt-get install -y nodejs npm; \ + fi; \ + else \ + curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ + apt-get install -y nodejs; \ + fi && \ + npm install -g yarn && \ + rm -rf /var/lib/apt/lists/* + +# Use jemalloc with check for architecture +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + echo "/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ + else \ + echo "/usr/lib/aarch64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ + fi + +# Enable YJIT +ENV RUBY_YJIT_ENABLE=1 + +# Update RubyGems and install Bundler +RUN gem update --system 3.6.9 \ + && gem install bundler --version "$BUNDLE_VERSION" \ + && rm -rf $GEM_HOME/cache/* + +WORKDIR $APP_PATH + +COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./ + +# Install gems based on environment +RUN bundle config set --local path 'vendor/bundle' \ + && if [ "$RAILS_ENV" = "production" ] || [ "$RAILS_ENV" = "staging" ]; then \ + bundle config set --local without 'development test' && \ + bundle install --jobs 4 --retry 3; \ + else \ + bundle install --jobs 4 --retry 3; \ + fi \ + && rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem + +COPY ../. ./ + +# Precompile assets for production/staging +RUN if [ "$RAILS_ENV" = "production" ] || [ "$RAILS_ENV" = "staging" ]; then \ + SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile && \ + rm -rf node_modules tmp/cache; \ + fi + +# Create caching-dev.txt file for development +RUN if [ "$RAILS_ENV" = "development" ]; then \ + mkdir -p $APP_PATH/tmp && touch $APP_PATH/tmp/caching-dev.txt; \ + fi + +COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh +RUN chmod +x /usr/local/bin/web-entrypoint.sh + +COPY ./docker/sidekiq-entrypoint.sh /usr/local/bin/sidekiq-entrypoint.sh +RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh + +EXPOSE $RAILS_PORT + +ENTRYPOINT ["bundle", "exec"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ca0fb27c..9154bff5 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,6 @@ networks: dawarich: + services: dawarich_redis: image: redis:7.4-alpine @@ -8,7 +9,7 @@ services: networks: - dawarich volumes: - - dawarich_shared:/data + - dawarich_redis_data:/data restart: always healthcheck: test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] @@ -16,6 +17,7 @@ services: retries: 5 start_period: 30s timeout: 10s + dawarich_db: image: postgis/postgis:17-3.5-alpine shm_size: 1G @@ -27,17 +29,18 @@ services: networks: - dawarich environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: dawarich_development + POSTGRES_USER: ${POSTGRES_USER:-postgres} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} + POSTGRES_DB: ${POSTGRES_DB:-dawarich_development} restart: always healthcheck: - test: [ "CMD-SHELL", "pg_isready -U postgres -d dawarich_development" ] + test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-dawarich_development}" ] interval: 10s retries: 5 start_period: 30s timeout: 10s # command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config, uncomment if you want to use a custom config + dawarich_app: image: freikin/dawarich:latest container_name: dawarich_app @@ -49,34 +52,37 @@ services: networks: - dawarich ports: - - 3000:3000 - # - 9394:9394 # Prometheus exporter, uncomment if needed + - "${DAWARICH_APP_PORT:-3000}:3000" + # - "${PROMETHEUS_PORT:-9394}:9394" # Prometheus exporter, uncomment if needed stdin_open: true tty: true entrypoint: web-entrypoint.sh command: ['bin/rails', 'server', '-p', '3000', '-b', '::'] restart: on-failure environment: - RAILS_ENV: development - REDIS_URL: redis://dawarich_redis:6379 - DATABASE_HOST: dawarich_db - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_development - MIN_MINUTES_SPENT_IN_CITY: 60 - APPLICATION_HOSTS: localhost - TIME_ZONE: Europe/London - APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: "false" - PROMETHEUS_EXPORTER_HOST: 0.0.0.0 - PROMETHEUS_EXPORTER_PORT: 9394 - SELF_HOSTED: "true" - STORE_GEODATA: "true" + RAILS_ENV: ${RAILS_ENV:-development} + REDIS_URL: ${REDIS_URL:-redis://dawarich_redis:6379} + DATABASE_HOST: ${DATABASE_HOST:-dawarich_db} + DATABASE_PORT: ${DATABASE_PORT:-5432} + DATABASE_USERNAME: ${DATABASE_USERNAME:-postgres} + DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password} + DATABASE_NAME: ${DATABASE_NAME:-dawarich_development} + MIN_MINUTES_SPENT_IN_CITY: ${MIN_MINUTES_SPENT_IN_CITY:-60} + APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} + TIME_ZONE: ${TIME_ZONE:-Europe/London} + APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false} + PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST:-0.0.0.0} + PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} + SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} + RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true} + SELF_HOSTED: ${SELF_HOSTED:-true} + STORE_GEODATA: ${STORE_GEODATA:-true} logging: driver: "json-file" options: - max-size: "100m" - max-file: "5" + max-size: ${LOG_MAX_SIZE:-100m} + max-file: ${LOG_MAX_FILE:-5} healthcheck: test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ] interval: 10s @@ -93,8 +99,9 @@ services: deploy: resources: limits: - cpus: '0.50' # Limit CPU usage to 50% of one core - memory: '4G' # Limit memory usage to 4GB + cpus: ${APP_CPU_LIMIT:-0.50} + memory: ${APP_MEMORY_LIMIT:-4G} + dawarich_sidekiq: image: freikin/dawarich:latest container_name: dawarich_sidekiq @@ -110,25 +117,28 @@ services: command: ['sidekiq'] restart: on-failure environment: - RAILS_ENV: development - REDIS_URL: redis://dawarich_redis:6379 - DATABASE_HOST: dawarich_db - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_development - APPLICATION_HOSTS: localhost - BACKGROUND_PROCESSING_CONCURRENCY: 10 - APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: "false" - PROMETHEUS_EXPORTER_HOST: dawarich_app - PROMETHEUS_EXPORTER_PORT: 9394 - SELF_HOSTED: "true" - STORE_GEODATA: "true" + RAILS_ENV: ${RAILS_ENV:-development} + REDIS_URL: ${REDIS_URL:-redis://dawarich_redis:6379} + DATABASE_HOST: ${DATABASE_HOST:-dawarich_db} + DATABASE_PORT: ${DATABASE_PORT:-5432} + DATABASE_USERNAME: ${DATABASE_USERNAME:-postgres} + DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password} + DATABASE_NAME: ${DATABASE_NAME:-dawarich_development} + APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} + BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY:-10} + APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false} + PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST_SIDEKIQ:-dawarich_app} + PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} + SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} + RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true} + SELF_HOSTED: ${SELF_HOSTED:-true} + STORE_GEODATA: ${STORE_GEODATA:-true} logging: driver: "json-file" options: - max-size: "100m" - max-file: "5" + max-size: ${LOG_MAX_SIZE:-100m} + max-file: ${LOG_MAX_FILE:-5} healthcheck: test: [ "CMD-SHELL", "pgrep -f sidekiq" ] interval: 10s @@ -148,6 +158,7 @@ services: volumes: dawarich_db_data: + dawarich_redis_data: dawarich_shared: dawarich_public: dawarich_watched: From f9f013c6281b46d61374d8445e4eabe1860493d5 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 12:45:28 +0100 Subject: [PATCH 02/14] Remove development-specific logic from Dockerfile --- docker/Dockerfile | 48 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 774129a1..9b42a8d4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,14 +9,6 @@ ENV RAILS_LOG_TO_STDOUT=true ENV RAILS_PORT=3000 ENV RAILS_ENV=${RAILS_ENV} -# Development-specific environment variables -RUN if [ "$RAILS_ENV" = "development" ]; then \ - echo "export SELF_HOSTED=true" >> /etc/profile.d/rails.sh && \ - echo "export SIDEKIQ_USERNAME=sidekiq" >> /etc/profile.d/rails.sh && \ - echo "export SIDEKIQ_PASSWORD=password" >> /etc/profile.d/rails.sh && \ - echo "export PGSSENCMODE=disable" >> /etc/profile.d/rails.sh; \ - fi - RUN apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ @@ -41,18 +33,13 @@ RUN apt-get update -qq \ # Install Node.js with architecture-specific logic for development # For production/staging, use LTS version -RUN if [ "$RAILS_ENV" = "development" ]; then \ - ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ]; then \ - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ - apt-get install -y nodejs; \ - else \ - apt-get update && \ - apt-get install -y nodejs npm; \ - fi; \ - else \ - curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ +RUN ARCH=$(dpkg --print-architecture) && \ + if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ]; then \ + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ apt-get install -y nodejs; \ + else \ + apt-get update && \ + apt-get install -y nodejs npm; \ fi && \ npm install -g yarn && \ rm -rf /var/lib/apt/lists/* @@ -77,27 +64,16 @@ WORKDIR $APP_PATH COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./ # Install gems based on environment -RUN bundle config set --local path 'vendor/bundle' \ - && if [ "$RAILS_ENV" = "production" ] || [ "$RAILS_ENV" = "staging" ]; then \ - bundle config set --local without 'development test' && \ - bundle install --jobs 4 --retry 3; \ - else \ - bundle install --jobs 4 --retry 3; \ - fi \ - && rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem +RUN bundle config set --local path 'vendor/bundle' && \ + bundle config set --local without 'development test' && \ + bundle install --jobs 4 --retry 3 && \ + rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem COPY ../. ./ # Precompile assets for production/staging -RUN if [ "$RAILS_ENV" = "production" ] || [ "$RAILS_ENV" = "staging" ]; then \ - SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile && \ - rm -rf node_modules tmp/cache; \ - fi - -# Create caching-dev.txt file for development -RUN if [ "$RAILS_ENV" = "development" ]; then \ - mkdir -p $APP_PATH/tmp && touch $APP_PATH/tmp/caching-dev.txt; \ - fi +RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile && \ + rm -rf node_modules tmp/cache COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh RUN chmod +x /usr/local/bin/web-entrypoint.sh From 8444ee461df97306eca4cd5c0c45fa3960d9daa5 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 14:05:46 +0100 Subject: [PATCH 03/14] Update Dockerfile --- docker/Dockerfile | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b42a8d4..16596609 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,7 +7,6 @@ ENV BUNDLE_VERSION=2.5.21 ENV BUNDLE_PATH=/usr/local/bundle/gems ENV RAILS_LOG_TO_STDOUT=true ENV RAILS_PORT=3000 -ENV RAILS_ENV=${RAILS_ENV} RUN apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \ @@ -31,18 +30,11 @@ RUN apt-get update -qq \ && mkdir -p $APP_PATH \ && rm -rf /var/lib/apt/lists/* -# Install Node.js with architecture-specific logic for development -# For production/staging, use LTS version -RUN ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ]; then \ - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ - apt-get install -y nodejs; \ - else \ - apt-get update && \ - apt-get install -y nodejs npm; \ - fi && \ - npm install -g yarn && \ - rm -rf /var/lib/apt/lists/* +# Install Node.js LTS for production/staging +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g yarn \ + && rm -rf /var/lib/apt/lists/* # Use jemalloc with check for architecture RUN if [ "$(uname -m)" = "x86_64" ]; then \ @@ -63,18 +55,19 @@ WORKDIR $APP_PATH COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./ -# Install gems based on environment -RUN bundle config set --local path 'vendor/bundle' && \ - bundle config set --local without 'development test' && \ - bundle install --jobs 4 --retry 3 && \ - rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem +# Install production gems only +RUN bundle config set --local path 'vendor/bundle' \ + && bundle config set --local without 'development test' \ + && bundle install --jobs 4 --retry 3 \ + && rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem COPY ../. ./ -# Precompile assets for production/staging -RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile && \ - rm -rf node_modules tmp/cache +# Precompile assets +RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile \ + && rm -rf node_modules tmp/cache +# Copy entrypoint scripts and grant execution permissions COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh RUN chmod +x /usr/local/bin/web-entrypoint.sh @@ -83,4 +76,4 @@ RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh EXPOSE $RAILS_PORT -ENTRYPOINT ["bundle", "exec"] +ENTRYPOINT [ "bundle", "exec" ] From fa8cbed15b239aef7e9a11d4c7a019c587110cd1 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 14:08:01 +0100 Subject: [PATCH 04/14] Use strings for booleans --- docker/docker-compose.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9154bff5..e413aee2 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -9,7 +9,7 @@ services: networks: - dawarich volumes: - - dawarich_redis_data:/data + - dawarich_shared:/data restart: always healthcheck: test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] @@ -71,13 +71,13 @@ services: APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} TIME_ZONE: ${TIME_ZONE:-Europe/London} APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} - PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"} PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST:-0.0.0.0} PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} - RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true} - SELF_HOSTED: ${SELF_HOSTED:-true} - STORE_GEODATA: ${STORE_GEODATA:-true} + RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-"true"} + SELF_HOSTED: ${SELF_HOSTED:-"true"} + STORE_GEODATA: ${STORE_GEODATA:-"true"} logging: driver: "json-file" options: @@ -127,13 +127,13 @@ services: APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY:-10} APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} - PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"} PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST_SIDEKIQ:-dawarich_app} PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} - RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true} - SELF_HOSTED: ${SELF_HOSTED:-true} - STORE_GEODATA: ${STORE_GEODATA:-true} + RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-"true"} + SELF_HOSTED: ${SELF_HOSTED:-"true"} + STORE_GEODATA: ${STORE_GEODATA:-"true"} logging: driver: "json-file" options: @@ -158,7 +158,6 @@ services: volumes: dawarich_db_data: - dawarich_redis_data: dawarich_shared: dawarich_public: dawarich_watched: From b469836d197c35f945689aebddebb0c4bb574668 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 14:08:49 +0100 Subject: [PATCH 05/14] Remove dockerfiles that are no longer needed after consolidating into a single Dockerfile. --- docker/Dockerfile.dev | 87 --------------- docker/Dockerfile.prod | 74 ------------- docker/docker-compose.production.yml | 154 --------------------------- 3 files changed, 315 deletions(-) delete mode 100644 docker/Dockerfile.dev delete mode 100644 docker/Dockerfile.prod delete mode 100644 docker/docker-compose.production.yml diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev deleted file mode 100644 index 77553008..00000000 --- a/docker/Dockerfile.dev +++ /dev/null @@ -1,87 +0,0 @@ -FROM ruby:3.4.6-slim - -ENV APP_PATH=/var/app -ENV BUNDLE_VERSION=2.5.21 -ENV BUNDLE_PATH=/usr/local/bundle/gems -ENV RAILS_LOG_TO_STDOUT=true -ENV RAILS_PORT=3000 -ENV RAILS_ENV=development -ENV SELF_HOSTED=true -ENV SIDEKIQ_USERNAME=sidekiq -ENV SIDEKIQ_PASSWORD=password -# Resolving sqlite3 error -ENV PGSSENCMODE=disable - -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - curl \ - wget \ - build-essential \ - git \ - postgresql-client \ - libpq-dev \ - libxml2-dev \ - libxslt-dev \ - libyaml-dev \ - libgeos-dev libgeos++-dev \ - imagemagick \ - tzdata \ - less \ - libjemalloc2 libjemalloc-dev \ - cmake \ - ca-certificates \ - && mkdir -p $APP_PATH \ - && rm -rf /var/lib/apt/lists/* - -# Install Node.js using official NodeSource script -# NodeSource supports: amd64, arm64, armhf (arm/v7) -# For unsupported architectures, fall back to Debian's nodejs package -RUN ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ] || [ "$ARCH" = "armhf" ]; then \ - curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ - apt-get install -y nodejs; \ - else \ - apt-get update && \ - apt-get install -y nodejs npm; \ - fi && \ - npm install -g yarn && \ - rm -rf /var/lib/apt/lists/* - -# Use jemalloc with check for architecture -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - echo "/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ - else \ - echo "/usr/lib/aarch64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ - fi - -# Optional: Set YJIT explicitly (enabled by default in 3.4.1 MRI builds) -ENV RUBY_YJIT_ENABLE=1 - -# Update RubyGems and install Bundler -RUN gem update --system 3.6.9 \ - && gem install bundler --version "$BUNDLE_VERSION" \ - && rm -rf $GEM_HOME/cache/* - -WORKDIR $APP_PATH - -COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./ - -RUN bundle config set --local path 'vendor/bundle' \ - && bundle install --jobs 4 --retry 3 \ - && rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem - -COPY ../. ./ - -# Create caching-dev.txt file to enable Rails caching in development -RUN mkdir -p $APP_PATH/tmp && touch $APP_PATH/tmp/caching-dev.txt - -COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh -RUN chmod +x /usr/local/bin/web-entrypoint.sh - -COPY ./docker/sidekiq-entrypoint.sh /usr/local/bin/sidekiq-entrypoint.sh -RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh - -EXPOSE $RAILS_PORT - -ENTRYPOINT ["bundle", "exec"] diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod deleted file mode 100644 index 29279c81..00000000 --- a/docker/Dockerfile.prod +++ /dev/null @@ -1,74 +0,0 @@ -FROM ruby:3.4.6-slim - -ENV APP_PATH=/var/app -ENV BUNDLE_VERSION=2.5.21 -ENV BUNDLE_PATH=/usr/local/bundle/gems -ENV RAILS_LOG_TO_STDOUT=true -ENV RAILS_PORT=3000 -ENV RAILS_ENV=production - -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - curl \ - wget \ - build-essential \ - git \ - postgresql-client \ - libpq-dev \ - libxml2-dev \ - libxslt-dev \ - libyaml-dev \ - libgeos-dev libgeos++-dev \ - imagemagick \ - tzdata \ - less \ - libjemalloc2 libjemalloc-dev \ - cmake \ - && curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ - && apt-get install -y nodejs \ - && npm install -g yarn \ - && mkdir -p $APP_PATH \ - && rm -rf /var/lib/apt/lists/* - -# Use jemalloc with check for architecture -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - echo "/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ - else \ - echo "/usr/lib/aarch64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload; \ - fi - -# Enable YJIT -ENV RUBY_YJIT_ENABLE=1 - -# Update gem system and install bundler -RUN gem update --system 3.6.9 \ - && gem install bundler --version "$BUNDLE_VERSION" \ - && rm -rf $GEM_HOME/cache/* - -WORKDIR $APP_PATH - -COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./ - -# Install production gems only -RUN bundle config set --local path 'vendor/bundle' \ - && bundle config set --local without 'development test' \ - && bundle install --jobs 4 --retry 3 \ - && rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem - -COPY ../. ./ - -# Precompile assets for production -RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rake assets:precompile \ - && rm -rf node_modules tmp/cache - -# Copy entrypoint scripts and grant execution permissions -COPY ./docker/web-entrypoint.sh /usr/local/bin/web-entrypoint.sh -RUN chmod +x /usr/local/bin/web-entrypoint.sh - -COPY ./docker/sidekiq-entrypoint.sh /usr/local/bin/sidekiq-entrypoint.sh -RUN chmod +x /usr/local/bin/sidekiq-entrypoint.sh - -EXPOSE $RAILS_PORT - -ENTRYPOINT [ "bundle", "exec" ] diff --git a/docker/docker-compose.production.yml b/docker/docker-compose.production.yml deleted file mode 100644 index 608a916e..00000000 --- a/docker/docker-compose.production.yml +++ /dev/null @@ -1,154 +0,0 @@ -networks: - dawarich: -services: - dawarich_redis: - image: redis:7.4-alpine - container_name: dawarich_redis - command: redis-server - networks: - - dawarich - volumes: - - dawarich_redis_data:/data - restart: always - healthcheck: - test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] - interval: 10s - retries: 5 - start_period: 30s - timeout: 10s - dawarich_db: - image: postgis/postgis:17-3.5-alpine - shm_size: 1G - container_name: dawarich_db - volumes: - - dawarich_db_data:/var/lib/postgresql/data - networks: - - dawarich - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: dawarich_production - restart: always - healthcheck: - test: [ "CMD", "pg_isready", "-U", "postgres" ] - interval: 10s - retries: 5 - start_period: 30s - timeout: 10s - dawarich_app: - image: dawarich:prod - container_name: dawarich_app - volumes: - - dawarich_public:/var/app/public - - dawarich_watched:/var/app/tmp/imports/watched - - dawarich_storage:/var/app/storage - - dawarich_db_data:/dawarich_db_data - networks: - - dawarich - ports: - - 3000:3000 - # - 9394:9394 # Prometheus exporter, uncomment if needed - stdin_open: true - tty: true - entrypoint: web-entrypoint.sh - command: ['bin/rails', 'server', '-p', '3000', '-b', '::'] - restart: on-failure - environment: - RAILS_ENV: production - REDIS_URL: redis://dawarich_redis:6379 - DATABASE_HOST: dawarich_db - DATABASE_PORT: 5432 - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_production - MIN_MINUTES_SPENT_IN_CITY: 60 - APPLICATION_HOSTS: localhost,::1,127.0.0.1 - TIME_ZONE: Europe/London - APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: false - PROMETHEUS_EXPORTER_HOST: 0.0.0.0 - PROMETHEUS_EXPORTER_PORT: 9394 - SECRET_KEY_BASE: 1234567890 - RAILS_LOG_TO_STDOUT: "true" - STORE_GEODATA: "true" - logging: - driver: "json-file" - options: - max-size: "100m" - max-file: "5" - healthcheck: - test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ] - interval: 10s - retries: 30 - start_period: 30s - timeout: 10s - depends_on: - dawarich_db: - condition: service_healthy - restart: true - dawarich_redis: - condition: service_healthy - restart: true - deploy: - resources: - limits: - cpus: '0.50' # Limit CPU usage to 50% of one core - memory: '4G' # Limit memory usage to 2GB - dawarich_sidekiq: - image: dawarich:prod - container_name: dawarich_sidekiq - volumes: - - dawarich_public:/var/app/public - - dawarich_watched:/var/app/tmp/imports/watched - - dawarich_storage:/var/app/storage - networks: - - dawarich - stdin_open: true - tty: true - entrypoint: sidekiq-entrypoint.sh - command: ['bundle', 'exec', 'sidekiq'] - restart: on-failure - environment: - RAILS_ENV: production - REDIS_URL: redis://dawarich_redis:6379 - DATABASE_HOST: dawarich_db - DATABASE_PORT: 5432 - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_NAME: dawarich_production - APPLICATION_HOSTS: localhost,::1,127.0.0.1 - BACKGROUND_PROCESSING_CONCURRENCY: 10 - APPLICATION_PROTOCOL: http - PROMETHEUS_EXPORTER_ENABLED: false - PROMETHEUS_EXPORTER_HOST: dawarich_app - PROMETHEUS_EXPORTER_PORT: 9394 - SECRET_KEY_BASE: 1234567890 - RAILS_LOG_TO_STDOUT: "true" - STORE_GEODATA: "true" - logging: - driver: "json-file" - options: - max-size: "100m" - max-file: "5" - healthcheck: - test: [ "CMD-SHELL", "pgrep -f sidekiq" ] - interval: 10s - retries: 30 - start_period: 30s - timeout: 10s - depends_on: - dawarich_db: - condition: service_healthy - restart: true - dawarich_redis: - condition: service_healthy - restart: true - dawarich_app: - condition: service_healthy - restart: true -volumes: - dawarich_db_data: - dawarich_redis_data: - dawarich_public: - dawarich_watched: - dawarich_storage: From cb9fb9911ce5079a3b002ca6f22073e6b2a2804e Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 14:15:16 +0100 Subject: [PATCH 06/14] Add default REDIS_URL value to cable.yml --- config/cable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cable.yml b/config/cable.yml index e5713aea..08d639f8 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,6 +1,6 @@ default: &default adapter: redis - url: <%= "#{ENV.fetch("REDIS_URL")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %> + url: <%= "#{ENV.fetch("REDIS_URL", "redis://localhost:6379")}/#{ENV.fetch('RAILS_WS_DB', 2)}" %> development: <<: *default From f9d5762533ba26502eb536c7cc87e921da2de66e Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 19:19:29 +0100 Subject: [PATCH 07/14] Update migrations to validate foreign keys immediately upon creation. --- CHANGELOG.md | 3 +++ db/migrate/20250926220114_create_families.rb | 2 +- .../20250926220135_create_family_memberships.rb | 4 ++-- .../20250926220158_create_family_invitations.rb | 4 ++-- .../20250926220345_validate_family_foreign_keys.rb | 11 ++++++----- docker/docker-compose.yml | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 936c14ca..dd661d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed useless system tests and cover map functionality with Playwright e2e tests instead. - Number of family members on self-hosted instances is no longer limited. - Export to GPX now adds adds speed and course to each point if they are available. +- Single Dockerfile introduced so Dawarich could be run in self-hosted mode in production environment. + - [ ] Check if with no changes to docker-compose.yml everything still works as before. + - [ ] Deploy to Staging and test again. # [0.34.2] - 2025-10-31 diff --git a/db/migrate/20250926220114_create_families.rb b/db/migrate/20250926220114_create_families.rb index cbaeaf25..72098b9f 100644 --- a/db/migrate/20250926220114_create_families.rb +++ b/db/migrate/20250926220114_create_families.rb @@ -8,7 +8,7 @@ class CreateFamilies < ActiveRecord::Migration[8.0] t.timestamps end - add_foreign_key :families, :users, column: :creator_id, validate: false + add_foreign_key :families, :users, column: :creator_id add_index :families, :creator_id end end diff --git a/db/migrate/20250926220135_create_family_memberships.rb b/db/migrate/20250926220135_create_family_memberships.rb index fa8e051a..90f53947 100644 --- a/db/migrate/20250926220135_create_family_memberships.rb +++ b/db/migrate/20250926220135_create_family_memberships.rb @@ -9,8 +9,8 @@ class CreateFamilyMemberships < ActiveRecord::Migration[8.0] t.timestamps end - add_foreign_key :family_memberships, :families, validate: false - add_foreign_key :family_memberships, :users, validate: false + add_foreign_key :family_memberships, :families + add_foreign_key :family_memberships, :users add_index :family_memberships, :user_id, unique: true # One family per user add_index :family_memberships, %i[family_id role], name: 'index_family_memberships_on_family_and_role' end diff --git a/db/migrate/20250926220158_create_family_invitations.rb b/db/migrate/20250926220158_create_family_invitations.rb index be841652..b9279a5f 100644 --- a/db/migrate/20250926220158_create_family_invitations.rb +++ b/db/migrate/20250926220158_create_family_invitations.rb @@ -12,8 +12,8 @@ class CreateFamilyInvitations < ActiveRecord::Migration[8.0] t.timestamps end - add_foreign_key :family_invitations, :families, validate: false - add_foreign_key :family_invitations, :users, column: :invited_by_id, validate: false + add_foreign_key :family_invitations, :families + add_foreign_key :family_invitations, :users, column: :invited_by_id add_index :family_invitations, :token, unique: true add_index :family_invitations, %i[family_id email], name: 'index_family_invitations_on_family_id_and_email' add_index :family_invitations, %i[family_id status expires_at], diff --git a/db/migrate/20250926220345_validate_family_foreign_keys.rb b/db/migrate/20250926220345_validate_family_foreign_keys.rb index 45461b79..d0161227 100644 --- a/db/migrate/20250926220345_validate_family_foreign_keys.rb +++ b/db/migrate/20250926220345_validate_family_foreign_keys.rb @@ -1,9 +1,10 @@ class ValidateFamilyForeignKeys < ActiveRecord::Migration[8.0] def change - validate_foreign_key :families, :users - validate_foreign_key :family_memberships, :families - validate_foreign_key :family_memberships, :users - validate_foreign_key :family_invitations, :families - validate_foreign_key :family_invitations, :users + # No longer needed - foreign keys are now validated immediately in their creation migrations + # validate_foreign_key :families, :users + # validate_foreign_key :family_memberships, :families + # validate_foreign_key :family_memberships, :users + # validate_foreign_key :family_invitations, :families + # validate_foreign_key :family_invitations, :users end end diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e413aee2..bc9d0e94 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -71,7 +71,7 @@ services: APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} TIME_ZONE: ${TIME_ZONE:-Europe/London} APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} - PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-"false"} PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST:-0.0.0.0} PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} @@ -127,7 +127,7 @@ services: APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1} BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY:-10} APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http} - PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"} + PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-"false"} PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST_SIDEKIQ:-dawarich_app} PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394} SECRET_KEY_BASE: ${SECRET_KEY_BASE:-} From 691ff63b8796a06681e36e454e54403300d54d39 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 20:02:51 +0100 Subject: [PATCH 08/14] Update strong_migrations config --- .app_version | 2 +- config/initializers/strong_migrations.rb | 3 +- temp..log | 302 +++++++++++++++++++++++ 3 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 temp..log diff --git a/.app_version b/.app_version index 3f8003cd..0aeaf413 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.34.2 +0.34.3 diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index ec978211..cd1181d2 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -3,7 +3,8 @@ StrongMigrations.start_after = 20_250_122_150_500 # Set timeouts for migrations # If you use PgBouncer in transaction mode, delete these lines and set timeouts on the database user -StrongMigrations.lock_timeout = 10.seconds +# Disable lock timeout in production/staging to avoid connection issues +StrongMigrations.lock_timeout = Rails.env.development? || Rails.env.test? ? 10.seconds : nil StrongMigrations.statement_timeout = 1.hour # Analyze tables after indexes are added diff --git a/temp..log b/temp..log new file mode 100644 index 00000000..7fbb6789 --- /dev/null +++ b/temp..log @@ -0,0 +1,302 @@ +dokku run dawarich rails db:migrate +[dotenv] Loaded .env +E, [2025-11-07T18:56:36.037575 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:36.540304 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:37.048717 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:37.554386 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:38.057240 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:38.560002 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +E, [2025-11-07T18:56:39.062596 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +Migrating to AddUtmParametersToUsers (20251030190924) +== 20251030190924 AddUtmParametersToUsers: migrating ========================== +E, [2025-11-07T18:56:39.565841 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known +-- add_column(:users, :utm_source, :string) +bin/rails aborted! +StandardError: An error has occurred, this and all later migrations canceled: (StandardError) + +PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' +/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' +/app/bin/rails:4:in '
' + +Caused by: +ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block (ActiveRecord::StatementInvalid) +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' +/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' +/app/bin/rails:4:in '
' + +Caused by: +PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block (PG::InFailedSqlTransaction) +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' +/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' +/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' +/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' +/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' +/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' +/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' +/app/bin/rails:4:in '
' +Tasks: TOP => db:migrate +(See full trace by running task with --trace) +root@dawarich-staging:~# From b272c7407fd628c5c3efbb32601b07d255a30f50 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 20:09:29 +0100 Subject: [PATCH 09/14] Update strong_migrations config --- config/initializers/strong_migrations.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index cd1181d2..98558624 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -2,10 +2,10 @@ StrongMigrations.start_after = 20_250_122_150_500 # Set timeouts for migrations -# If you use PgBouncer in transaction mode, delete these lines and set timeouts on the database user -# Disable lock timeout in production/staging to avoid connection issues -StrongMigrations.lock_timeout = Rails.env.development? || Rails.env.test? ? 10.seconds : nil -StrongMigrations.statement_timeout = 1.hour +# PgBouncer in transaction mode doesn't support SET commands +# Timeouts should be set on the database user instead +# StrongMigrations.lock_timeout = 10.seconds +# StrongMigrations.statement_timeout = 1.hour # Analyze tables after indexes are added # Outdated statistics can sometimes hurt performance From f48a512b10b18f4c42c16d582c95ed804b029505 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 20:18:56 +0100 Subject: [PATCH 10/14] Remove strong_migrations gem for now --- Gemfile | 2 +- Gemfile.lock | 3 -- config/initializers/strong_migrations.rb | 44 ++++++++++++------------ 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Gemfile b/Gemfile index 16c57028..469f65db 100644 --- a/Gemfile +++ b/Gemfile @@ -48,7 +48,7 @@ gem 'sidekiq-limit_fetch' gem 'sprockets-rails' gem 'stackprof' gem 'stimulus-rails' -gem 'strong_migrations', '>= 2.4.0' +# gem 'strong_migrations', '>= 2.4.0' gem 'tailwindcss-rails', '= 3.3.2' gem 'turbo-rails', '>= 2.0.17' gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] diff --git a/Gemfile.lock b/Gemfile.lock index bcf42c11..045aa706 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -486,8 +486,6 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.7) - strong_migrations (2.5.1) - activerecord (>= 7.1) super_diff (0.17.0) attr_extras (>= 6.2.4) diff-lcs @@ -600,7 +598,6 @@ DEPENDENCIES sprockets-rails stackprof stimulus-rails - strong_migrations (>= 2.4.0) super_diff tailwindcss-rails (= 3.3.2) turbo-rails (>= 2.0.17) diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index 98558624..55df444b 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -1,27 +1,27 @@ -# Mark existing migrations as safe -StrongMigrations.start_after = 20_250_122_150_500 +# # Mark existing migrations as safe +# StrongMigrations.start_after = 20_250_122_150_500 -# Set timeouts for migrations -# PgBouncer in transaction mode doesn't support SET commands -# Timeouts should be set on the database user instead -# StrongMigrations.lock_timeout = 10.seconds -# StrongMigrations.statement_timeout = 1.hour +# # Set timeouts for migrations +# # PgBouncer in transaction mode doesn't support SET commands +# # Timeouts should be set on the database user instead +# # StrongMigrations.lock_timeout = 10.seconds +# # StrongMigrations.statement_timeout = 1.hour -# Analyze tables after indexes are added -# Outdated statistics can sometimes hurt performance -StrongMigrations.auto_analyze = true +# # Analyze tables after indexes are added +# # Outdated statistics can sometimes hurt performance +# StrongMigrations.auto_analyze = true -# Set the version of the production database -# so the right checks are run in development -# StrongMigrations.target_version = 10 +# # Set the version of the production database +# # so the right checks are run in development +# # StrongMigrations.target_version = 10 -# Add custom checks -# StrongMigrations.add_check do |method, args| -# if method == :add_index && args[0].to_s == "users" -# stop! "No more indexes on the users table" -# end -# end +# # Add custom checks +# # StrongMigrations.add_check do |method, args| +# # if method == :add_index && args[0].to_s == "users" +# # stop! "No more indexes on the users table" +# # end +# # end -# Make some operations safe by default -# See https://github.com/ankane/strong_migrations#safe-by-default -# StrongMigrations.safe_by_default = true +# # Make some operations safe by default +# # See https://github.com/ankane/strong_migrations#safe-by-default +# # StrongMigrations.safe_by_default = true From e4f80dbf2b6cc5f25be1917a6e120d604614cc24 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 20:23:53 +0100 Subject: [PATCH 11/14] Remove safety_assured --- db/migrate/20251030190924_add_utm_parameters_to_users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20251030190924_add_utm_parameters_to_users.rb b/db/migrate/20251030190924_add_utm_parameters_to_users.rb index 6e054038..d7a1734e 100644 --- a/db/migrate/20251030190924_add_utm_parameters_to_users.rb +++ b/db/migrate/20251030190924_add_utm_parameters_to_users.rb @@ -2,12 +2,12 @@ class AddUtmParametersToUsers < ActiveRecord::Migration[8.0] def change - safety_assured do + # safety_assured do add_column :users, :utm_source, :string add_column :users, :utm_medium, :string add_column :users, :utm_campaign, :string add_column :users, :utm_term, :string add_column :users, :utm_content, :string - end + # end end end From 98a157bd0bcb340276040ef93300a76c8141132f Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 23:42:21 +0100 Subject: [PATCH 12/14] Update changelog --- .env.template | 0 CHANGELOG.md | 7 +- Gemfile | 2 +- Gemfile.lock | 3 + README.md | 2 + config/initializers/strong_migrations.rb | 48 +-- ...51030190924_add_utm_parameters_to_users.rb | 12 +- temp..log | 302 ------------------ 8 files changed, 42 insertions(+), 334 deletions(-) delete mode 100644 .env.template delete mode 100644 temp..log diff --git a/.env.template b/.env.template deleted file mode 100644 index e69de29b..00000000 diff --git a/CHANGELOG.md b/CHANGELOG.md index dd661d3c..b5f46f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,9 +22,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed useless system tests and cover map functionality with Playwright e2e tests instead. - Number of family members on self-hosted instances is no longer limited. - Export to GPX now adds adds speed and course to each point if they are available. +- `docker-compose.yml` file updated to provide sensible defaults for self-hosted production environment. +- .env.example file added with default environment variables. - Single Dockerfile introduced so Dawarich could be run in self-hosted mode in production environment. - - [ ] Check if with no changes to docker-compose.yml everything still works as before. - - [ ] Deploy to Staging and test again. + - [x] Check if with no changes to docker-compose.yml everything still works as before. + - [x] Deploy to Staging and test again. + - [ ] Run self-hosted instance with production env # [0.34.2] - 2025-10-31 diff --git a/Gemfile b/Gemfile index 469f65db..e1817622 100644 --- a/Gemfile +++ b/Gemfile @@ -48,7 +48,6 @@ gem 'sidekiq-limit_fetch' gem 'sprockets-rails' gem 'stackprof' gem 'stimulus-rails' -# gem 'strong_migrations', '>= 2.4.0' gem 'tailwindcss-rails', '= 3.3.2' gem 'turbo-rails', '>= 2.0.17' gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] @@ -80,4 +79,5 @@ group :development do gem 'database_consistency', '>= 2.0.5', require: false gem 'foreman' gem 'rubocop-rails', '>= 2.33.4', require: false + gem 'strong_migrations', '>= 2.4.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 045aa706..bcf42c11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -486,6 +486,8 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.7) + strong_migrations (2.5.1) + activerecord (>= 7.1) super_diff (0.17.0) attr_extras (>= 6.2.4) diff-lcs @@ -598,6 +600,7 @@ DEPENDENCIES sprockets-rails stackprof stimulus-rails + strong_migrations (>= 2.4.0) super_diff tailwindcss-rails (= 3.3.2) turbo-rails (>= 2.0.17) diff --git a/README.md b/README.md index 797e2177..1f1af5ec 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,8 @@ Simply install one of the supported apps on your device and configure it to send ⏹️ **To stop the app**, press `Ctrl+C`. +You can use default values or create a `.env` file based on `.env.example` to customize your setup. + --- ## 🔧 How to Install Dawarich diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index 55df444b..dfc903e2 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -1,27 +1,31 @@ -# # Mark existing migrations as safe -# StrongMigrations.start_after = 20_250_122_150_500 +# frozen_string_literal: true -# # Set timeouts for migrations -# # PgBouncer in transaction mode doesn't support SET commands -# # Timeouts should be set on the database user instead -# # StrongMigrations.lock_timeout = 10.seconds -# # StrongMigrations.statement_timeout = 1.hour +return unless Rails.env.development? -# # Analyze tables after indexes are added -# # Outdated statistics can sometimes hurt performance -# StrongMigrations.auto_analyze = true +# Mark existing migrations as safe +StrongMigrations.start_after = 20_250_122_150_500 -# # Set the version of the production database -# # so the right checks are run in development -# # StrongMigrations.target_version = 10 +# Set timeouts for migrations +# PgBouncer in transaction mode doesn't support SET commands +# Timeouts should be set on the database user instead +# StrongMigrations.lock_timeout = 10.seconds +# StrongMigrations.statement_timeout = 1.hour -# # Add custom checks -# # StrongMigrations.add_check do |method, args| -# # if method == :add_index && args[0].to_s == "users" -# # stop! "No more indexes on the users table" -# # end -# # end +# Analyze tables after indexes are added +# Outdated statistics can sometimes hurt performance +StrongMigrations.auto_analyze = true -# # Make some operations safe by default -# # See https://github.com/ankane/strong_migrations#safe-by-default -# # StrongMigrations.safe_by_default = true +# Set the version of the production database +# so the right checks are run in development +# StrongMigrations.target_version = 10 + +# Add custom checks +# StrongMigrations.add_check do |method, args| +# if method == :add_index && args[0].to_s == "users" +# stop! "No more indexes on the users table" +# end +# end + +# Make some operations safe by default +# See https://github.com/ankane/strong_migrations#safe-by-default +# StrongMigrations.safe_by_default = true diff --git a/db/migrate/20251030190924_add_utm_parameters_to_users.rb b/db/migrate/20251030190924_add_utm_parameters_to_users.rb index d7a1734e..1df48ce6 100644 --- a/db/migrate/20251030190924_add_utm_parameters_to_users.rb +++ b/db/migrate/20251030190924_add_utm_parameters_to_users.rb @@ -2,12 +2,10 @@ class AddUtmParametersToUsers < ActiveRecord::Migration[8.0] def change - # safety_assured do - add_column :users, :utm_source, :string - add_column :users, :utm_medium, :string - add_column :users, :utm_campaign, :string - add_column :users, :utm_term, :string - add_column :users, :utm_content, :string - # end + add_column :users, :utm_source, :string + add_column :users, :utm_medium, :string + add_column :users, :utm_campaign, :string + add_column :users, :utm_term, :string + add_column :users, :utm_content, :string end end diff --git a/temp..log b/temp..log deleted file mode 100644 index 7fbb6789..00000000 --- a/temp..log +++ /dev/null @@ -1,302 +0,0 @@ -dokku run dawarich rails db:migrate -[dotenv] Loaded .env -E, [2025-11-07T18:56:36.037575 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:36.540304 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:37.048717 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:37.554386 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:38.057240 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:38.560002 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -E, [2025-11-07T18:56:39.062596 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known -Migrating to AddUtmParametersToUsers (20251030190924) -== 20251030190924 AddUtmParametersToUsers: migrating ========================== -E, [2025-11-07T18:56:39.565841 #12] ERROR -- : Prometheus Exporter, failed to send message getaddrinfo(3): Name or service not known --- add_column(:users, :utm_source, :string) -bin/rails aborted! -StandardError: An error has occurred, this and all later migrations canceled: (StandardError) - -PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' -/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' -/app/bin/rails:4:in '
' - -Caused by: -ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block (ActiveRecord::StatementInvalid) -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' -/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' -/app/bin/rails:4:in '
' - -Caused by: -PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block (PG::InFailedSqlTransaction) -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#exec' -/app/vendor/bundle/ruby/3.4.0/gems/prometheus_exporter-2.2.0/lib/prometheus_exporter/instrumentation/method_profiler.rb:99:in 'PG::Connection#async_exec' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:556:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1017:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:986:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:555:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/sentry-rails-6.0.0/lib/sentry/rails/tracing.rb:56:in 'Sentry::Rails::Tracing::SentryNotificationExtension#instrument' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:1137:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:554:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:591:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:40:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#execute' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:643:in 'ActiveRecord::ConnectionAdapters::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:462:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#add_column' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration/default_strategy.rb:10:in 'ActiveRecord::Migration::DefaultStrategy#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1055:in 'block in ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'block in ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1021:in 'ActiveRecord::Migration#say_with_time' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1044:in 'ActiveRecord::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:14:in 'block (2 levels) in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:127:in 'StrongMigrations::Checker#perform_method' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:112:in 'StrongMigrations::Checker#perform' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:13:in 'block in StrongMigrations::Migration#method_missing' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'Kernel#catch' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:12:in 'StrongMigrations::Migration#method_missing' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:6:in 'block in AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:31:in 'block in StrongMigrations::Migration#safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/checker.rb:30:in 'StrongMigrations::Checker.safety_assured' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:30:in 'StrongMigrations::Migration#safety_assured' -/app/db/migrate/20251030190924_add_utm_parameters_to_users.rb:5:in 'AddUtmParametersToUsers#change' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:990:in 'ActiveRecord::Migration#exec_migration' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:974:in 'block (2 levels) in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:973:in 'block in ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:972:in 'ActiveRecord::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration.rb:5:in 'StrongMigrations::Migration#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1186:in 'ActiveRecord::MigrationProxy#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1535:in 'block in ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:626:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:623:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:367:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:359:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1586:in 'ActiveRecord::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migrator.rb:5:in 'StrongMigrations::Migrator#ddl_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1534:in 'ActiveRecord::Migrator#execute_migration_in_transaction' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1508:in 'ActiveRecord::Migrator#migrate_without_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'block in ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1606:in 'ActiveRecord::Migrator#with_advisory_lock' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1453:in 'ActiveRecord::Migrator#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1260:in 'ActiveRecord::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/strong_migrations-2.5.1/lib/strong_migrations/migration_context.rb:4:in 'StrongMigrations::MigrationContext#up' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/migration.rb:1235:in 'ActiveRecord::MigrationContext#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:270:in 'ActiveRecord::Tasks::DatabaseTasks#migrate' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/tasks/database_tasks.rb:248:in 'ActiveRecord::Tasks::DatabaseTasks#migrate_all' -/app/vendor/bundle/ruby/3.4.0/gems/activerecord-8.0.3/lib/active_record/railties/databases.rake:90:in 'block (2 levels) in
' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:281:in 'Rake::Task#execute' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Monitor#synchronize' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'Array#each' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block (2 levels) in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:27:in 'block in Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:44:in 'block in Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:143:in 'Rails::Command.with_argv' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/command.rb:63:in 'Rails::Command.invoke' -/app/vendor/bundle/ruby/3.4.0/gems/railties-8.0.3/lib/rails/commands.rb:18:in '
' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' -/app/vendor/ruby-3.4.6/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' -/app/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' -/app/bin/rails:4:in '
' -Tasks: TOP => db:migrate -(See full trace by running task with --trace) -root@dawarich-staging:~# From c05402b6f3f6386f29021e14d27661f8f2cc5490 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 23:50:18 +0100 Subject: [PATCH 13/14] Allow S3 storage backend to be used in self-hosted instances --- CHANGELOG.md | 1 + config/environments/development.rb | 4 ++-- config/environments/production.rb | 4 ++-- config/environments/staging.rb | 2 +- config/storage.yml | 3 ++- docker/.env.example | 8 ++++---- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5f46f21..a0a6c870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Changed - Removed useless system tests and cover map functionality with Playwright e2e tests instead. +- S3 storage now can be used in self-hosted instances as well. Set STORAGE_BACKEND environment variable to "s3" and provide AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_BUCKET and AWS_ENDPOINT_URL environment variables to configure it. - Number of family members on self-hosted instances is no longer limited. - Export to GPX now adds adds speed and course to each point if they are available. - `docker-compose.yml` file updated to provide sensible defaults for self-hosted production environment. diff --git a/config/environments/development.rb b/config/environments/development.rb index c940de0e..4b5e99bf 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -86,7 +86,7 @@ Rails.application.configure do # Raise error when a before_action's only/except options reference missing actions config.action_controller.raise_on_missing_callback_actions = true - hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',') + hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',').map(&:strip) config.action_mailer.default_url_options = { host: ENV['DOMAIN'] || hosts.first, port: ENV.fetch('PORT', 3000) } @@ -99,5 +99,5 @@ Rails.application.configure do config.lograge.enabled = true config.lograge.formatter = Lograge::Formatters::Json.new - config.active_storage.service = ENV['SELF_HOSTED'] == 'true' ? :local : :s3 + config.active_storage.service = ENV.fetch('STORAGE_BACKEND', :local) end diff --git a/config/environments/production.rb b/config/environments/production.rb index 1e4b392a..146ec651 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -43,7 +43,7 @@ Rails.application.configure do # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = ENV['SELF_HOSTED'] == 'true' ? :local : :s3 + config.active_storage.service = ENV.fetch('STORAGE_BACKEND', :local) config.silence_healthcheck_path = '/api/v1/health' @@ -101,7 +101,7 @@ Rails.application.configure do # ] # Skip DNS rebinding protection for the health check endpoint. config.host_authorization = { exclude: ->(request) { request.path == "/api/v1/health" } } - hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',') + hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',').map(&:strip) config.action_mailer.default_url_options = { host: ENV['DOMAIN'] } config.hosts.concat(hosts) if hosts.present? diff --git a/config/environments/staging.rb b/config/environments/staging.rb index ded741dc..cd248041 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -101,7 +101,7 @@ Rails.application.configure do # ] # Skip DNS rebinding protection for the health check endpoint. config.host_authorization = { exclude: ->(request) { request.path == '/api/v1/health' } } - hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',') + hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',').map(&:strip) config.action_mailer.default_url_options = { host: ENV['DOMAIN'] } config.hosts.concat(hosts) if hosts.present? diff --git a/config/storage.yml b/config/storage.yml index 0d9a1fec..78b402ab 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -7,13 +7,14 @@ local: root: <%= Rails.root.join("storage") %> # Only load S3 config if not in test environment -<% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] %> +<% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] && ENV['AWS_ENDPOINT_URL'] %> s3: service: S3 access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID") %> secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY") %> region: <%= ENV.fetch("AWS_REGION") %> bucket: <%= ENV.fetch("AWS_BUCKET") %> + endpoint: <%= ENV.fetch("AWS_ENDPOINT_URL") %> <% end %> # Remember not to checkin your GCS keyfile to a repository diff --git a/docker/.env.example b/docker/.env.example index cfd1c6be..5c3dd46d 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -16,10 +16,7 @@ RAILS_ENV=development POSTGRES_USER=postgres POSTGRES_PASSWORD=password -# Database name - will default to dawarich_${RAILS_ENV} -# For development: dawarich_development -# For staging: dawarich_staging -# For production: dawarich_production +# Database name POSTGRES_DB=dawarich_development # Database connection settings (used by Rails app) @@ -63,6 +60,9 @@ SELF_HOSTED=true # Store geodata (reverse geocoding results) STORE_GEODATA=true +# Storage backend (local or s3) +STORAGE_BACKEND=local + # ============================================================================= # SECURITY # ============================================================================= From a6687eca18b27f7c3d5374b3cd6b40b45a5e0548 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Fri, 7 Nov 2025 23:52:58 +0100 Subject: [PATCH 14/14] Update changelog --- CHANGELOG.md | 3 --- docker/.env.example | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a6c870..223aa44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,9 +26,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - `docker-compose.yml` file updated to provide sensible defaults for self-hosted production environment. - .env.example file added with default environment variables. - Single Dockerfile introduced so Dawarich could be run in self-hosted mode in production environment. - - [x] Check if with no changes to docker-compose.yml everything still works as before. - - [x] Deploy to Staging and test again. - - [ ] Run self-hosted instance with production env # [0.34.2] - 2025-10-31 diff --git a/docker/.env.example b/docker/.env.example index 5c3dd46d..4aa738fa 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -70,6 +70,7 @@ STORAGE_BACKEND=local # Secret key base for production/staging # Generate with: openssl rand -hex 64 # Leave empty for development (will auto-generate) +# Required for production and staging environments SECRET_KEY_BASE= # =============================================================================