A user is encountering a NoMethodError: undefined method 'min_tags_from_required_group' when trying to run a Discourse development instance on Ubuntu using Docker with the stable version (v2.8.8). The issue arises during the database migration process, even after attempting to resolve a previous bookmark migration error. After running rake db:drop db:create db:migrate, the user faces a PG::InsufficientPrivilege error, indicating the discourse user lacks ownership of the discourse_development database. The user, following the beginner’s guide, is unable to resolve the issue and seeks help to properly set up the development environment on Ubuntu without these database-related errors. pfaffman suggests checking the database setup and granting the discourse user appropriate permissions, but the user remains stuck and is still unable to run the application successfully. hyphalos reports the same issues on a fresh Ubuntu instance, indicating a potential setup problem. pfaffman suggests trying ./bundle exec rake db:drop db:create db:migrate, but the issue persists. pfaffman advises dropping the database manually or ensuring the discourse user has the necessary privileges.
After going sudo -s then d/rake db:drop db:create db:migrate, I got the following error:
PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
Couldn't drop database 'discourse_development'
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
Caused by:
PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
Tasks: TOP => db:drop:_unsafe
(See full trace by running task with --trace)
Hmm. Maybe just delete and recreate those databases yourself and just migrate it with the rake task. Or give the discourse user rights to create and destroy (I think that’s easier).
I’m not too familiar on the process of giving the discourse user rights to create and destroy unfortunately. In the first option though, are you saying I should just delete all these databases, then run d/rake db:create db:migrate ? Is that correct?
Thanks for your help so far! I just want to take a step back before going further into troubleshooting psql, I’m mainly aiming to just run the Discourse docker development environment (on stable) on Ubuntu, which runs fine and as expected on Mac. Shouldn’t I be able to do this without these table & migration errors? When I attempt to do a clean install I get the bookmark error, and after resolving that I get this NoMethodError, and now InsufficientPrivilege error.
Initially I thought it was because I was on test-passed then switching to stable caused the issue, but even in a clean empty Ubuntu instance, the NoMethodError still pops up, this is without any prior DBs exisiting, just did Step #1 and Step #2 here:
Are you able to install stable on Ubuntu with no issues?
Thanks for your response! Unfortunately I keep running into the same issue:
d/bundle exec rake db:drop db:create db:migrate
PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
Couldn't drop database 'discourse_development'
rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Caused by:
PG::InsufficientPrivilege: ERROR: must be owner of database discourse_development
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:drop:_unsafe
(See full trace by running task with --trace)
I’ve attempted this on an empty instance (restarted from the start, no existing DBs or information) using the beginner’s guide and it renders the same result.
Then you’ll need to drop the database some other way. You can Google stuff about postgres (that’s what I do when I need to do it) or wait for someone who can remember to post here. The other option is to see that the discourse user has rights to drop and create databases.