Can't get discourse working again

Hi:
I’ve been running a Discourse for the last months with no problems.
I had to reset the host and now I can not get discourse working again.

/var/discourse# ./launcher rebuild app

Ensuring launcher is up to date

Fetching origin

Launcher is up-to-date

cat: 80:80: No such file or directory

cat: 443:443: No such file or directory

cd /pups && git pull && /pups/bin/pups --stdin

/usr/bin/docker: invalid reference format: repository name must be lowercase.

See '/usr/bin/docker run --help'.

cat: cids/app_bootstrap.cid: No such file or directory

"docker rm" requires at least 1 argument.

See 'docker rm --help'.

Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers

rm: cannot remove ‘cids/app_bootstrap.cid’: No such file or directory

** 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.

“run” and “bootstrap” commands do the same :frowning:

Doctor says:

./discourse-doctor 
DISCOURSE DOCTOR Sun Feb 16 11:59:15 CET 2020
OS: Linux XXXXXXXXXXXX 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 GNU/Linux


Found containers/app.yml

==================== YML SETTINGS ====================
awk: not an option: --field-separator=:
DISCOURSE_HOSTNAME=
awk: not an option: --field-separator=:
SMTP_ADDRESS=
awk: not an option: --field-separator=:
DEVELOPER_EMAILS=
awk: not an option: --field-separator=:
SMTP_PASSWORD=
awk: not an option: --field-separator=:
SMTP_PORT=
awk: not an option: --field-separator=:
SMTP_USER_NAME=
awk: not an option: --field-separator=:
LETSENCRYPT_ACCOUNT_EMAIL=

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 18.06.3-ce, build d7080c1

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

==================== SERIOUS PROBLEM!!!! ====================
app not running!
Attempting to rebuild
==================== REBUILD LOG ====================
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
cat: 80:80: No such file or directory
cat: 443:443: No such file or directory
cd /pups && git pull && /pups/bin/pups --stdin
/usr/bin/docker: invalid reference format: repository name must be lowercase.
See '/usr/bin/docker run --help'.
cat: cids/app_bootstrap.cid: No such file or directory
"docker rm" requires at least 1 argument.
See 'docker rm --help'.

Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers
rm: cannot remove ‘cids/app_bootstrap.cid’: No such file or directory
** 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 443 succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . . 

cat: 80:80: No such file or directory
cat: 443:443: No such file or directory
+ /usr/bin/docker run --shm-size=512m -d --restart=always '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e DISCOURSE_HOSTNAME=XXXXXXXXXXXX -e DISCOURSE_DEVELOPER_EMAILS=XXXXXXXXXXXX -e DISCOURSE_SMTP_ADDRESS=XXXXXXXXXXXX -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=XXXXXXXXXXXX -e DISCOURSE_SMTP_PASSWORD=XXXXXXXXXXXX -e DISCOURSE_SMTP_ENABLE_START_TLS=false -e LETSENCRYPT_ACCOUNT_EMAIL=XXXXXXXXXXXX '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' -h vps659319-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' '#<NoMethodError: undefined method `[]'\'' for false:FalseClass>' -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:62:5b:d4:b7:80 local_discourse/app /sbin/boot
/usr/bin/docker: invalid reference format: repository name must be lowercase.
See '/usr/bin/docker run --help'.
Failed to restart the container.


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-plugin-linkedin-auth.git
          - git clone https://github.com/discourse/discourse-oauth2-basic.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-voting.git
          - git clone https://github.com/discourse/discourse-assign.git
          - git clone https://github.com/discourse/discourse-staff-notes.git
          - git clone https://github.com/discourse/discourse-checklist.git
          - git clone https://github.com/discourse/discourse-social-share.git
          - git clone https://github.com/rcfox/Discourse-LinkedIn-Sharing-Button.git
          - git clone https://github.com/BeXcellent/discourse-allowiframe.git

WARNING:
You have what appear to be non-official plugins.
If you are having trouble, you should disable them and try rebuilding again.

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

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


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

             total       used       free     shared    buffers     cached
Mem:          1962       1819        142         45         86        586
-/+ buffers/cache:       1146        815
Swap:         2047        190       1857

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        20G  9.1G  9.7G  49% /

==================== DISK INFORMATION ====================

Disk /dev/sdb: 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
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 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: dos
Disk identifier: 0x7f0953e7

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 41941883 41939836  20G 83 Linux

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

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) []: XXXXXXXXXXXX
Sending mail to XXXXXXXXXXXX. . . 
Error: No such container: app

Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD
Replacing: Sending mail to

==================== DONE! ====================

You can examine the output of this script with 
LESS=-Ri less /tmp/discourse-debug.txt

BUT FIRST, make sure that you know the first three commands below!!!

Commands to know when viewing the file with the above command (called 'less'): 
q              -- quit
/error<ENTER>  -- search for the word 'error'
n              -- search for the next occurrence
g              -- go to the beginning of the file
f              -- go forward a page
b              -- go back a page
G              -- go to the end of the file
2 Likes

Make sure the settings highlighted by Doctor are correctly filled and not empty.

For example: DISCOURSE_HOSTNAME: mydomain.com (note separator should be : not =)

You can check the syntax with an online YML validator: http://www.yamllint.com/

that file was not modified at all … it’s same as it was when things were working :frowning:
I’ve checked line by line, no errors …

Here you have:

## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/web.socketed.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
#expose:#
  - "80:80"   # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "256MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

env:
  LANG: en_US.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  UNICORN_WORKERS: 4

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.
  DISCOURSE_HOSTNAME: 'XXXXXXXXXXXX'

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")
  #DOCKER_USE_HOSTNAME: true

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'XXXXXXXXXXXX'

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  DISCOURSE_SMTP_ADDRESS: XXXXXXXXXXXX
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: XXXXXXXXXXXX
  DISCOURSE_SMTP_PASSWORD: "XXXXXXXXXXXX"
  DISCOURSE_SMTP_ENABLE_START_TLS: false           # (optional, default true)

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  LETSENCRYPT_ACCOUNT_EMAIL: XXXXXXXXXXXX

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## 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-plugin-linkedin-auth.git
          - git clone https://github.com/discourse/discourse-oauth2-basic.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-voting.git
          - git clone https://github.com/discourse/discourse-assign.git
          - git clone https://github.com/discourse/discourse-staff-notes.git
          - git clone https://github.com/discourse/discourse-checklist.git
          - git clone https://github.com/discourse/discourse-social-share.git
          - git clone https://github.com/rcfox/Discourse-LinkedIn-Sharing-Button.git
          - git clone https://github.com/BeXcellent/discourse-allowiframe.git

## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"

Try with deleting the ' characters in hostname and developper emails

'XXXXXXXXXXXX'

Why this commenting out the command?

#expose:#
  - "80:80"   # http
  - "443:443" # https

It explains the error output:

cat: 80:80: No such file or directory
cat: 443:443: No such file or directory
5 Likes

But I need those lines to be there !

Read what I said. You have added a #.

1 Like

Should be:

expose:
  - "80:80"   # http
  - "443:443" # https
6 Likes

I didn’t make it that easy because someone needs to think how could such errors occur if this is true?

2 Likes