Hi,
I should install Snipe-IT on Windows Docker Desktop, but it stops at database migration with this error:
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oauth_auth_codes' already exists (SQL: create table oauth_auth_codes
(id
varchar(100) not null, user_id
bigint unsigned not null, client_id
bigint unsigned not null, scopes
text null, revoked
tinyint(1) not null, expires_at
datetime null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB)
I tried to delete the whole database or the oauth_auth_codes table and re-run the migration again, but the error did not disappear.
This is the db part of .env file:
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=snipeit
DB_USERNAME=snipeit
DB_PASSWORD=changeme1234
MYSQL_ROOT_PASSWORD=changeme1234
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
And the docker compose file:
version: '3.9'
volumes:
db_data:
driver: local
driver_opts:
type: none
o: bind
device: C:\DockerVolumes\db_data
storage:
driver: local
driver_opts:
type: none
o: bind
device: C:\DockerVolumes\storage
services:
app:
image: snipe/snipe-it:${APP_VERSION:-v7.0.11}
restart: unless-stopped
volumes:
- storage:/var/lib/snipeit
ports:
- "${APP_PORT:-8000}:80"
depends_on:
db:
condition: service_healthy
restart: true
env_file:
- .env
db:
image: mariadb:11.5.2
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
- ./scripts/healthcheck.sh:/usr/local/bin/healthcheck.sh:ro
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
healthcheck:
# https://mariadb.com/kb/en/using-healthcheck-sh/#compose-file-example
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 1s
retries: 5
Hello @shatvani
Did you have the latest version of Snipe-It? And do you use a new database for it?
If I check the source I only see one reference in the migrations to oauth_auth_codes
and that is in the migration to create the table. https://github.com/search?q=repo%3Asnipe%2Fsnipe-it+oauth_auth_codes&type=code
And that migration does only try to create the table if it doesn't yet exist.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community