pankaj-ag

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}]

Showing Posts 1 to 2

al2o3cr

al2o3cr

The second argument there appears to be the issue - DateTime.add expects an integer, not a floating-point number. That value comes from the backoff/1 callback defined on the job - the typespec is pos_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/1 function, check what type it is returning.

pankaj-ag

pankaj-ag OP

@al2o3cr thank you so much for the quick response and fixing this issue.

— 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
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
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
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
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

Other Trending Topics Top

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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews