Troubleshooting

Querying the Jobs Table

Oban.Job defines an Ecto schema and the jobs table can therefore be queried as usual, e.g.:

MyApp.Repo.all(
  from j in Oban.Job,
    where: j.worker == "MyApp.Business",
    where: j.state == "discarded"
)

Heroku

Elixir and Erlang versions

If your app crashes on launch, be sure to confirm you are running the correct version of Elixir and Erlang (view requirements). If using the hashnuke/elixir buildpack, you can update the elixir_buildpack.config file in your application's root directory to something like:

# Elixir version
elixir_version=1.9.0

# Erlang version
erlang_version=22.0.3

Available Erlang versions are available here.

Database connections

Make sure that you have enough available database connections when running on Heroku. Oban uses a database connection in order to listen for pubsub notifications. This is in addition to your Ecto Repo pool_size setting.

Heroku's Hobby tier Postgres plans have a maximum of 20 connections, so if you're using one of those plan accordingly.