# MWClient cannot connect to MWServer (localhost)

**URL:** <https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922>\
**Category:** Support\
**Created:** [October 18, 2023, 8:03pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922 "2023-10-18T20:03:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![histed](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@histed](https://mworks.discourse.group/u/histed)\
**Post date:** [October 18, 2023, 8:03pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/1 "2023-10-18T20:03:47Z")

</div>

Hi Chris,

With MWServer listening address set to ‘localhost’ and MWClient connecting to ‘localhost’, Client fails to connect.

Changing both addresses to 127.0.0.1 works.

Chris, for supporting this across rig machines, we’d prefer to either use localhost or tell everyone to use 127.0.0.1.

I suspect this is a ipv4 / ipv6 issue. any advice?

best!

Mark

Mac OS Ventura 13.6 (22G120)  
MWorks 2023.03.01

 ![image.jpg](https://canada1.discourse-cdn.com/flex031/uploads/mworks/original/1X/8ddfbb8d5cf79c0025867e9c4ea4a96c714b8c41.jpeg)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 19, 2023, 1:39pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/2 "2023-10-19T13:39:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 19, 2023, 1:39pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/3 "2023-10-19T13:39:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 19, 2023, 1:39pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/4 "2023-10-19T13:39:49Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 19, 2023, 1:50pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/5 "2023-10-19T13:50:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 19, 2023, 2:00pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/6 "2023-10-19T14:00:46Z")

</div>

Hi Mark,

There’s a [known issue](https://github.com/mworks/mworks-issues/issues/445), observed by me and at least one other user, where the client occasionally fails to connect. In my experience, this always seems to happen immediately after a macOS restart, but I’m not certain that’s a required precondition. I’ve found that the only solution is to restart the Mac again, after which the client connects normally.

This has been a difficult issue to investigate, because it doesn’t happen very often. I think you may be right that it’s related to IPv6 somehow, but I don’t know if the issue lies in the OS, ZeroMQ, or somewhere else. I don’t think I’ve tried switching from “localhost” to “127.0.0.1” as a workaround, but I will the next time it happens to me.

For now, can you see if restarting your Mac resolves the problem? If it does, then I suspect you’re experiencing the same issue.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![Nina\_Friedman](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@Nina\_Friedman](https://mworks.discourse.group/u/Nina_Friedman)\
**Post date:** [October 19, 2023, 3:45pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/7 "2023-10-19T15:45:25Z")

</div>

Hi Chris,

Thank you, this helps. I can continue to note when this happens. I have not restarted my Mac since the issue arose, but now I am connecting to localhost just fine. Yesterday I was connecting to 127.0.0.1.

Nina

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 23, 2023, 9:04pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/8 "2023-10-23T21:04:49Z")

</div>

Hi Nina,

> I have not restarted my Mac since the issue arose, but now I am connecting to localhost just fine. Yesterday I was connecting to 127.0.0.1.

That’s interesting. So maybe the issue, whatever it is, can resolve itself given some time? I haven’t ever waited to find out, but I will try to (by using 127.0.0.1 as a workaround) next time it crops up for me.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![histed](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@histed](https://mworks.discourse.group/u/histed)\
**Post date:** [October 25, 2023, 12:43am UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/9 "2023-10-25T00:43:10Z")

</div>

It could be related to our VPN software disconnecting and connecting, which appears to rewrite hostnames and local hostname lookups (like /etc/hosts though I’m not sure it uses that mechanism.)  
It’s the Cisco AnyConnect VPN.

I guess we can just advise everyone in the lab to use 127.0.0.1 and unless Mac OS X phases out ipv4 localhost lookups, it should work, yes?

Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 25, 2023, 9:27pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/10 "2023-10-25T21:27:32Z")

</div>

Hi Mark,

> It could be related to our VPN software disconnecting and connecting, which appears to rewrite hostnames and local hostname lookups

It does seem like that could cause issues. That said, the connection failures I’ve seen have happened without any VPN software running.

> I guess we can just advise everyone in the lab to use 127.0.0.1 and unless Mac OS X phases out ipv4 localhost lookups, it should work, yes?

Yes, `127.0.0.1` should work. If the issue is with resolving the name “localhost”, it’s possible that `::1` (the IPv6 equivalent of `127.0.0.1`) would work, too.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![histed](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@histed](https://mworks.discourse.group/u/histed)\
**Post date:** [October 25, 2023, 11:08pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/11 "2023-10-25T23:08:14Z")

</div>

Is there any advantage to connecting via ipv4 or ipv6?  
For future proofing?

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 26, 2023, 3:56pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/12 "2023-10-26T15:56:23Z")

</div>

> Is there any advantage to connecting via ipv4 or ipv6?

Well, `::1` is fewer characters 🙂. Apart from that, probably not, especially since you’re just connecting to the loopback interface. Specifying “localhost” is nice, because the system can figure out whether it should resolve to an IPv4 or IPv6 address. But if that’s going to fail, then `127.0.0.1` or `::1` should be equally good.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [April 2, 2024, 1:25pm UTC](https://mworks.discourse.group/t/mwclient-cannot-connect-to-mwserver-localhost/922/13 "2024-04-02T13:25:07Z")

</div>


