travisf

travisf

Liveview unable to connect to websocket

I recently updated* an application that makes minimal use of LiveView, I think we have it on two pages but one is pretty critical. Since the updates the LiveViews have been unable to connect to web sockets. I’ve seen similar issues where the error message specified a handshake error but in this case what I’m seeing is:

app-f5ba9ec5af210758132be0869eb54750.js?vsn=d:29 WebSocket connection to 'wss://example.site.com/live/websocket?_csrf_token=AXhtHDEDFSI7YgQnGXlsC3lhLjMkQB0d1A7YKZvkYOvjxLXbLVDqGvzQ&_mounts=0&vsn=2.0.0' failed: 

value	                            @	app-f5ba9ec5af210758…eb54750.js?vsn=d:29
t	                                @	app-f5ba9ec5af210758…eb54750.js?vsn=d:30
value	                            @	app-f5ba9ec5af210758…eb54750.js?vsn=d:30
(anonymous)	                        @	app-f5ba9ec5af210758…eb54750.js?vsn=d:40
t.dispatch	                        @	turbo-9350e2549702da…102154c8.js?vsn=d:6
n.notifyApplicationAfterPageLoad	@	turbo-9350e2549702da…102154c8.js?vsn=d:7
n.pageLoaded	                    @	turbo-9350e2549702da…102154c8.js?vsn=d:7
(anonymous)	                        @	turbo-9350e2549702da…102154c8.js?vsn=d:7

I’m sort of shooting in the dark on my troubleshooting. I’ve liveSocket.enableDebug() but since the websocket dosen’t connect, I’m assuming, it’s not going to give me much info. After reloading I do get, join: encountered 202 consecutive reloads but I assume that’s because it’s just tracking the attempts.

The Nginx config has not changed.

*Erlang 22.2 → 24.2
Elixir 1.10.4 → 1.13
Phoenix 1.4.17 → 1.5.13
Still using LiveView 0.13.3

First 4 of 4 Posts Switch mode

axelson

axelson

Scenic Core Team

What type of update did you make? And are there any errors on the server side?

travisf

travisf

Ah sorry, markdown took my asterisk and turned it into a bullet point. The updates were just the updates I listed at the end of my post.

As far as server side errors, I’m not seeing any in the journal. At one point, I had misconfigured the check_origin. LiveView made sure I knew about it, but that’s no longer an issue.

travisf

travisf

Oh, I finally figured it out… This was the issue, I had upgraded from plug_cowboy 1.0.0 to 2.5.2. You have to add proxy_http_version 1.1; to the location block.

travisf

travisf

A coworker with the same issue dug this up and I was properly confused by my answer… I should clarify, then I was talking about the “location block” I was referring to the Nginx config in sites-available not an Elixir thing:

server {
   ...
   location @subdomain {
        proxy_http_version 1.1;
  }
}
— All posts loaded —

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement