Local Community

Regenerating Docker Machine TLS Certificate, checking system won't start

I tried to regenerate certificates:

docker-machine regenerate-certs
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...

Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

SSH session establishment never completes

If you were using the Docker Machine CLI, did you start the local-by-flywheel machine? These commands worked for me:
docker-machine start local-by-flywheel
docker-machine regenerate-certs local-by-flywheel
docker-machine regenerate-certs --client-certs local-by-flywheel

Local By Flywheel 3.0.4 - Docker Toolbox 18.03.0 - Oracle VM VirtualBox 6.0.4 -Win 10

As @luca said – make sure you are running those commands agains the local-by-flywheel machine and not the default machine.

I also created this FAQ: Local won't turn on - Log says Regenerating Certificates

Which gives a little more background, and links to a possible solution. Let me know if that helps!

– Ben

! ! ! FOUND THE CULPRIT ! ! ! - - Appears OS level VPN needs to be in the same state it was when you installed Local and created your site.

Wow! This is is my 3rd volley throwing a couple hours at this in 3 days - - I was just getting ready to ask for fix commands applicable to a Win10 environment when, HOLD ON - - WAIT FOR IT - Local quit trying to regenerate certs.

WHY? Because I turned my OS VPN off !!! THAT fixed the problem. - - If you install Local and create a site with your OS level (not browser) VPN off, THEN later start LOCAL after turning the VPN on, Local will need to regenerate certs

I reproduced it without rebooting the OS. YEE HAW!!!

Cheers,
Doug Knoyle

@ben.turner Hope to see you at meetup soon.

1 Like

Damn – That sounds like a headache to have zeroed in on! Good job figuring it out!

I’ve been a Linux/Mac guy for so long, I’m not as familiar with Windows and this kind of a setting.

I’d love to replicate that on my Windows box – do you have a screenshot or the menu you went to for that setting? Also, is it just a Windows VPN setting, or are you going through a third party VPN service?

Hi Ben,
I’m using a 3rd party VPN service (“Private Internet Access”) that is available for Win, Linux, Mac, Android, iOS, Chrome browser, Firefox browser, and Opera browser.

I’m using the Chrome browser extension, Windows OS application, and the Android app. I selectively turn each component on or off depending on what I’m doing.

In this instance neither the browser extension nor the Android app were part of the experiment as they are usually off during web dev work.

I am currently using Local on a few projects and don’t have the time to experiment at the moment, but here are my notes so far:

Current Notes:

  • My instance of Local was installed on Win 10 64bit with the VPN turned off.
  • If I turn on the VPN, then start Local I get the recurring ‘regenerating cert’ messages.
  • If I keep the VPN off, then start Local everything is normal.
  • If I keep the VPN off, then start Local, then turn the VPN on it will NOT allow the addition of a new site (it just keeps clocking during the creation of the site).
    **- WHAT changed in my environment that recently brought about the issue? Approximately a week ago I had changed the startup setting of my VPN to start when Windows starts; but didn’t fire up Local until days later, and therefore missed connecting the dots until yesterday :wink: **
3 Likes

Ok for Windows users:

Install the docker machine CLI, then

docker-machine stop local-by-flywheel;
rm -rf ~/.docker/machine/certs;
docker-machine create local-cert-gen; 
docker-machine start local-by-flywheel;
docker-machine regenerate-certs -f local-by-flywheel; 
docker-machine rm -f local-cert-gen;
4 Likes

Hello there,

Just registered to say thanks!
That fixed my TLS loop :+1:.

Amazing. Thanks. This worked perfect for me.

Im having the same problem im on windows

1 Like

Hey @harmo

What things have been done in trying to fix things? Can you please provide your local-by-flywheel.log file? See
https://local.getflywheel.com/community/t/how-do-i-retrieve-locals-log-file/3720” for instructions on how to do so.

This did the trick for me. I believe CleanMyMac X jacked things up. It’s been fine in the past, but I noticed this time when it was running it included Local. Perhaps cleaning up some cache files or something, I’m not sure. I’m going to look into it. But, just be aware that CleanMyMac might cause some issues with its default settings.

Thank you!!! That only took 2 days to solve a 1min task.

1 Like

This saved me. Worked right away. Found this thread via https://twitter.com/JiveDig/status/1161721381828145152

TY.

1 Like

Hello, I am new here and also new at using LBF. I just started using it about a week ago. So far, everything was just great. But, today LBF did not start any more. Yesterday, everything was still fine. No update since then, nothing has actually changed. Today, it now says “Unable to verify the Docker daemon is listening”. It keeps trying to regenerate docker machine TLS certificates. Now, actually after all the steps below when I start LBF the error message appears and the it is stuck at “Starting Local Machine”. I does not even try to regenerate the certificates any more. The commands in Git bash get the same error message: “Unable to verify the Docker daemon is listening”

What did I do trying to solve it?
I updated Virtualbox from inside of Virtualbox as recommended. Nothing changed.
I then tried the following:
docker-machine stop local-by-flywheel;
rm -rf ~/.docker/machine/certs;
docker-machine create local-cert-gen;
docker-machine start local-by-flywheel;
docker-machine regenerate-certs -f local-by-flywheel;
docker-machine rm -f local-cert-gen;
But after step 1 through 3, step 4, which is starting LBF again, won’t work because of the same error message “Unable to verify the Docker daemon is listening”. Therefore, I also cannot conduct step 5 which is to regenerate the certificates and LBF cannot do it on its own although it is constantly trying to.

I am on a Windows 10 machine. I just installed git bash to execute the docker machine commands. I am not using any VPN. I also deleted the Host-Only network adapters in Virtualbox which then are supposed to be regenerated by LBF which they were not because LBF cannot connect to anything. I then repaired the VB installation via the update file that I just downloaded from inside of VB. LBF is version 3.3.0.

I just started my very first project and put a lot of work in it this week. I assumed there would be an automatic database backup file somewhere inside LBF. But this seems not to be the case. So, what can I do to get the database contents in order to not have lost my work from this week?

I hope you can help me solve it. Thanks a lot.

Update:
I had read before already that deleting the VM inside VB could maybe solve this. I was hesitant because if not the database would be lost, so I thought I ask here for help. But since noone has answered yet, I gave it shot and it worked. LBF indeed rebuilt the VM and restored the site. Solved.

1 Like

I’m having the same issue. Tried the steps:

  1. Quit Local if it’s running
  2. Open Terminal
  3. Run:
alias local-docker-machine="/Applications/Local\ by\ Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine"
  1. Run (wait for it to finish before moving onto step #5):
local-docker-machine stop local-by-flywheel; rm -rf ~/.docker/machine/certs; local-docker-machine create local-cert-gen; local-docker-machine start local-by-flywheel; local-docker-machine regenerate-certs -f local-by-flywheel; local-docker-machine rm -f local-cert-gen;
  1. Re-open Local

Still having the same issues. Help please. I don’t want to lose my work.

local-by-flywheel.log (820.9 KB)

Hey @clint2166

It definitely looks like Local is having issues communicating with the Virtual Machine. A couple of additional things that you can try:

  • Reinstall VirtualBox
  • Remove the virtual machine and restart Local

For what it’s worth, the recent work on the new version of Local will remove the VirtualBox dependency, which should prevent this sort of thing from happening in the future!

That’s just awesome!
This is very clear and worked right away!

Thanks

1 Like

This should be in the FAQ (if it isn’t). Got the looping “Regenerating docker machine tls …” message today, and this fixed it.

  • Mac OS Catalina 10.15.1
  • VirtualBox 6.0.14
  • Local 3.3.0