Error updating passbolt

I tried to update passbolt (running in docker) by following the docker update tutorial
available here

However, after executing docker-compose down && docker-compose up -d , it appears that Docker has created a new database instead of using the existing one, which contains all my data.

Is there a way to “link” it to the correct database?

I’m using traefik for HTTPS setup

This is my docker-compose.yml:

cat docker-compose.yml
version: "3.9"
services:
  db:  
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_DATABASE: "passbolt"
      MYSQL_USER: "passbolt"
      MYSQL_PASSWORD: "P4ssb0lt"
    volumes:
      - database_volume:/var/lib/mysql

  passbolt:
    image: passbolt/passbolt:latest-ce
    restart: unless-stopped
    depends_on:
      - db  
    environment:
      APP_FULL_BASE_URL: "https://passbolt.mywebsite.com.br"
      DATASOURCES_DEFAULT_HOST: "db"  
      DATASOURCES_DEFAULT_USERNAME: "passbolt"
      DATASOURCES_DEFAULT_PASSWORD: "P4ssb0lt"
      DATASOURCES_DEFAULT_DATABASE: "passbolt"
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - jwt_volume:/etc/passbolt/jwt
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.passbolt-https.rule=Host(`passbolt.mywebsite.com.br`)"
      - "traefik.http.routers.passbolt-https.entrypoints=websecure"
      - "traefik.http.routers.passbolt-https.tls=true"
      - "traefik.http.routers.passbolt-https.tls.certresolver=letsencrypt"
      - "traefik.http.services.passbolt-https.loadbalancer.server.port=80"

  traefik:
    image: traefik:2.6
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yaml:/traefik.yaml:ro
      - ./conf/:/etc/traefik/conf
      - ./shared/:/shared
      - ./logs:/logs

volumes:
  database_volume:
  gpg_volume:
  jwt_volume:

This is traefik.yml

global:
  sendAnonymousUsage: false
log:
  level: DEBUG
  format: common
accessLog:
  filePath: "./logs/access.log"
  bufferingSize: 100
providers:
  docker:
    endpoint: 'unix:///var/run/docker.sock'
    watch: true
    exposedByDefault: true
    swarmMode: false
  file:
    directory: /etc/traefik/conf/
    watch: true
api:
  dashboard: true
  debug: false
  insecure: false
entryPoints:
  web:
    address: ':80'
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
          permanent: true
  websecure:
    address: ':443'
certificatesResolvers:
  letsencrypt:
    acme:
      email: email@mycompany.com.br
      storage: ./shared/acme.json
      caServer: 'https://acme-v02.api.letsencrypt.org/directory'
      keyType: EC256
      httpChallenge:
        entryPoint: web
      tlsChallenge: {}

This is a printscreen of docker ps running on my server

I already tried inspecting the docker container which has the correct database setup and getting its ip address to put in place of DATASOURCES_DEFAULT_HOST but it didn’t work either.

Hi, I hope those aren’t your passwords if so. please remove them :P.

Do you have a backup of your db file ?

In my docker compose yml file I also have a volume for Mysql.
and are able to restore a backup like shown below.

db:
  volumes:
      - ./passbolt_tst/mysql:/var/lib/mysql
      - ./passbolt_restore/<backup database name>.sql:/docker-entrypoint-initdb.d/<database name>.sql

cheers.

Steve

Hi :wave:

Please have a look at your container’s names:

The container’s name in passbolt compose are based on the directory name where the docker-compose.yml file is located.

My guess is docker-compose.yaml was in www folder, then you moved the docker-compose.yaml or renamed the www folder to passbolt.

That’s why containers name are different now.

One solution to quickly recover your initial database is to revert back your change, or set in your db service description a container_name: www_db_1 directive.

Best regards,

Thanks, this did the trick! :smile:

2 Likes