Skip to content

Failed to run emulator in container with volumes and specified dataset for the second time #397

@vladDotH

Description

@vladDotH

What happened?

bq-emulator | failed to exec INSERT INTO datasets (id,projectID,tableIDs,modelIDs,routineIDs,metadata) VALUES (@id,@projectid,@tableids,@modelids,@routineids,@metadata): UNIQUE constraint failed: datasets.projectID, datasets.id
bq-emulator exited with code 1

What did you expect to happen?

Normal container startup with saved volumes

How can we reproduce it (as minimally and precisely as possible)?

my docker-compose.yml:

services:
  bq-emulator:
    container_name: bq-emulator
    image: ghcr.io/goccy/bigquery-emulator:0.6.6
    command: --project=testproject --database=testdatabase --log-level=debug 
    ports:
      - 9050:9050
      - 9060:9060
    volumes:
      - ./work:/work
  1. run: docker compose up
  2. stop it docker compose down
  3. run again and further attempts will fail

Anything else we need to know?

Docker version:

Client: Docker Engine - Community
Version: 28.0.4
API version: 1.48
Go version: go1.23.7
Git commit: b8034c0
Built: Tue Mar 25 15:07:16 2025
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 28.0.4
API version: 1.48 (minimum version 1.24)
Go version: go1.23.7
Git commit: 6430e49
Built: Tue Mar 25 15:07:16 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.26
GitCommit: 753481ec61c7c8955a23d6ff7bc8e4daed455734
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions