Page MenuHomePhabricator

Error trying to use `mediawiki` service command with MW CLI
Open, Needs TriagePublic

Description

When I run the command mw docker mediawiki create (for example), I get the following error:

[+] Running 0/0
 ⠋ Container mwcli-mwdd-default-dps-1  Creating                                                                                                                                                                0.0s
Error response from daemon: invalid config for network mwcli-mwdd-default_dps: invalid endpoint settings:
no configured subnet or ip-range contain the IP address 10.0.0.10
panic: exit status 1

goroutine 1 [running]:
gitlab.wikimedia.org/repos/releng/cli/internal/mwdd.NewServiceCreateCmdP.func1(0xc00096f508?, {0xc000564f60?, 0x0?, 0x1?})
        /builds/repos/releng/cli/internal/mwdd/cmd.go:103 +0x4c5
github.com/spf13/cobra.(*Command).execute(0xc00096f508, {0xc000564f50, 0x1, 0x1})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003a8308)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
gitlab.wikimedia.org/repos/releng/cli/cmd.Execute({0x2400fe0?, 0x0?}, {0x24001e0?, 0x0?}, {0x24001e8?, 0x2e90398?}, {0x2400fe8, 0x7}, {0x24010a0, 0x14}, ...)
        /builds/repos/releng/cli/cmd/root.go:270 +0xa05
main.main()
        /builds/repos/releng/cli/main.go:29 +0x7a

Instead of the error above, I should have the mediawiki service command create running containers and apply new or updated settings if any exist.

Seems this is something related to the update mw itself? I'm currently at 0.24.3

Version Information  Value
Version              0.24.3
Releases             https://gitlab.wikimedia.org/repos/releng/cli/-/releases
BuildDate            2024-05-07T23:16:58Z

Event Timeline

So I had to do the one command I didn't want to for this to be resolved. I ran mw docker destroy and that wiped out all my containers and associated data. I started things from scratch.

Not really sure how I ran into this issue in the first place :(

But after destroying everything and starting all over, this error has gone away.

Interesting.
How long have you been using the mwcli doker setup for?
I could imagine you may end up in this situation if either you were updating from a very old version to the current version

Ultimately, this meant that the dps (dns) container was likely not running / could not be found on the docker network
https://gitlab.wikimedia.org/repos/releng/cli/-/blob/main/internal/mwdd/files/embed/base.yml?ref_type=heads#L13
So you could have investigated this with a ps etc to see if the container was indeed running.

OR that the network that was required by this container had not been created / had been deleted by some other action outside mwcli.
https://gitlab.wikimedia.org/repos/releng/cli/-/blob/main/internal/mwdd/files/embed/base.yml?ref_type=heads#L39-45

It could be through updates that this subnet that was used has changed, and there used to be some backward compat to deal with this etc.