Failed to run emulator in container with volumes and specified dataset for the second time
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
- run:
docker compose up - stop it
docker compose down - 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
I have the same issue too:
services:
bigquery:
image: ghcr.io/goccy/bigquery-emulator:latest
command:
- --project=local
- --dataset=local
- --database=/data/bq.db
volumes:
- bigquery-data:/data
volumes:
bigquery-data:
@vladDotH did you solved it?
UPDATE: Its happening with the binary too, is not just in Docker
./bigquery-emulator-linux-amd64 --dataset local --project local --database this.db
UPDATE: The issue is related to pass dataset argument. Just using project and database args works fine. I think this must be handled in other way (like create if not exists, but not failing if exists).
./bigquery-emulator-linux-amd64 --dataset local --database this.db
Btw this is related to #237