Skip to content
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

colima start fails during provisioning docker with lima v0.6.4 and some host username #11

Closed
irisTa56 opened this issue Sep 19, 2021 · 8 comments

Comments

@irisTa56
Copy link

  • My environment:
    • colima: v0.1.9
    • lima: v0.6.4
    • Host OS: macOS Big Sur Version 11.4
  • My host username (Takayuki.Kobayashi) is firstname.lastname form.
  • Terminal output:
    $ colima start
    [colima] 09:42:29 creating and starting VM ...
    [colima] 09:43:24 provisioning VM ...
    [colima] 09:43:24 provisioning docker ...
    [colima] 09:43:24 provisioning docker in VM ...
    $ echo $?
    6
    $ colima status # errors related k8s is ok because I don't use it
    docker is installed VM?
    success
    
    docker is running in VM?
    success
    
    docker is installed on Host?
    success
    
    docker client on host can access the VM server?
    error
    
    kubernetes is installed in VM?
    error
    
    kubernetes is running in VM?
    error
    
    kubernetes client on host can access the VM?
    error
    
    some checks failed :(
    
  • Extract from ~/.colima/out.log:
    [...]
    time="2021-09-19T09:42:29+09:00" level=warning msg="local user \"Takayuki.Kobayashi\" is not a valid Linux username (must match \"^[a-z_][a-z0-9_-]*$\"); using \"lima\" username instead"
    [...]
    usermod: user 'Takayuki.Kobayashi' does not exist
    exit status 6
    

When adding lima user to docker group, it assumes that username on lima is the same with the host username.
But, for some problematic usernames, it doesn't exist on lima.

Currently my workaround is to specify username in socket.sh (by replacing 127.0.0.1 with ${USER}@127.0.0.1) and start with overwritten USER (by USER=lima colima start), but there should be a better way...

@abiosoft
Copy link
Owner

Thanks for your detailed response and workaround.

I have actually considered this before but I thought it will be a rare case. I should work on a fix soon.

@abiosoft
Copy link
Owner

abiosoft commented Sep 19, 2021

@irisTa56 can you try the current master version? https://raw.githubusercontent.com/abiosoft/colima/master/colima.

If you need help on how to install

curl -LO https://raw.githubusercontent.com/abiosoft/colima/master/colima && sudo install colima /usr/local/bin/colima

If you wouldn't mind, I would prefer a fresh start. i.e. colima delete and colima start.

I am pretty sure it is fixed. But want to confirm from your end before making a new release.

Thanks.

@irisTa56
Copy link
Author

irisTa56 commented Sep 19, 2021

@abiosoft
Thank you very much for such a quick update!!

I confirmed the followings:

$ curl -LO https://raw.githubusercontent.com/abiosoft/colima/master/colima && sudo install colima /usr/local/bin/colima
[...]
$ colima delete
Are you sure you want to delete the VM and all settings? [y/N] y
[colima] 16:37:11 deleting docker and kubernetes configs ...
$ rm -rf ~/.colima # to remove my workaround script
$ colima start
[colima] 16:44:04 starting VM ...
[colima] 16:44:34 provisioning VM ...
[colima] 16:44:34 provisioning docker ...
[colima] 16:44:34 starting docker ...
[colima] 16:44:35 docker startup successful
[colima] 16:44:35 done
$ colima status
docker is installed VM?
success

docker is running in VM?
success

docker is installed on Host?
success

docker client on host can access the VM server?
success

kubernetes is installed in VM?
error

kubernetes is running in VM?
error

kubernetes client on host can access the VM?
error

some checks failed :(

// and docker commands works fine!

@irisTa56
Copy link
Author

P.S.

I noticed that I didn't run colima delete successfully because of kubectl: command not found.
So I commented out this line, and then confirm again:

$ colima delete
Are you sure you want to delete the VM and all settings? [y/N] y
[colima] 17:04:20 deleting docker and kubernetes configs ...
[colima] 17:04:20 deleting colima VM ...
[colima] 17:04:20 stopping docker ...
[colima] 17:04:21 stopping VM ...
[colima] 17:04:22 done
[colima] 17:04:24 deleting other configs ...
[colima] 17:04:24 done
$ colima start
[colima] 17:04:32 creating and starting VM ...
[colima] 17:05:28 provisioning VM ...
[colima] 17:05:28 provisioning docker ...
[colima] 17:05:28 provisioning docker in VM ...
[colima] 17:05:56 restarting VM to complete docker setup ...
[colima] 17:06:30 VM restarted
[colima] 17:06:31 starting docker ...
[colima] 17:06:31 docker startup successful
[colima] 17:06:31 done
$ colima status
docker is installed VM?
success

docker is running in VM?
success

docker is installed on Host?
success

docker client on host can access the VM server?
success

kubernetes is installed in VM?
error

kubernetes is running in VM?
error

kubernetes client on host can access the VM?
error

some checks failed :(

@abiosoft
Copy link
Owner

P.S.

I noticed that I didn't run colima delete successfully because of kubectl: command not found.
So I commented out this line, and then confirm again:

thanks for catching that

@ngonik
Copy link

ngonik commented Oct 25, 2021

Hi @abiosoft. I'm having this same issue on v0.2.2, even after a clean start with colima delete and colima start. Even the workaround explained by @irisTa56 doesn't seem to help.

Getting Cannot connect to the Docker daemon at unix:///Users/nicolas.gonik/.docker/run/docker.sock. Is the docker daemon running? when doing docker ps or any other docker action.

Your help will be greatly appreciated.

@abiosoft
Copy link
Owner

abiosoft commented Oct 25, 2021

Hi @abiosoft. I'm having this same issue on v0.2.2, even after a clean start with colima delete and colima start. Even the workaround explained by @irisTa56 doesn't seem to help.

Getting Cannot connect to the Docker daemon at unix:///Users/nicolas.gonik/.docker/run/docker.sock. Is the docker daemon running? when doing docker ps or any other docker action.

Your help will be greatly appreciated.

@ngonik Looks like you have multiple docker contexts configured.

What does running docker context ls give you? If it lists more than one, switching to the default with docker context use default should resolve it.

@ngonik
Copy link

ngonik commented Oct 26, 2021

That did the trick. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants