pankaj-ag
Hello, I recently started working on a project in Elixir. I was trying to set up Job processing using Oban.
Everything is working fine except that whenever the queue fails and retries it throws a DateTime error. Sharing the stack trace below.
Please let me know if anybody has any thoughts on this
[error] Task Oban.Queue.BSP.Producer started from pid<0.1186.0> terminating ** (FunctionClauseError) no function clause matching in DateTime.add/4 (elixir 1.10.3) lib/calendar/datetime.ex:1047: DateTime.add(-U[2020-06-01 09:11:22.192537Z], 8 0.0, :second, Calendar.UTCOnlyTimeZoneDatabase) (oban 1.2.0) lib/oban/query.ex:207: Oban.Query.retry_job/6 (oban 1.2.0) lib/oban/queue/executor.ex:102: Oban.Queue.Executor.report_failure/6
(elixir 1.10.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2 (elixir 1.10.3) lib/task/supervised.ex:35: Task.Supervised.reply/5 (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: &Oban.Queue.Executor.cal1/2 Args: [%Oban.JobI__meta__: #Ecto.Schema.Metadata<:loaded, “public”, “oban_jobs”>, args: %{“mes sage” => %{“flow” => “outbound”, “id” => 9, “recipient_id” => 6, “sender_id” => 1, “type” => "text ", “wa_status” => “delivered”}, “payload” => %{“channel” => “whatsapp”, “destination” => “91991744 3994”, “message” => “I"text":"Hii","type":"text"1”, “source” => “917834811114”, “src.name” => “Default Contact”}}, attempt: 1, attempted_at: -U[2020-06-01 09:09:35.710697Z], attempted_by: [“Pankajs—MacBook—Pro-3”, “bsp”, “1j7507q6”], completed_at: nil, discarded_at: nil, errors: , id: 5, inserted_at: —U[2020-06-01 09:09:35.704421Z], max_attempts: 3, priority: 0, queue: “gupsh up”, scheduled_at: —U[2020-06-01 09:09:35.704421Z], state: “executing”, tags: , unique: nil, wor ker: “TwoWay.Communications.BSP.Worker”}, %Oban.Config{beats_maxage: 300, circuit_backoff: 30000, crontab: , dispatch_cooldown: 5, name: Oban, node: “Pankajs—MacBook—Pro-3”, poll_interva a 1: 1000, prefix: “public”, prune: {:maxlen, 100001, prune_interval: 60000, prune_limit: 5000, queu es: [default: 10, bsp: 10, webhook: 10], repo: TwoWay.Repo, rescue_after: 60, rescue_interval: 60000, shutdown_grace_period: 15000, timezone: “Etc/UTC”, verbose: false}]
Trending in Questions
Other Trending Topics
Latest Phoenix Threads
Latest Oban Threads
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
al2o3cr
The second argument there appears to be the issue -
DateTime.addexpects an integer, not a floating-point number. That value comes from thebackoff/1callback defined on the job - the typespec ispos_integer -> pos_integer, but the examples in the documentation sometimes return a floating-point.I’ve submitted a PR to adjust the examples; if you’re using a custom
backoff/1function, check what type it is returning.pankaj-ag
@al2o3cr thank you so much for the quick response and fixing this issue.