MailPit not starting On OSX

Bug Summary

Mailpit is not starting and has to be ‘installed’ every other time. If the links becomes available it is not clickable and the console shows the following error:

app.js:288 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘ports’)
at f. (app.js:288:207083)
at ()
at o (app.js:288:206440)


client.js:446 WebSocket connection to ‘ws://’ failed: Error during WebSocket handshake: Sent non-empty ‘Sec-WebSocket-Protocol’ header but no response was received

Summarize the issue in one to two sentences.

Steps to reproduce

As precisely as you can, list the steps it takes to reliably reproduce the issue.

Environment Info

Describe your environment.

  • What Operating System are you using?

  • What versions of site software (Nginx, Apache, PHP, MySQL) is used?

  • What version of Local is installed?
    8.3.2 +66xx

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

Include any screenshots or video recordings of the issue to help others reproduce.

Mailpit is not starting and has to be ‘installed’ every other time

So half of the time it’s working? Are all of these sites using the same configurations?

Thanks for this report, @sebastian.

If you haven’t restarted Local since upgrading, it would be worth doing that — Local should copy the mailpit binary when it first starts to prevent that installation warning.

If you’ve already tried that, does this happen for newly-created sites, or just existing ones?

If it’s just existing ones, please can you share your sites.json file? On macOS you’ll find it at ~/Library/Application\ Support/Local/.

1 Like

Hi Nick,
thanks for following up. First to answer you previous question: It does not work 100% of the time, but only shows it clickable 50% of the time. Clicking on the link (when it does show as clickable) however does not result in a new window or any action.

This holds true for ALL sites even though it shows it ‘installed’ (aka clickable). One site (I believe now called ‘client1’) this appears all of the time.

I hopefully properly sanitized the json file (I only changed client names and my username in the URL). And attached that below as well.

[edited by nickc to remove local_sites.json after it was provided]

Thanks for sharing your sites.json, @sebastian. It looks correct to me.

One thing you can try is to force Local to recopy the mailpit binary on startup (steps below assume macOS, Windows users reading this should follow these instructions instead).

  1. Stop any running sites.
  2. Quit Local.
  3. Open the Finder and choose Go → Go To Folder…
  4. Enter ~/Library/Application Support/Local/lightning-services and press Enter.
  5. Delete the folder named ‘mailpit-1.12.1+0’, but leave the Finder window open.
  6. Make sure any antivirus or security software is either disabled or allows Local to run unrestricted. (This is rarer on Mac than on Windows, but mentioning it just in case.)
  7. Start Local.

Local should recreate the folder named ‘mailpit-1.12.1+0’ which should be visible in the Finder window you left open. The contents of the mailpit folder should look like this:

├── bin
│   └── darwin
│       └── mailpit
├── lib
│   ├── MailpitService.js
│   └── main.js
└── package.json

If Local does not recreate the folder as described, or if you still see “missing mailpit” when starting Local, please share your Local logs so that we can investigate further.


Hi @nickc
thanks for the reply and I can report back that did the trick! Mailpit reinstalled (as you outlined) and now the error messages is gone. I can also launch mailpit when clicking the link.
Thanks for the help


Great, thanks for letting us know, @sebastian.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.