I can't create a new site after reinstall of Local

Issue Summary

I’ve reinstalled ancient version of Local by Flywheel with recent Local (Lighting) and I can’t create a new site. Error related to the mysql appears

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?
    All and any site.

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?


I follow the site creation wizard, it starts provisioning and fails with the following error displayed:

Error: Command failed: /Applications/Local.app/Contents/Resources/extraResources/lightning-services/mysql-8.0.16+5/bin/darwin/bin/mysqladmin --password= ping
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
amysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/Volumes/.../Library/Application Support/Local/run/R5h2eWPSr/mysql/mysqld.' (2)'
Check that mysqld is running and that the socket: '/Volumes/.../Library/Application Support/Local/run/R5h2eWPSr/mysql/mysqld.sock' exists!

    at ChildProcess.exithandler (child_process.js:304:12)
    at ChildProcess.emit (events.js:223:5)
    at ChildProcess.EventEmitter.emit (domain.js:475:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

System Details

  • Which version of Local is being used?

    • 5.9.7+5156
  • What Operating System (OS) and OS version is being used?

    • MacOS Mojave 10.14.6
  • Attach the Local Log. See this Community Forum post for instructions on how to do so:

I’ve checked the Library addresses and the socket file mentioned in the error is indeed not there. These are the files that I found there:

~/Library/Application\ Support/Local/run/R5h2eWPSr/mysql/
└── data
    ├── #innodb_temp
    ├── auto.cnf
    ├── binlog.000001
    ├── binlog.000002
    ├── binlog.000003
    ├── binlog.000004
    ├── binlog.index
    ├── ca-key.pem
    ├── ca.pem
    ├── client-cert.pem
    ├── client-key.pem
    ├── ib_buffer_pool
    ├── ib_logfile0
    ├── ib_logfile1
    ├── ibdata1
    ├── mysql
    │   ├── general_log.CSM
    │   ├── general_log.CSV
    │   ├── general_log_201.sdi
    │   ├── slow_log.CSM
    │   ├── slow_log.CSV
    │   └── slow_log_202.sdi
    ├── mysql.ibd
    ├── performance_schema
    │   ├── accounts_138.sdi
    │   ├── cond_instances_77.sdi
    │   ├── data_lock_waits_154.sdi
    │   ├── data_locks_153.sdi
    │   ├── events_errors_su_132.sdi
    │   ├── events_errors_su_133.sdi
    │   ├── events_errors_su_134.sdi
    │   ├── events_errors_su_135.sdi
    │   ├── events_errors_su_136.sdi
    │   ├── events_stages_cu_104.sdi
    │   ├── events_stages_hi_105.sdi
    │   ├── events_stages_hi_106.sdi
    │   ├── events_stages_su_107.sdi
    │   ├── events_stages_su_108.sdi
    │   ├── events_stages_su_109.sdi
    │   ├── events_stages_su_110.sdi
    │   ├── events_stages_su_111.sdi
    │   ├── events_statement_112.sdi
    │   ├── events_statement_113.sdi
    │   ├── events_statement_114.sdi
    │   ├── events_statement_115.sdi
    │   ├── events_statement_116.sdi
    │   ├── events_statement_117.sdi
    │   ├── events_statement_118.sdi
    │   ├── events_statement_119.sdi
    │   ├── events_statement_120.sdi
    │   ├── events_statement_121.sdi
    │   ├── events_statement_122.sdi
    │   ├── events_statement_123.sdi
    │   ├── events_transacti_124.sdi
    │   ├── events_transacti_125.sdi
    │   ├── events_transacti_126.sdi
    │   ├── events_transacti_127.sdi
    │   ├── events_transacti_128.sdi
    │   ├── events_transacti_129.sdi
    │   ├── events_transacti_130.sdi
    │   ├── events_transacti_131.sdi
    │   ├── events_waits_cur_78.sdi
    │   ├── events_waits_his_79.sdi
    │   ├── events_waits_his_80.sdi
    │   ├── events_waits_sum_81.sdi
    │   ├── events_waits_sum_82.sdi
    │   ├── events_waits_sum_83.sdi
    │   ├── events_waits_sum_84.sdi
    │   ├── events_waits_sum_85.sdi
    │   ├── events_waits_sum_86.sdi
    │   ├── file_instances_87.sdi
    │   ├── file_summary_by__88.sdi
    │   ├── file_summary_by__89.sdi
    │   ├── global_status_172.sdi
    │   ├── global_variables_175.sdi
    │   ├── host_cache_90.sdi
    │   ├── hosts_139.sdi
    │   ├── keyring_keys_145.sdi
    │   ├── log_status_165.sdi
    │   ├── memory_summary_b_147.sdi
    │   ├── memory_summary_b_148.sdi
    │   ├── memory_summary_b_149.sdi
    │   ├── memory_summary_b_150.sdi
    │   ├── memory_summary_g_146.sdi
    │   ├── metadata_locks_152.sdi
    │   ├── mutex_instances_91.sdi
    │   ├── objects_summary__92.sdi
    │   ├── performance_time_93.sdi
    │   ├── persisted_variab_178.sdi
    │   ├── prepared_stateme_166.sdi
    │   ├── replication_appl_158.sdi
    │   ├── replication_appl_159.sdi
    │   ├── replication_appl_160.sdi
    │   ├── replication_appl_161.sdi
    │   ├── replication_appl_163.sdi
    │   ├── replication_appl_164.sdi
    │   ├── replication_conn_155.sdi
    │   ├── replication_conn_157.sdi
    │   ├── replication_grou_156.sdi
    │   ├── replication_grou_162.sdi
    │   ├── rwlock_instances_94.sdi
    │   ├── session_account__144.sdi
    │   ├── session_connect__143.sdi
    │   ├── session_status_173.sdi
    │   ├── session_variable_176.sdi
    │   ├── setup_actors_95.sdi
    │   ├── setup_consumers_96.sdi
    │   ├── setup_instrument_97.sdi
    │   ├── setup_objects_98.sdi
    │   ├── setup_threads_99.sdi
    │   ├── socket_instances_140.sdi
    │   ├── socket_summary_b_141.sdi
    │   ├── socket_summary_b_142.sdi
    │   ├── status_by_accoun_168.sdi
    │   ├── status_by_host_169.sdi
    │   ├── status_by_thread_170.sdi
    │   ├── status_by_user_171.sdi
    │   ├── table_handles_151.sdi
    │   ├── table_io_waits_s_100.sdi
    │   ├── table_io_waits_s_101.sdi
    │   ├── table_lock_waits_102.sdi
    │   ├── threads_103.sdi
    │   ├── user_defined_fun_179.sdi
    │   ├── user_variables_b_167.sdi
    │   ├── users_137.sdi
    │   ├── variables_by_thr_174.sdi
    │   └── variables_info_177.sdi
    ├── private_key.pem
    ├── public_key.pem
    ├── server-cert.pem
    ├── server-key.pem
    ├── sys
    │   └── sys_config.ibd
    ├── undo_001
    └── undo_002

5 directories, 131 files

EDIT: I’ve edited my previous messages, obscuring personal details and adding a log file.

That folder is where Local stores the raw DB files for the site, so be careful when doing anything within those run folders.

Taking a closer look at the Local log, I’m seeing errors like this:

nginx: [emerg] too long path in the unix domain socket in upstream "unix:%%site.runData%%/php/php-fpm.socket" in %%site.runData%%/conf/nginx/site.conf:2
2021-01-07T10:51:31.439445Z 0 [ERROR] [MY-010267] [Server] The socket file path is too long (> 103): %%site.runData%%/mysql/mysqld.sock

Looking at the path you mentioned before the edit (I’ve replaced, your specifics with xes)

/Volumes/xxxxxxxxxxx/Users/xxxxxxxxxxx/Library/Application\ Support/Local/run/R5h2eWPSr/mysql/mysqld.sock

it looks like it’s much longer than the default path that Local uses:

/Users/xxxxxxxxxxx/Library/Application\ Support/Local/run/R5h2eWPSr/mysql/mysqld.sock

Have you moved the home directory to a different partition of the computer? Is there any way you can make changes so that the user directory is mounted at root?

I did recover form a crashed hard drive and it wasn’t a smooth ride. What exactly do you mean by: Is there any way you can make changes so that the user directory is mounted at root?

I can log in as a root, but what do you want me to do? I don’t follow.

I’m not sure I know what specifically to do either :sweat_smile:

Since this is a recovery from a hard-drive failure, I wonder if you can get things working by completely wiping out Local’s configuration folder and re-installing Local. Hopefully that will get things back to a clean slate. The general flow would look like:

  1. Quit Local if it’s running
  2. Take a backup of the ~/Library/Application\ Support/Local folder. Either copy it somewhere else or compress it to a file
  3. Delete the ~/Library/Application\ Support/Local folder
  4. Start Local and try to create a new site

If that gives you a site that works, then you should be able to restore the original site to a new one in Local by using a backup of the site, or by using the files for the site by following the steps outlined in the “Restoring From Only Local Site files” section of this help doc:

Can you give that a shot and let me know how that goes?

I’ve tried that, but I end up with the same error message.

Trying to keep this ticket alive… I still couldn’t get it resolved

How can I wipe clean anything and everything that might have ever existed on my hard drive related to Local? So I can attempt a clean install?

The only way to completely clear out Local’s settings is to remove Local’s configuration folder:

~/Library/Application\ Support/Local

The latest version of Local doesn’t store any additional information in other locations.

Local Classic (under 3.3.1) stored configuration in a similar location, but it wouldn’t emit this sort of error of the unix path being too long. For completeness though, here’s where the classic configuration is located:

~/Library/Application\ Support/Local\ by\ Flywheel

Additionally, since Classic made use of Boot2Docker, you can find the Classic VM in:

  1. I’ve uninstalled Local (Lightning), I’ve deleted the ~/Local\ Sites, ~/Library/Application\ Support/Local, ~/.docker/machine/machines/local-by-flywheel. The ~/Library/Application\ Support/Local\ by\ Flywheel was already gone.
  2. I’ve installed the new version of Local Lightning using brew install --cask local
  3. When I try to create a site using my user account, I get the error mentioned in the original post
  4. If I try to do it from another account on my computer. It works, except I get a warning that I can’t use local domains that there’s some conflict on port 80 and whether I’d like to use localhost instead BUT the site gets created.
    There’s a port conflict with this site’s domain. Learn more. >Use Localhost<
  5. However, if I try to access the site (after enabling the localhost routing mode), I get Error 402

I got it working for the other user on my computer. Now, I just need to get it working under my user. What am I missing? Why does it keep happening even if I wipe out all the related files from the Library, etc.???

I really don’t get it, why it’s not working on my normal user and how come I can’t do a clean install. I would really rather NOT migrate to a clean account. Anything you can suggest to clean my current one?

I’m not 100% sure why it’s not working for the current user.

The only thing that stands out to me is the second item – installing using Brew. I’ve never done that, but maybe it works?

Can you try manually downloading and installing local from the releases page:

I think the brew cask points to Local 3.x

I was wondering that too, but from the site, it appears that it should be pulling in the latest version of Local:

That being said, I don’t know enough about Homebrew to know if the zap section is correct. I can tell you that these values relate to Classic:

1 Like

So I was able to install Local 5.9.9 via homebrew.

I also sent a PR zap trash, https://github.com/Homebrew/homebrew-cask/pull/100072

1 Like

And already merged. :boom:

:slightly_frowning_face: I needed another PR to update the preferences and saved state locations.

Now merged.

Do you know what zap trash does? Is that basically what brew needs to do if you uninstall something, or is it used during the update/upgrade process?

The brew zap command is used to completely uninstall an app without leaving the miscellaneous settings, etc. behind. Think of it as a clean uninstall.

1 Like

I’ve uninstalled Local using

brew uninstall --zap local
==> Implied `brew uninstall --cask local`
==> Backing App 'Local.app' up to '/usr/local/Caskroom/local/5.9.9,5246/Local.app'
==> Removing App '/Applications/Local.app'
==> Dispatching zap stanza
==> Trashing files:
~/Library/Application Support/Local
~/Library/Saved Application State/com.getflywheel.lightning.local.savedState
==> Removing all staged versions of Cask 'local'

and then tried to install it from the package downloaded from the release page. => same result as my original post.