通过 Web UI 升级失败,并出现此错误:
INFO -- : > cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate'
discourse@discourse ERROR: permission denied to create extension "unaccent"
discourse@discourse HINT: Must be superuser to create this extension.
discourse@discourse STATEMENT: CREATE EXTENSION IF NOT EXISTS unaccent
rake aborted!
PG::InsufficientPrivilege: ERROR: permission denied to create extension "unaccent"
HINT: Must be superuser to create this extension.
很久以前我编辑了我的 app.yml,这可能是导致问题的原因:
templates:
# 注释掉以解决磁盘空间问题
#- "templates/postgres.template.yml"
- "templates/postgres.10.template.yml"
我很久以前就做了这个更改,所以除了那个注释之外,我不记得当时的情况了。
我搁置了这个问题,并通过编辑 app.yml 的版本到 v2.8.0beta8 来尝试恢复到我收到更新错误之前的 discourse 版本,但这失败了:
Pups::ExecError: cd /var/www/discourse & git checkout v2.8.0.beta8 failed with return #<Process::Status: pid 1843 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["git reset --hard", "git clean -f", "git remote set-branches --add origin main", "git remote set-branches origin $version", "git fetch --depth 1 origin $version", "git checkout $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p /shared/log/rails", "bash -c \"touch -a /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln -s /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p /shared/{uploads,backups}\"", "bash -c \"ln -s /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p /shared/tmp/{backups,restores}\"", "bash -c \"ln -s /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp\"", "find public/plugins/ -maxdepth 1 -xtype l -delete"])}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
5b66f706de1a3ce8d78f0ed886669095c1a356efd916cb2ae8b02171367b0a01
所以我认为我需要升级 postgres 从 10,或者降级 discourse 到 2.8.0beta8,但两者都失败了。我该怎么办?