thawke

thawke

ArgumentError When Using Generic Action In scheduled_actions

When I try to create a scheduled_actions - schedule in a Resource I get the following error:

15:32:00.625 [error] GenServer {Oban.Registry, {Oban, {:plugin, Oban.Plugins.Cron}}} terminating
** (ArgumentError) comparing `field(j, ^field)` with `nil` is forbidden as it is unsafe. If you want to check if a value is nil, use is_nil/1 instead
    (ecto 3.13.3) lib/ecto/query/builder.ex:1265: Ecto.Query.Builder.not_nil!/2
    (oban 2.20.1) lib/oban/engines/basic.ex:511: anonymous fn/4 in Oban.Engines.Basic.unique_field/2
    (ecto 3.13.3) lib/ecto/query/builder/dynamic.ex:83: Ecto.Query.Builder.Dynamic.expand/3
    (stdlib 7.1) lists.erl:2673: :lists.mapfoldl_1/3
    (stdlib 7.1) lists.erl:2674: :lists.mapfoldl_1/3
    (elixir 1.18.4) lib/macro.ex:610: Macro.do_traverse/4
    (ecto 3.13.3) lib/ecto/query/builder/dynamic.ex:53: Ecto.Query.Builder.Dynamic.fully_expand/2
    (ecto 3.13.3) lib/ecto/query/builder/filter.ex:133: Ecto.Query.Builder.Filter.filter!/7
Last message: :evaluate
State: %Oban.Plugins.Cron{conf: %Oban.Config{dispatch_cooldown: 5, engine: Oban.Engines.Basic, get_dynamic_repo: nil, insert_trigger: true, log: false, name: Oban, node: "nixos", notifier: {Oban.Notifiers.Postgres, []}, peer: {Oban.Peers.Database, []}, plugins: [{Oban.Plugins.Cron, [crontab: [{"* * * * *", Helpdesk.Support.Ticket.TestActionWorker, []}]]}], prefix: "public", queues: [default: [limit: 10], ticket_test_action: [limit: 10]], repo: Helpdesk.Repo, shutdown_grace_period: 15000, stage_interval: 1000, testing: :disabled}, timer: #Reference<0.4199275419.3126067205.218179>, crontab: [{"* * * * *", #Oban.Cron.Expression<input: "* * * * *", ...>, Helpdesk.Support.Ticket.TestActionWorker, []}], timezone: "Etc/UTC"}

The simplest reproduction that I can make that throws the error is as follows:

defmodule Helpdesk.Support.Ticket do
  use Ash.Resource,
    otp_app: :helpdesk,
    domain: Helpdesk.Support,
    extensions: [AshOban]

  oban do
    domain Helpdesk.Support

    scheduled_actions do
      schedule :test_action, "* * * * *" do
        worker_module_name Helpdesk.Support.Ticket.AshOban.ActionWorker.TestAction
      end
    end
  end

  actions do
    action :test_action do
      run fn _input, _ ->
        IO.inspect("Ran the text action")
        :ok
      end
    end
  end
end

I’ve tried using the main branch in ash_oban from Github and I still get the same error.

Marked As Solved

zachdaniel

zachdaniel

Creator of Ash

:thinking: I’m not sure if this is something underlying in Oban or on our end…more likely to be us than them. Could you please create a reproduction repository and open an issue on AshOban?

Where Next?

Popular in Questions Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
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
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
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
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
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
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
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
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
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

We're in Beta

About us Mission Statement