New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start MESG Core on Digital Ocean with Docker image #213

Closed
antho1404 opened this Issue Jun 13, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@antho1404
Copy link
Member

antho1404 commented Jun 13, 2018

When using Digital Ocean and the built in docker image we have an error when running MESG Core.

Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on interface eth0 (xxx.xxx.xxx.xxx and yyy.yyy.yyy.yyy)

This is because of the initialization of swarm where we need to precise the address that we want.

@antho1404 antho1404 added the bug label Jun 13, 2018

@antho1404

This comment has been minimized.

Copy link
Member Author

antho1404 commented Jun 13, 2018

Current workaround is to initialize the swarm manually and give the address that we want

docker swarm init --advertise-addr xxx.xxx.xxx.xxx

@NicolasMahe NicolasMahe added this to To do in v0.5.0 via automation Nov 27, 2018

@NicolasMahe NicolasMahe added this to the v0.5.0 milestone Nov 27, 2018

@NicolasMahe NicolasMahe removed this from To do in v0.5.0 Nov 27, 2018

@NicolasMahe

This comment has been minimized.

Copy link
Member

NicolasMahe commented Nov 27, 2018

What about removing swarm init in the core?
We could just return an good error message with the command to execute to init the swarm node with the advertise-addr flag.

func (c *DockerContainer) createSwarmIfNeeded() error {
ctx, cancel := context.WithTimeout(context.Background(), c.callTimeout)
defer cancel()
info, err := c.client.Info(ctx)
if err != nil {
return err
}
if info.Swarm.NodeID != "" {
return nil
}
ctx, cancel = context.WithTimeout(context.Background(), c.callTimeout)
defer cancel()
_, err = c.client.SwarmInit(ctx, swarm.InitRequest{
ListenAddr: "0.0.0.0:2377", // https://docs.docker.com/engine/reference/commandline/swarm_init/#usage
})
return err
}

@NicolasMahe NicolasMahe self-assigned this Nov 27, 2018

@NicolasMahe

This comment has been minimized.

Copy link
Member

NicolasMahe commented Nov 28, 2018

@antho1404 what do you think about:

What about removing swarm init in the core?
We could just return an good error message with the command to execute to init the swarm node with the advertise-addr flag.

@antho1404

This comment has been minimized.

Copy link
Member Author

antho1404 commented Nov 28, 2018

I think we can easily catch this error and return a nice error for the user and ask them to run docker swarm. So I agree to remove the docker swarm init but we still need to check if we are on a swarm (services depends on that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment