Tried to install plugin destroyed site, can't run rebuild

I was trying to install the format plugin, however I placed the code in the wrong spot and when I rebuilt and loaded the site the plugin wasn’t initializing. So I figured out the mistake, removed it…and it said there was an error on a line. So I found the error on the line and ran it through yamllint, matched up, removed the plugin…but now rebuild work. It keeps giving a persistent error, and while I can load the front page of the site I cannot load any topics, or anything else.

This is from the rebuild and the doctor

Summary
FAILED
--------------------
NoMethodError: undefined method `each' for nil:NilClass
Location of failure: /pups/lib/pups/config.rb:99:in `run_commands'
dfd33a9a3be65ddb9a1fd19c19e5034a44c39f46e330ccdf0533f4f66d7d0005
** 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.
root:/var/discourse# ./discourse-doctor
DISCOURSE DOCTOR Thu Jul 16 07:53:05 UTC 2020
OS: Linux itsbx 4.15.0-99-generic #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux



==================== SERIOUS PROBLEM!!!! ====================
app not running!
Attempting to rebuild
==================== REBUILD LOG ====================
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
cd /pups && git pull && /pups/bin/pups --stdin
Already up to date.
I, [2020-07-16T07:53:23.985444 #1]  INFO -- : Loading --stdin


FAILED
--------------------
NoMethodError: undefined method `each' for nil:NilClass
Location of failure: /pups/lib/pups/config.rb:99:in `run_commands'
2386f66f76d9c9ffbbcd02bfad9e0530683714d433bff8d70976cae6c4b8fc86
** 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.
==================== END REBUILD LOG ====================
Failed to rebuild app.

Checking your domain name . . .

Connection to yoursite succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . .

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: driver failed programming external connectivity on endpoint app (39c7d5a80e10058bc952825fccd073af0f2ff12857895aa1046a6615d879a5a0): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use
Error: failed to start containers: app
Failed to restart the container.


==================== PLUGINS ====================
          - git clone github.com/discourse/docker_manager.git

No non-official plugins detected.

See thub.com/discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
**Discourse version at myhost: NOT FOUND**
**Discourse version at localhost: NOT FOUND**


==================== MEMORY INFORMATION ====================
RAM (MB): 2041

              total        used        free      shared  buff/cache   available
Mem:           1993         144        1237           0         611        1677
Swap:          2047          76        1971

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        49G   11G   38G  22% /

==================== DISK INFORMATION ====================
Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3980448C-AF15-4833-A022-C759F0D2D80A

Device      Start       End   Sectors  Size Type
/dev/vda1  227328 104857566 104630239 49.9G Linux filesystem
/dev/vda14   2048     10239      8192    4M BIOS boot
/dev/vda15  10240    227327    217088  106M Microsoft basic data

Partition table entries are not in disk order.

==================== END DISK INFORMATION ====================

I have absolutely no idea what to do but the site is completely destroyed right now. I removed the links because I can only use 3 a post but they’re in there. The rebuilds kept working fine UNTIL I removed the plugin I put in the complete wrong spot, then everything just stopped. It had messed up a couple lines but I confirmed it was fixed. I’m at a COMPLETE loss. I just tried to rerun setup and confirm all the settings, it went fine but failed on rebuild again…

Alright so after trying to rerun and edit things for hours I finally tried

./launcher start app and it’s run fine, and the plugin is installed (though I thought I edited it out?). Whatever. However now I’m afraid to try the rebuild or install anything further as I don’t know what exactly caused this, or even what was fixed. So any insight would still be appreciated

It’s impossible to tell from your description what might have been the problem, but if the last rebuild worked, the next one very likely will as well.

He just started an old image with ./launcher start app I guess.

@Kartoon you can probably try rebuilding, if it fails, You would still be able to resume the last known good image through the same command.

2 Likes

Sorry I had a bit of an emergency and couldn’t check this topic.

The rebuild DID NOT work, and I tried again today and it didn’t either. The site is working fine after the “./launcher start app”, but anytime I attempt to rebuild it fails, as well as errors from the discourse doctor. I can post the log it provides me if that helps, but clearly something is still wrong and I’m worried that’s going to lead to a problem somewhere down the line.

It sounds like you have a formatting error in your yml file.

It can be difficult to find and recognize such errors. There are tools that will check.

What I usually do when adding a plugin is copy/paste an existing plugin line and edit the github URL. That way you minimize the likelihood that you’ll break something.

That’s what I assumed and initially it was wrong but I referred to http://www.yamllint.com/ to fix the errors that resulted from me originally placing the plugin text in the wrong places and it comes back as completely fine, I’ve checked numerous times throughout the process (both specific pieces and the entire thing) and it has said it’s right. Unless that site is inaccurate for whatever reason which for all I know is possible I’m not that knowledgeable about it.

This is what I get when I try to rebuild and followed is when I run discourse doctor (both as of five minutes ago). I removed personal information but in the actual log it’s all there and correct

rebuild app

Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container

  • /usr/bin/docker stop -t 60 app
    app
    cd /pups && git pull && /pups/bin/pups --stdin
    Already up to date.
    I, [2020-07-23T22:58:14.812604 #1] INFO – : Loading --stdin

FAILED

NoMethodError: undefined method each' for nil:NilClass Location of failure: /pups/lib/pups/config.rb:99:in run_commands’
1a575aa2a169fcb4a9bbb0874c55d3fd01ee1e7368ff58e2099c9602f6c32109
** 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.

discourse-doctor

DISCOURSE DOCTOR Thu Jul 23 22:59:22 UTC 2020
OS: Linux itsbx 4.15.0-111-generic #112-Ubuntu SMP Thu Jul 9 20:32:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=good
SMTP_ADDRESS=good
DEVELOPER_EMAILS=good
SMTP_PASSWORD=good
SMTP_PORT=587
SMTP_USER_NAME=good
LETSENCRYPT_ACCOUNT_EMAIL=good

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 19.03.8, build afacb8b7f0

DOCKER PROCESSES (docker ps -a)

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
343a1aa3c05c local_discourse/app “/sbin/boot” 7 days ago Exited (5) About a minute ago app

==================== SERIOUS PROBLEM!!! ====================
app not running!
Attempting to rebuild
==================== REBUILD LOG ====================
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container

  • /usr/bin/docker stop -t 60 app
    app
    cd /pups && git pull && /pups/bin/pups --stdin
    Already up to date.
    I, [2020-07-23T22:59:41.894064 #1] INFO – : Loading --stdin

FAILED

NoMethodError: undefined method each' for nil:NilClass Location of failure: /pups/lib/pups/config.rb:99:in run_commands’
439734a2cd69755d8351bbdadd9756cb573577d7f1b306aedaafa1c7d4bc29cf
** 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.
==================== END REBUILD LOG ====================
Failed to rebuild app.

Checking your domain name . . .

Connection to website succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . .

starting up existing container

  • /usr/bin/docker start app
    Error response from daemon: driver failed programming external connectivity on endpoint app (100c15324a128a2b007d8b89e29fe0f455585fd8c7d99855ef87bb4f17892b4b): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use
    Error: failed to start containers: app
    Failed to restart the container.

==================== PLUGINS ====================
- git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at website: NOT FOUND
Discourse version at localhost: NOT FOUND

==================== MEMORY INFORMATION ====================
RAM (MB): 2041

          total        used        free      shared  buff/cache   available

Mem: 1993 140 1310 0 542 1695
Swap: 2047 72 1975

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 49G 13G 37G 26% /

==================== DISK INFORMATION ====================
Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3980448C-AF15-4833-A022-C759F0D2D80A

Device Start End Sectors Size Type
/dev/vda1 227328 104857566 104630239 49.9G Linux filesystem
/dev/vda14 2048 10239 8192 4M BIOS boot
/dev/vda15 10240 227327 217088 106M Microsoft basic data

Partition table entries are not in disk order.

==================== END DISK INFORMATION ====================

The thing I immediately notice is it says “serious problem, app not running”. And “discourse version at website and localhost not found”. My (uninformed) assumption is whatever these mean, this is the issue.

It also crashed my site just now when I ran rebuild and I did the “start app” to fix it again.

Hmm. Well, it doesn’t look like a formatting problem, but I can’t tell what it might be.

If the app.yml is a worry, I think it’s best to restart with a clean app.yml file

rm /var/discourse/containers/app.yml
cd /var/discourse
cp samples/standalone.yml containers/app.yml
nano containers/app.yml

Then you can rebuild when everything is checked

3 Likes

This worked perfectly. Clearly when it was reporting the yml was correct…it wasn’t.

I then had a temporary issue with emails not sending but when I went and doublechecked the new yml I realized I messed up the email (I always forget I set it to @mg. on mailgun…) so that was fixed within five minutes.

Gah thank you so much I don’t have the fear of imminent destruction occurring at any time now.

1 Like

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