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.