Getting insufficient privilege permission error after upgrading Oban pro to 1.4.x

After upgrading Oban pro from 1.2 to 1.4, we are getting a insufficient privilege DB error. Below is the error

** (Postgrex.Error) ERROR 42501 (insufficient_privilege) permission denied for schema global
2025-01-07T08:55:08.527998+00:00 app[b'app-5fcc64cc44-zvmh6']: web.1  |     (oban_met 0.1.11) lib/oban/met/reporter.ex:139: Oban.Met.Reporter.create_estimate_function/1
2025-01-07T08:55:08.528040+00:00 app[b'app-5fcc64cc44-zvmh6']: web.1  |     (stdlib 6.2) gen_server.erl:2345: :gen_server.try_handle_info/3
2025-01-07T08:55:08.528046+00:00 app[b'app-5fcc64cc44-zvmh6']: web.1  |     (stdlib 6.2) gen_server.erl:2433: :gen_server.handle_msg/6
2025-01-07T08:55:08.528067+00:00 app[b'app-5fcc64cc44-zvmh6']: web.1  |     (stdlib 6.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3```

The user has CRUD permissions for the global schema already
@sorentwo Any idea on this?

The issue is coming from oban_met. It’s trying to create an estimate function, automatically. There is an option to disable this in the upcoming v1.0 release.
For now, pin to v0.1.7

https://oban.pro/docs/met/0.1.11/changelog.html#v0-1-8-2024-09-18

I ran following for the db user

GRANT ALL PRIVILEGES ON SCHEMA global TO db_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA global TO db_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA global TO db_user;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA global TO db_user;

And the errors were stopped. So i think it didnt have postgres functions privilege. How important is creating estimate function by oban_met since it will be optional later.

It’s important with larger oban_jobs tables. It’s a performance enhancement. Not critical.
Def better to have it, if possible.

2 Likes