gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 577 forks source link

GitLab CI MySQL failed build #1053

Closed danikarik closed 6 years ago

danikarik commented 6 years ago

Steps to Reproduce the Problem

  1. buffalo new pipeline --ci-provider gitlab-ci --db-type mysql
  2. cd pipeline
  3. git remote add origin git@gitlab.com:<owner>/pipeline.git
  4. git push -u origin master
  5. change mysql version in .gitlab-ci.yml: mysql:5.7
  6. git push -u origin master

Expected Behavior

CI pipeline successfully built.

Actual Behavior

``` Running with gitlab-runner 10.7.0 (7c273476) on docker-auto-scale 4e4528ca Using Docker executor with image golang:1.8 ... Starting service mysql:latest ... Pulling docker image mysql:latest ... Using docker image sha256:a8a59477268d92f434d86a73b5ea6de9bf7b05d536359413e79da1feb31f87aa for mysql:latest ... Waiting for services to be up and running... Pulling docker image golang:1.8 ... Using docker image sha256:0d283eb41a92d37ef8c86ebb0a8fed68efe60a31decb7baa0806e5ef63565a39 for golang:1.8 ... Running on runner-4e4528ca-project-6308024-concurrent-0 via runner-4e4528ca-srm-1525727806-565a43a6... Cloning repository... Cloning into '/builds/danikarik/pipeline'... Checking out be7fd0d9 as master... Skipping Git submodules setup $ ln -s /builds /go/src/$(echo "gitlab.com/danikarik/pipeline" | cut -d "/" -f1) $ cd /go/src/gitlab.com/danikarik/pipeline $ mkdir -p public/assets $ go get -u github.com/gobuffalo/buffalo/buffalo $ go get -t -v ./... github.com/dustin/go-humanize (download) github.com/gobuffalo/x (download) github.com/monoculum/formam (download) github.com/gorilla/context (download) github.com/gorilla/mux (download) github.com/gorilla/sessions (download) github.com/gorilla/securecookie (download) github.com/gorilla/websocket (download) github.com/nicksnyder/go-i18n (download) github.com/pelletier/go-toml (download) github.com/unrolled/secure (download) github.com/gobuffalo/suite (download) github.com/BurntSushi/toml (download) github.com/markbates/willie (download) github.com/ajg/form (download) github.com/markbates/hmax (download) github.com/stretchr/testify (download) github.com/dustin/go-humanize github.com/gobuffalo/x/httpx github.com/monoculum/formam github.com/gobuffalo/buffalo/vendor/github.com/russross/blackfriday github.com/gobuffalo/buffalo/binding github.com/gobuffalo/buffalo/worker github.com/gorilla/context github.com/gorilla/mux github.com/gobuffalo/buffalo/render github.com/gorilla/securecookie github.com/gorilla/sessions github.com/gorilla/websocket github.com/markbates/refresh/refresh/web golang.org/x/crypto/blowfish golang.org/x/crypto/bcrypt github.com/nicksnyder/go-i18n/i18n/language github.com/nicksnyder/go-i18n/i18n/translation github.com/pelletier/go-toml github.com/gobuffalo/buffalo github.com/nicksnyder/go-i18n/i18n/bundle github.com/nicksnyder/go-i18n/i18n github.com/gobuffalo/buffalo/middleware github.com/gobuffalo/buffalo/middleware/csrf github.com/gobuffalo/buffalo/middleware/i18n github.com/unrolled/secure gitlab.com/danikarik/pipeline/models github.com/gobuffalo/buffalo/middleware/ssl gitlab.com/danikarik/pipeline/actions gitlab.com/danikarik/pipeline gitlab.com/danikarik/pipeline/grifts $ export PATH="$PATH:$GOPATH/bin" $ buffalo test Usage: buffalo test [flags] Flags: -h, --help help for test time="2018-05-07T21:20:22Z" level=error msg="Error: error creating MySQL database pipeline_test: this authentication plugin is not supported\n\n" ERROR: Job failed: exit code 1 ```
``` Running with gitlab-runner 10.7.0 (7c273476) on docker-auto-scale e11ae361 Using Docker executor with image golang:latest ... Starting service mysql:5.7 ... Pulling docker image mysql:5.7 ... Using docker image sha256:0d16d0a97dd13a8ca0c0e205ce1f31f64d9d32048379eb322749442bff35f144 for mysql:5.7 ... Waiting for services to be up and running... Pulling docker image golang:latest ... Using docker image sha256:6b369f7eed80958b1b23fe4db51851acd39c2adf39b0768fd8062596454dddc5 for golang:latest ... Running on runner-e11ae361-project-6308024-concurrent-0 via runner-e11ae361-srm-1525728272-a53114b1... Cloning repository... Cloning into '/builds/danikarik/pipeline'... Checking out 3eb88376 as master... Skipping Git submodules setup $ ln -s /builds /go/src/$(echo "gitlab.com/danikarik/pipeline" | cut -d "/" -f1) $ cd /go/src/gitlab.com/danikarik/pipeline $ mkdir -p public/assets $ go get -u github.com/gobuffalo/buffalo/buffalo $ go get -t -v ./... github.com/dustin/go-humanize (download) github.com/gobuffalo/x (download) github.com/monoculum/formam (download) github.com/gorilla/context (download) github.com/gorilla/mux (download) github.com/gorilla/sessions (download) github.com/gorilla/securecookie (download) github.com/gorilla/websocket (download) github.com/nicksnyder/go-i18n (download) github.com/pelletier/go-toml (download) github.com/unrolled/secure (download) github.com/gobuffalo/suite (download) github.com/BurntSushi/toml (download) github.com/markbates/willie (download) github.com/ajg/form (download) github.com/markbates/hmax (download) github.com/stretchr/testify (download) golang.org/x/crypto/blowfish github.com/dustin/go-humanize github.com/gobuffalo/x/httpx github.com/monoculum/formam github.com/gobuffalo/buffalo/vendor/github.com/russross/blackfriday github.com/gobuffalo/buffalo/binding github.com/gobuffalo/buffalo/worker github.com/gorilla/context github.com/gorilla/mux github.com/gobuffalo/buffalo/render github.com/gorilla/securecookie github.com/gorilla/sessions github.com/gorilla/websocket github.com/markbates/refresh/refresh/web golang.org/x/crypto/bcrypt github.com/nicksnyder/go-i18n/i18n/language github.com/nicksnyder/go-i18n/i18n/translation github.com/gobuffalo/buffalo github.com/pelletier/go-toml github.com/gobuffalo/buffalo/middleware github.com/gobuffalo/buffalo/middleware/csrf github.com/nicksnyder/go-i18n/i18n/bundle github.com/unrolled/secure github.com/nicksnyder/go-i18n/i18n github.com/gobuffalo/buffalo/middleware/ssl github.com/gobuffalo/buffalo/middleware/i18n gitlab.com/danikarik/pipeline/models gitlab.com/danikarik/pipeline/actions gitlab.com/danikarik/pipeline gitlab.com/danikarik/pipeline/grifts $ export PATH="$PATH:$GOPATH/bin" $ buffalo test dropped database pipeline_test Usage: buffalo test [flags] Flags: -h, --help help for test time="2018-05-07T21:27:41Z" level=error msg="Error: error creating MySQL database pipeline_test: Error 1049: Unknown database 'pipeline_test'\n\n" ERROR: Job failed: exit code 1 ```

Info

``` ### Buffalo Version v0.11.1 ### App Information Pwd=/home/daniyar/go/src/gitlab.com/danikarik/pipeline Root=/home/daniyar/go/src/gitlab.com/danikarik/pipeline GoPath=/home/daniyar/go Name=pipeline Bin=bin/pipeline PackagePkg=gitlab.com/danikarik/pipeline ActionsPkg=gitlab.com/danikarik/pipeline/actions ModelsPkg=gitlab.com/danikarik/pipeline/models GriftsPkg=gitlab.com/danikarik/pipeline/grifts VCS=git WithPop=true WithDep=false WithWebpack=true WithYarn=true WithDocker=true WithGrifts=true ### Go Version go version go1.10.2 linux/amd64 ### Go Env GOARCH="amd64" GOBIN="" GOCACHE="/home/daniyar/.cache/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/daniyar/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build655969439=/tmp/go-build -gno-record-gcc-switches" ### Node Version v8.10.0 ### NPM Version 3.5.2 ### Yarn Version 1.6.0 ### PostgreSQL Version PostgreSQL Not Found ### MySQL Version mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper ### SQLite Version SQLite Not Found ### Dep Version dep: version : devel build date : git hash : go version : go1.8.3 go compiler : gc platform : linux/amd64 ### Dep Status could not find project Gopkg.toml, use dep init to initiate a manifest ```
robbyoconnor commented 6 years ago

Install the mysql client and you should be good. This might have been missed since postgres is used most often

mclark4386 commented 6 years ago

I had to add that for postgres (https://github.com/gobuffalo/buffalo/pull/1043) you may want to do the same thing with mysql!

stanislas-m commented 6 years ago

Fixed with #1063.