You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can't run the project because of a database migration error.
Steps to reproduce
Clone the repo with git clone git@github.com:zekroTJA/shinpuru
Go to the shinpuru directory with cd shinpuru
Start databases and other services with docker-compose -f .\docker-compose.dev.yml up
Open vscode in that directory with code .
Run the project by pressing F5 key.
Attachments
My configuration file (I've removed tokens and secrets) :
# This just marks the version of the config.# This is essential for figuring out if the config# structure has changed with an update and if the config# will be not validly parsed.configVersionPleaseDoNotChange: 6# Discord specific configurationdiscord:
# Your bot's token you will get from https://discord.com/developers/applicationstoken: ""# The global prefix which will be always usable on all guildsgeneralprefix: "sp!"# The Discord ID of the host of the bot# This user will have FULL PERMISSIONS on all guildsownerid: ""# The client ID of the bot's application account# Get this from https://discord.com/developers/applicationsclientid: ""# The client secret for the bot's application account# Get this from https://discord.com/developers/applicationsclientsecret: ""# Specify properties for the global command# rate limiter middleware.globalcommandratelimit:
# Rate limit bucket token size.burst: 1# Rate limit bucket token regeneration# in seconds.limitseconds: 10# Default permissions for users and adminspermissions:
# Default permissions for users without any# previlegesdefaultuserrules:
- +sp.etc.*
- +sp.chat.*# Default permissions for guild owners# and adminsdefaultadminrules:
- +sp.guild.*
- +sp.etc.*
- +sp.chat.*# Database sepcific configurationdatabase:
# Currently, this bot supports only MySql (MariaDB).# But when more database bindings are available, here# you can choose which one to use.type: "mysql"# MySQL (MariaDB) configurationmysql:
# Host address of the databasehost: "localhost:3306"# Username of the database accountuser: "root"# Password for the used database accountpassword: "dev"# Database namedatabase: "shinpuru"# Caching prefrences.cache:
# Redis connection configuration.redis:
# Redis host addressaddr: "localhost:6379"# Redis passwordpassword: "myredispassword"# Database typetype: 0# If enabled, most frequently used database# requests are automatically cached in redis# to minimize load on the database as well as# request times.# It is recomendet to leave this enabled. If# you want to disable it for whatever reason,# you can do it here.cachedatabase: false# Logging preferenceslogging:
# Print log output each time a command is calledcommandlogging: true# Set the log level of the logger# Log levels can be found here:# https://github.com/op/go-logging/blob/master/level.go#L20loglevel: 4# Storage interface configurationstorage:
# Here you can chose between 'file' or# 'minio' as storage interfaces.# Minio also supprts connecting to Amazon S3# or google Cloud.type: "minio"# Minio interface configurationminio:
# Endpoint address of the storageendpoint: "localhost:9000"# Storage access keyaccesskey: "dev-access-key"# Storage access secretaccesssecret: "dev-secret-key"# Main location to be usedlocation: "us-east-1"# Use HTTPS for API callssecure: true# File interface configurationfile:
# Local location of the data storagelocation: ./data# Web server configurationwebserver:
# Whether to expose web server and REST APIenabled: true# Address to expose web server toaddr: 0.0.0.0:8080# TLS configurationtls:
# Use TLS (HTTPS)enabled: false# TLS certificate locationcert: "/etc/cert/mycert.pem"# TLS keyfile locationkey: "/etc/cert/mykey.pem"# The address, the web server will be accessable# This value MUST be the same address as configured# in the OAuth2 preferences of your bots applicationpublicaddr: "https://dev.nocturlab.fr"# Debug address which is set during debugging as# CORS origin domain.debugpublicaddr: "http://localhost:8081"# Ratelimit configurationratelimit:
# Whether or not to enable rate limiterenabled: true# Burst defines max requests in the given duration.# This value should not be that low, because first# connections to the API via the web interface might# require a lot of requests to be processed.burst: 50# The reset duration until a request token is restored.limitseconds: 3# Credentials of the twitch app to connect to the# twitch API# You can register a twitch API app and get the# credentials from this page:# https://glass.twitch.tv/console/appstwitchapp:
# Client IDclientid: ""# Client Secretclientsecret: ""# Prometheus metrics endpoint configurationmetrics:
# Whether or not to enable the prometheus# metrics and HTTP endpointenable: true# The address the metrics HTTP server binds# to. This is defaultly ":9091" if not# specifiedaddr: ":9091"# Time Schedule specifications.# Time schedules are specified using the crontab# syntax:# second minute hour month dom dow# Read this to get more information:# https://pkg.go.dev/github.com/robfig/cron/v3#hdr-Usageschedules:
# Guild backup scheduleguildbackups: '0 0 6,18 * * *'# Refresh token cleanup schedulerefreshtokencleanup: '0 0 5 * * *'
Migration 6 seems to be properly patched but throw an error at launch :
So I can workaround this error just by adding the migration 6 manually on the database.
Now I got a new error :
panic: could not build `kencommandhandler`: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
goroutine 1 [running]:
github.com/sarulabs/di/v2.(*containerGetter).Get(0x0, 0xc000342550, {0x157d90b, 0x11})
C:/Users/flavi/go/pkg/mod/github.com/sarulabs/di/v2@v2.4.2/containerGetter.go:17 +0x11e
github.com/sarulabs/di/v2.(*container).Get(0xc000342550, {0x157d90b, 0x11})
C:/Users/flavi/go/pkg/mod/github.com/sarulabs/di/v2@v2.4.2/container.go:38 +0x4d
main.main()
C:/Users/flavi/Documents/dev/github.com/shiipou/shinpuru/cmd/shinpuru/main.go:361 +0x1ae8
Process 19880 has exited with status 2
Detaching
dlv dap (19636) exited with code: 0
I can in fact reproduce the issue. I've never tried the migrations on a fresh database since a long time. I will definitely ensure that the fresh setup works the next time before releasing a new version.
Type
Crash
Instances
Description
We can't run the project because of a database migration error.
Steps to reproduce
git clone git@github.com:zekroTJA/shinpuru
cd shinpuru
docker-compose -f .\docker-compose.dev.yml up
code .
F5
key.Attachments
My configuration file (I've removed tokens and secrets) :
Some logs :
The text was updated successfully, but these errors were encountered: