kamaroly

kamaroly

Liveview remount continuously with the follow error. What could be wrong

Hi all,
I just deployed an app to production, but it is behaving in a wild way. The liveview pages show that something went wrong, but sometimes it works well. I checked the log and found the following. It looks like it keeps trying to mount the view continuously. It is happening in most of the view.

What could I be doing wrong?
Here is how the liveview mount looks like.

  def mount(%{"person_id" => person_id}, _session, %{assigns: %{user: user}} = socket) do
    person = get_record(person_id, actor: user)

    socket
    |> assign(:record_id, nil)
    |> assign(:person, person)
    |> assign(:jobs, person.jobs)
    |> assign(:person_id, person_id)
    |> assign_mobile_header_actions()
    |> ok(layout: {ZippikerWeb.Layouts, :employee})
  end

Here are logs:

 Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "vsn" => "2.0.0"}
20:31:55.383 [info] CONNECTED TO Phoenix.LiveView.Socket in 47µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "vsn" => "2.0.0"}
20:31:55.532 [info] CONNECTED TO Phoenix.LiveView.Socket in 47µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "vsn" => "2.0.0"}
20:31:55.719 [info] CONNECTED TO Phoenix.LiveView.Socket in 34µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "vsn" => "2.0.0"}
20:31:55.977 [info] CONNECTED TO Phoenix.LiveView.Socket in 34µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "vsn" => "2.0.0"}
20:31:58.214 [info] CONNECTED TO Phoenix.LiveView.Socket in 56µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "CUoCJBwyCR8DBHEeLCQHECogFxksFQk6cxZAy_k2gF5KGg4RbSeKxZNM", "_live_referer" => "undefined", "_mount_attempts" => "3", "_mounts" => "0", "_track_static" => %{"0" => "https://zippiker.com/assets/app-38549519718ce176d5d8a730d0671ae3.css?vsn=d", "1" => "https://zippiker.com/assets/app-22ba20c83c6a2e1e3c5dd785acf8c039.js?vsn=d"}, "token" => "SFMyNTY.g2gDaAR3AnYxbQAAABZ0VFpZVjUzTEZ5emhVYi8rVWhPMW9BWHcRYXBwXzQwMjBAemlwcGlrZXIAABXoAAAAAGdA60ZtAAAALHBoeDpscDpxVmxPR3hXdnRNMVEzaU9BT0FIOVl3PT0xNzMzNDMwNzE1OTc2bgYASaaFmJMBYgASdQA.l9vdKwPLPB9Bo5ApQNnhnnd7ozgPrXxgi4kVZcpPd6U", "vsn" => "2.0.0"}
20:32:00.534 [info] CONNECTED TO Phoenix.LiveView.Socket in 51µs
  Transport: :longpoll

Marked As Solved

kamaroly

kamaroly

I had a logical error in the require_authenticated_user/2. I fixed it.

Also Liked

zachdaniel

zachdaniel

Creator of Ash

I don’t think this is necessarily an Ash-specific question, so I will move to the LiveView forums. Unless there is some kind of exception coming from the Ash code you’re calling in your LiveView (which would cause repeated mounts in this way potentially), I’m not sure what to tell you :sweat:

zachdaniel

zachdaniel

Creator of Ash

:thinking: strange…I mean the first thing to look for would be client side or server side errors. Anything in the server logs? Anything in the browser errors?

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

We're in Beta

About us Mission Statement