Page MenuHomePhabricator

`mw docker update` panics on 0.22.0
Closed, ResolvedPublic

Description

Steps to (maybe) reproduce:

  • Have an mwcli environment created on 0.21, if not earlier (not sure tbh.)
  • update to mwcli v0.22
  • run mw docker update

Expected results

🤷 (not a panic though)

Actual results

⏚ [migr:~/workspace/mediawiki/extensions/EntitySchema] master+ ± mw docker update 
PANIC <nil>                                        
panic: (*logrus.Entry) 0xc00039c4d0

goroutine 1 [running]:
github.com/sirupsen/logrus.(*Entry).log(0xc00039c460, 0x0, {0xc000c24899, 0x5})
    /go/pkg/mod/github.com/sirupsen/logrus@v1.9.0/entry.go:260 +0x47e
github.com/sirupsen/logrus.(*Entry).Log(0xc00039c460, 0x0, {0xc000c678c8?, 0x8?, 0xc000c24620?})
    /go/pkg/mod/github.com/sirupsen/logrus@v1.9.0/entry.go:304 +0x4f
github.com/sirupsen/logrus.(*Logger).Log(0xc00013a580, 0x0, {0xc000c678c8, 0x1, 0x1})
    /go/pkg/mod/github.com/sirupsen/logrus@v1.9.0/logger.go:204 +0x65
github.com/sirupsen/logrus.(*Logger).Panic(...)
    /go/pkg/mod/github.com/sirupsen/logrus@v1.9.0/logger.go:253
github.com/sirupsen/logrus.Panic(...)
    /go/pkg/mod/github.com/sirupsen/logrus@v1.9.0/exported.go:129
gitlab.wikimedia.org/repos/releng/cli/internal/cmd/docker.NewMwddUpdateCmd.func1(0xc0006b3b00?, {0x1ca89b8?, 0x0?, 0x0?})
    /builds/repos/releng/cli/internal/cmd/docker/update.go:20 +0x137
github.com/spf13/cobra.(*Command).execute(0xc0006b3b00, {0x1ca89b8, 0x0, 0x0})
    /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002cc600)
    /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
    /go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
gitlab.wikimedia.org/repos/releng/cli/cmd.Execute({0x14fab90?, 0x407f59?}, {0x14f9d8c?, 0x4014a0?}, {0x14f9d94?, 0x0?}, {0x14fab98, 0x7}, {0x14fdaf0, 0x14}, ...)
    /builds/repos/releng/cli/cmd/root.go:266 +0xa4b
main.main()
    /builds/repos/releng/cli/main.go:29 +0x85

My environment is created by a script that runs:

# [...]
mw docker mediawiki create
mw docker mysql create
mw docker mysql-replica create
mw docker phpmyadmin create
mw docker memcached create
# graphite has been disabled for now, see T307366
# mw docker graphite create # available at http://graphite.mwdd.localhost:8080/

# install repo
mw docker mediawiki install --dbtype=mysql --dbname=wikidatawiki_dev
# [...]

# install dewiki_dev
mw docker mediawiki install --dbtype=mysql --dbname=dewiki_dev

# [...]

Details

TitleReferenceAuthorSource BranchDest Branch
Fix mw docker updaterepos/releng/cli!391addshorefix-docker-updatemain
Customize query in GitLab

Event Timeline

So...

gitlab.wikimedia.org/repos/releng/cli/internal/cmd/docker.NewMwddUpdateCmd.func1(0xc0006b3b00?, {0x1ca89b8?, 0x0?, 0x0?})
    /builds/repos/releng/cli/internal/cmd/docker/update.go:20 +0x137

This is...

			runningServices := mwdd.DefaultForUser().ServicesWithStatus("running")
			stoppedServices := mwdd.DefaultForUser().ServicesWithStatus("stopped")
			existingServices := append(runningServices, stoppedServices...)
			if len(existingServices) == 0 { # <<< LINE 20
				logrus.Info("No services to update")
				return
			}
			logrus.Infof("Updating %d services", len(existingServices))
			logrus.Tracef("Updating services: %v", existingServices)

So no panic called by mwcli, but istead a panic of logrus itself it seems

Addshore moved this task from Inbox to Priority Backlog on the mwcli board.

I don't appear to be able to reproduce :/

Scratch that, I can, just I was on 0.21.0 to start with
Indeed this happens in 0.22.0!
And there is currently no e2e test for this method

Addshore moved this task from Priority Backlog to Review on the mwcli board.
Addshore moved this task from Done to Pending Release on the mwcli board.

0.22.1 is releasing now

Addshore moved this task from Pending Release to Done on the mwcli board.