Comments (5)
This isn't failing on heartbeats, it fails because we receive an empty message which means EOF.
You can see that in the two lines that are empty after from = "portal"
.
If that is expected, we can just skip completely empty messages but that is a bit odd i think?
from firezone.
I think what's happening is:
- The gateway's eventloop isn't sending heartbeats every 30s
- After 60s it tries to send one but the connection is closed by GCP loadbalancer, so we get EOF
from firezone.
If I set INTERVAL
in phoenix_channel
to 61s
so that client's eventloop is also affected by this bug, we see the same behavior in the client:
connlib 14:25:37.252423-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Flushed websocket
connlib 14:25:37.397634-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone from="portal"
connlib 14:25:37.400763-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Reconnecting to portal on transient client error: failed to deserialize message: EOF while parsing a value at line 1 column 0 backoff=660.454294ms max_elapsed_time=Some(86400s)
connlib 14:25:37.505007-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone bytes=64 dst=149.112.112.112 from="device" src=100.78.41.157
connlib 14:25:38.201637-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Connected to portal host=api.firez.one
connlib 14:25:38.201905-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone {"topic":"client","event":"phx_join","payload":null,"ref":2} to="portal"
connlib 14:25:38.202153-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone {"topic":"phoenix","event":"heartbeat","payload":{},"ref":3} to="portal"
connlib 14:25:38.202444-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Flushed websocket
connlib 14:25:38.253050-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone bytes=64 dst=9.9.9.9 from="device" src=100.78.41.157
connlib 14:25:38.253427-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Flushed websocket
connlib 14:25:38.278330-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone {"event":"phx_reply","ref":2,"topic":"client","payload":{"status":"ok","response":{}}} from="portal"
connlib 14:25:38.278595-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Received empty reply for request OutboundRequestId(2)
connlib 14:25:38.278764-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone {"event":"phx_reply","ref":3,"topic":"phoenix","payload":{"status":"ok","response":{}}} from="portal"
connlib 14:25:38.279027-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone Flushed websocket
connlib 14:25:38.295420-0700 FirezoneNetworkExtensionmacOS dev.firezone.firezone {"event":"init","ref":null,"topic":"client","payload":{"interface":{"ipv6":"fd00:2021:1111::18:95aa","ipv4":"100.78.41.157","upstream_dns":[{"protocol":"ip_port","address":"9.9.9.9:53"}]},"resources":[{"id":"5377d0c2-0668-43c0-aebe-2f1daefabcb3","name":"155.138.222.187","type":"cidr","address":"155.138.222.187/32","gateway_groups":[{"id":"d1570e1e-dc01-4781-8e31-19274d755059","name":"Vultr Performance Tests | NO auto-upgrades","routing":"managed"}],"address_description":"http://155.138.222.187/"},{"id":"2c27e800-0277-49a7-987c-de6a8028d14d","name":"5.4.6.7","type":"cidr","address":"5.4.6.7/32","gateway_groups":[{"id":"7a868483-0e15-4255-a9b2-fe4c631c5ffa","name":"AWS Dev (Gateways track `main`)","routing":"managed"}],"address_description":"http://5.4.6.7/"},{"id":"f7ea6dba-564c-4c85-9fb9-01fb920a678e","name":"speed.cloudflare.com","type":"dns","address":"speed.cloudflare.com","gateway_groups":[{"id":"d1570e1e-dc01-4781-8e31-19274d755059","name":"Vultr Performance Tests | NO auto-upgrades","routing":"<…>
from firezone.
Actually, it's not GCP. It's our WebSocket in Elixir which times out after 60s of no data which is being triggered by this bug.
https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-websocket-configuration
cc @AndrewDryga
from firezone.
Fixed in #4486.
from firezone.
Related Issues (20)
- Ensure `reconnect` clears all previous backoff timers HOT 1
- One-click installer for DO
- k8s instructions
- Pulumi instructions
- Show instructions in docs for deploying Gateways for different infra
- UX audit tracking issue
- connlib: perform mangling of DNS requests to resolvers that are CIDR resources before we look up the peer HOT 1
- connlib: implement reconnect as "drop all connections and wait for new packets to trigger new ones"
- Allow FIREZONE_TOKEN to point to file HOT 1
- chore(connlib/android): revert possible Android regression from #4788
- Tracking issue for extensions to property-based state machine tests
- techdebt(connlib): use emitted events to update DNS servers in clients
- connlib: unify packet routing between CIDR and DNS resources
- Show warning if admin enters only IPv4 or IPv6 upstream resolvers
- Linux / Windows GUI client user service HOT 4
- Add a new `General` section to Settings
- Allow removing a Resource from a Site when multi-site Resources is not active
- Policy flexibility
- Allow removing Resources and Groups from a Policy
- Add resource to favorites
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firezone.