按照插件安装的标准指示操作后,重建容器一直失败

We are running standard install of Discourse on DO. Everything was ok. then we decided to add 1 plugin by following this

by adding line

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git

container is failing to be rebuilt.

--------------------
Pups::ExecError: echo "End of custom commands failed with return #<Process::Status: pid 5121 exit 2>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params "echo \"End of custom commands"
bootstrap failed with exit code 2

all commands were ran as root. I think that there the issue is

I, [2024-04-18T04:28:49.985355 #1]  INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git
Cloning into 'docker_manager'...
warning: unable to access '/root/.config/git/attributes': Permission denied
Cloning into 'discourse-templates'...
warning: unable to access '/root/.config/git/attributes': Permission denied

Please advise here

Try it without this.

I just have - git clone ...

… and that’s worked for years!

1 个赞

It says access denied. Are you sure you’re running as root?

1 个赞

I am following the install guide that published here as official Discourse plugin install guide. All plugins have a link to this guide. In my case it destroyed our install and we even can not recover it, rebuilt it even under initial yml settings.

I am pretty sure that we ran it under root. After following the instruction our install was killed and we can not rebuild it even under initial yml settings.

A failed build should not destroy anything, it will just take you offline for a bit.

The database will still be intact.

2 个赞

Will a

 ./launcher start app

get the forum running?

My best guess is that you inserted a tab or something else that makes the yml invalid.

The error is about the “echo” at the very end of the yml file, which suggests that there’s a formatting issue somewhere before that.

Did you save a copy of the file before you edited it, or have you attempted to edit it to restore it to what you think its state was before you edited it?

A thing you can try is to rename your app.yml, take note of the values (especially the SMTP stuff) and run ./discourse-setup again. That’ll give you a working app.yml.

2 个赞

this starts the forum.
Will running ./discourse-setup keep the existing forum data or I should backup first and restore it? Many thanks for your support

Yes. The existing database and such will stay in place. This is just a way to make a new app.yml.

Dear @pfaffman and @merefield thank you for your support.
there were 2 issues:

  1. critical - mistake in YML syntax, fixed by YML validator
  2. less critical - replacing sudo -E -u discourse with just git clone (under root)

that helps us to rebuild and install plugin

thanks you so much,

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.