taigaio / taiga-docker

Mozilla Public License 2.0
1.2k stars 304 forks source link

[BUG] taiga-back and taiga-async not starting #17

Open gabrieletassoni opened 3 years ago

gabrieletassoni commented 3 years ago

Describe the bug

After an upgrade from taiga 5 to taiga 6 following guidelines documented here, the taiga-back and taiga-async does not start with following logs:

For taiga-async:

Give permission to taiga:taiga,
Starting Celery...,
error: failed switching to "taiga": operation not permitted,

For taiga-back:

Executing pending migrations,
Operations to perform:,
  Apply all migrations: admin, attachments, auth, bitbucket, contact, contenttypes, custom_attributes, djmail, easy_thumbnails, epics, external_apps, feedback, github, gitlab, gogs, history, issues, likes, milestones, notifications, projects, references, sessions, settings, tasks, telemetry, timeline, users, userstorage, userstories, votes, webhooks, wiki,
Running migrations:,
  No migrations to apply.,
Load default templates,
Installed 2 object(s) from 1 fixture(s),
Give permission to taiga:taiga,
Starting Taiga API...,
error: failed switching to "taiga": operation not permitted,

How can we reproduce the behavior

I use bind mounts for media, static and settings folders (attaching the modified docker-compose) and external postgres db, by simply issuing docker-compose up, brings the errors.

version: "3.5"

networks:
    default:
       external:
         name: webproxy

x-environment:
  &default-back-environment
  # Database settings
  POSTGRES_DB: [-REDACTED-]
  POSTGRES_USER: [-REDACTED-]
  POSTGRES_PASSWORD: [-REDACTED-]
  POSTGRES_HOST: [-REDACTED-]
  # Taiga settings
  TAIGA_SECRET_KEY: "[-REDACTED-]"
  TAIGA_SITES_DOMAIN: "pm.bancolini.com"
  TAIGA_SITES_SCHEME: "https"
  # Email settings. Uncomment following lines and configure your SMTP server
  EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
  DEFAULT_FROM_EMAIL: "[-REDACTED-]"
  EMAIL_USE_TLS: "True"
  EMAIL_HOST: 'smtp-relay.gmail.com'
  EMAIL_PORT: 587
  EMAIL_HOST_USER: ''
  EMAIL_HOST_PASSWORD: ''
  # Rabbitmq settings
  # Should be the same as in taiga-async-rabbitmq and taiga-events-rabbitmq
  RABBITMQ_USER: taiga
  RABBITMQ_PASS: taiga
  # Telemetry settings
  ENABLE_TELEMETRY: "True"
  PUBLIC_REGISTER_ENABLED: "False"

x-volumes:
  &default-back-volumes
  - /home/docker/persistence/taiga6-data/static:/taiga-back/static
  - /home/docker/persistence/taiga6-data/media:/taiga-back/media
  - /home/docker/persistence/taiga6-data/settings:/taiga-back/settings

services:
  # taiga-db:
  #  image: postgres:12.3
  #  environment:
  #    POSTGRES_DB: taiga
  #    POSTGRES_USER: taiga
  #    POSTGRES_PASSWORD: taiga
  #  volumes:
  #    - taiga-db-data:/var/lib/postgresql/data
  #  networks:
  #    - taiga

  taiga-back:
    build: .
    environment: *default-back-environment
    volumes: *default-back-volumes
    depends_on:
      - taiga-events-rabbitmq
      - taiga-async-rabbitmq

  taiga-async:
    build: .
    entrypoint: ["/taiga-back/docker/async_entrypoint.sh"]
    environment: *default-back-environment
    volumes: *default-back-volumes
    depends_on:
      - taiga-back
      - taiga-async-rabbitmq

  taiga-async-rabbitmq:
    image: rabbitmq:3-management-alpine
    environment:
      RABBITMQ_ERLANG_COOKIE: secret-erlang-cookie
      RABBITMQ_DEFAULT_USER: taiga
      RABBITMQ_DEFAULT_PASS: taiga
      RABBITMQ_DEFAULT_VHOST: taiga
    volumes:
      - /home/docker/persistence/taiga6-data/rabbitmq-async:/var/lib/rabbitmq

  taiga-front:
    image: taigaio/taiga-front:latest
    environment:
      TAIGA_URL: "https://pm.bancolini.com"
      TAIGA_WEBSOCKETS_URL: "wss://pm.bancolini.com"
    volumes:
      - /home/docker/persistence/taiga6-data/conf.json:/usr/share/nginx/html/conf.json

  taiga-events:
    image: taigaio/taiga-events:latest
    environment:
      RABBITMQ_USER: taiga
      RABBITMQ_PASS: taiga
      TAIGA_SECRET_KEY: "[-REDACTED-]"
    depends_on:
      - taiga-events-rabbitmq

  taiga-events-rabbitmq:
    image: rabbitmq:3-management-alpine
    environment:
      RABBITMQ_ERLANG_COOKIE: secret-erlang-cookie
      RABBITMQ_DEFAULT_USER: taiga
      RABBITMQ_DEFAULT_PASS: taiga
      RABBITMQ_DEFAULT_VHOST: taiga
    volumes:
      - /home/docker/persistence/taiga6-data/rabbitmq-events:/var/lib/rabbitmq

  taiga-protected:
    image: taigaio/taiga-protected:latest
    environment:
      MAX_AGE: 360
      SECRET_KEY: "[-REDACTED-]"

  taiga-gateway:
    image: nginx:1.19-alpine
    ports:
      - "9000:80"
    environment:
      VIRTUAL_HOST: pm.bancolini.com
      LETSENCRYPT_HOST: pm.bancolini.com
      LETSENCRYPT_EMAIL: ced@bancolini.com    
    volumes:
      - /home/docker/persistence/taiga6-data/nginx.conf:/etc/nginx/conf.d/default.conf
      - /home/docker/persistence/taiga6-data/static:/taiga/static
      - /home/docker/persistence/taiga6-data/media:/taiga/media
    depends_on:
      - taiga-front
      - taiga-back
      - taiga-events

Workarounds

No workarounds found: cannot use Taiga.

Taiga environment

Self hosted taiga with docker.

bameda commented 3 years ago

Hi @gabrieletassoni

This is a strange behavior. Why do you have the database service commented? What docker images are you using, (oficial, custom...)?? It seems a permissions errors.