kamaroly

kamaroly

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

Showing Posts 1 to 4

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:

kamaroly

kamaroly OP

Thanks for jumping in @zachdaniel. I noticed that this is happening to authenticated users, and strangely, when I clear the cache and hard-reset the browser, the issues goes away.

I am using Ash + Ash Authentication phoenix with password strategy.

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?

kamaroly

kamaroly OP

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

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews