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

Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&amp;query=perfume&amp;page=2, I would like to get: ...
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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
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
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New

Other popular topics 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
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
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
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31307 143
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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

We're in Beta

About us Mission Statement