How to completely uninstall / remove a plugin

I only rebuild a few times per year. I am currently running into an issue with a plugin I do not want.

When I include the plugin repository in my app.yml file I can bootstrap but run into blank screens with the following errors:

When I comment out the plugin repository in app.yml I fail to bootstrap.

So my question is, how can I fully remove the plugin(s) and all of their remnants from my install as if it were never there in the first place?

Can you share the error in bootstrap when doing a rebuild without the plugin?

2 个赞

Here is the error when I try to bootstrap without the plugin.

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #     <Process::Status: pid 22379 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --   deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su  discourse -c 'bundle exec rake assets:precompile'"]}`

And then scrolled up I get this:

I, [2017-01-01T23:52:03.038385 #15]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
URGENT: type Failed to initialize site default
rake aborted!
ArgumentError: type

Handy with most things but I don’t know where to start with this because I bootstrap fine with the plugin.

Looks like df-core is the plugin at fault. Isn’t that one of the Discouse PRO plugins? It’s been a while since I looked at the code on those but if memory serves they contained db migrations. Not sure if that’s good or bad at the moment.

Is it possible that by removing the plugin (and thus removing the migrations) it’s throwing an error?

1 个赞

nobody knows how to just remove a plugin??

To remove a plugin, simply remove the - git clone https://github.com/... line from your app.yml file and rebuild your site via ./launcher rebuild app.

11 个赞

Would that method remove the entries the plugin would have created in the database, like tables or records?

Or when you uninstall a plugin garbage in the database would be left after it?

6 个赞

I did this method multiple times, the Fingerprint plugin will not uninstall even though it is not in my app.yml.

How to delete this anyway?

Did you rebuild after you edited your app.yml?

Did you clear you local cache?

Yes, I’ve had several rebuilds and changes since. I cleared my cache.

And you saved after you changed your app.yml :man_shrugging:

Ofcourse, otherwise plugins I installed after would not install, but they are :grinning:

In a support forum nothing is obvious :scream:

6 个赞

对于那些偶尔管理 Discourse 的用户、新手,或者为了节省时间,提供尽可能具体的信息是最有帮助的。

在这个特定案例中,app.yml 文件具体在哪里?我在 /var/discourse 中没有看到它,但确实看到了一个 app-sparkpost.yml。也许那是我大约 5 年前部署实例时创建的文件;我不确定。那是正确的路径吗?如果 /var/discourse 中没有 app.yml,Discourse 是如何知道读取这个文件的?

我不认为在 /var/discourse 本身会找到任何 YAML 文件。正确的路径应该是 /var/discourse/containers。我相信 Discourse 会读取 containers 目录下的所有文件,但工程师比我更擅长回答这个问题。我认为文件名实际上并不重要。

1 个赞

我相信 app.yml 文件位于 /var/discourse/containers/app.yml。您需要编辑该文件并移除所有与插件相关的引用。您应该能在文件中找到类似以下内容:

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-jwt.git
          - git clone https://github.com/zh99998/discourse-cross-origin.git

其中每一行 git clone 都指向 Discourse 实例中已安装的插件。编辑完文件后,您需要重新构建您的 Discourse 应用。在 /var/discourse 目录下,您可以运行 ./launcher rebuild app 来重新构建 Discourse 应用。

3 个赞

11 篇帖子已拆分到新主题:重建耗时约 3 小时