AI modules suddenly stopped working

I installed the Discourse AI plugin, setup Gemini and enabled a few modules, Summarization, Sentiment, Related Topics, AI Search and Toxicity.

At first it worked great, the Summarization button showed up and generated the content.

As soon as I enabled the Sentiment and Toxicity options, the Summarization stopped working, as in the button for Summarization disappeared from all topics. The sentiment tab on the dashboard shows no data to display.

When I look at the discourse logs, I see these errors:


Job exception: ERROR:  must be owner of database discourse


rack-mini-profiler-3.3.0/lib/patches/db/pg.rb:110:in `exec' 
rack-mini-profiler-3.3.0/lib/patches/db/pg.rb:110:in `async_exec' 
mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:202:in `run' 
mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `block in run' 
mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `block in with_lock' 
activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt' 
activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize' 
activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt' 
activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize' 
mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:34:in `with_lock' 
mini_sql-1.5.0/lib/mini_sql/active_record_postgres/connection.rb:38:in `run' 
mini_sql-1.5.0/lib/mini_sql/postgres/connection.rb:181:in `exec' 
/var/www/discourse/plugins/discourse-ai/lib/embeddings/vector_representations/base.rb:154:in `create_index!' 
/var/www/discourse/plugins/discourse-ai/lib/embeddings/vector_representations/base.rb:71:in `block in consider_indexing' 
/var/www/discourse/plugins/discourse-ai/lib/embeddings/vector_representations/base.rb:49:in `each' 
/var/www/discourse/plugins/discourse-ai/lib/embeddings/vector_representations/base.rb:49:in `consider_indexing' 
/var/www/discourse/plugins/discourse-ai/app/jobs/scheduled/embeddings_backfill.rb:38:in `execute' 
/var/www/discourse/app/jobs/base.rb:297:in `block (2 levels) in perform' 
rails_multisite-5.0.0/lib/rails_multisite/connection_management.rb:82:in `with_connection'
/var/www/discourse/app/jobs/base.rb:284:in `block in perform' 
/var/www/discourse/app/jobs/base.rb:280:in `each' 
/var/www/discourse/app/jobs/base.rb:280:in `perform' 
/var/www/discourse/app/jobs/base.rb:351:in `perform' 
mini_scheduler-0.16.0/lib/mini_scheduler/manager.rb:122:in `process_queue' 
mini_scheduler-0.16.0/lib/mini_scheduler/manager.rb:70:in `worker_loop' 
mini_scheduler-0.16.0/lib/mini_scheduler/manager.rb:59:in `block (2 levels) in ensure_worker_threads' 

4 posts were split to a new topic: Discourse AI can’t set ivfflat.probes on self-hosted installs

That means your database user can’t run

on the Discourse database. I suggest checking your permissions.

I’m sorry but I’m going to have a draw a blank on this one. I simply followed the instructions on this topic (and the other AI module topics), install the plugin, rebuild discourse and configure it from the admin page.

I didn’t see any step regarding configuring user permissions. Did I miss a step or could this be some exception scenario not handled in the install/build script?

  • How do I do this?
  • Shouldn’t this be automatically be set when I install the plugin and rebuild?

@Falco any thoughts on this?

Looks like the database user on self-hosted installs lack the permissions to set this. A better way to set this is being tracked upstream, let’s wait for a fix there for a bit before trying to handle it

1 Like

Thanks for the update Falco. Could you please let me know what features or the impact of this and/or if it’s related to the log errors or some AI functionality that wont’ work; that I way I know what to expect or what won’t be working and can I need to temporarily disable those features to avoid other issues which may arise from this error.

EDIT: It looks like that number of probes being calculated based on the number of items in the database. Wondering if this could be set during a rebuild (so while the database may grow over time, each time discourse if upgraded, will optimize it until there’s a run time fix). Temporarily, at runtime check if there are SUPERUSER permissions before trying to alter it.

1 Like

This was fixed as part of the new AI quick search feature


Fantastic. Upgrading now. Is there anything I need to do to kick start the previous process?

1 Like

This topic was automatically closed after 38 hours. New replies are no longer allowed.