Unable to build phpBB import container on brand-new Discourse

I’ve installed a brand-new discourse. Everything works. I can create the initial account, receive email, login etc.

I need to import a phpbb3 forum. I intend to use the import utility to populate my Discourse with historic data, so I followed the instructions in Migrate a phpBB3 forum to Discourse

I executed the copy command

cp containers/app.yml containers/import.yml

and edited the file to add the template line. My site uses LetsEncrypt for the TLS certificate so the SSL and LetsEncrypt templates lines are uncommented - this is a bit different to the example shown on the instructions. Anyway, I’ve tried this with commented and uncommented llines, so I don’t think those lines are a factor.

I continued with the remaining instructions, finally running the rebuild container command. The command does not complete successfully.

94:M 23 Jul 2024 20:14:40.761 * Saving the final RDB snapshot before exiting.
94:M 23 Jul 2024 20:14:40.855 * DB saved on disk
94:M 23 Jul 2024 20:14:40.857 # Redis is now ready to exit, bye bye...
2024-07-23 20:14:41.235 UTC [32] LOG:  database system is shut down


FAILED
--------------------
Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/service/unicorn/run
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/replace_command.rb:11:in `read'
replace failed with the params {"tag"=>"precompile", "filename"=>"/etc/service/unicorn/run", "from"=>"PRECOMPILE_ON_BOOT=1", "to"=>"PRECOMPILE_ON_BOOT=0"}
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.
6f1a0b5cd0cfc8ed542938b7439aeff0a21a0135c58617fa5a05e68fd6fcc70d

I’m unsure how to address this issue. I’ve installed multiple times in multiple places. From reading, it seems this rebuild step (which is not the actual import of data) should just run. Is this possibly an issue with the most recent Discourse? I ran the import successfully start-to-finish several months ago as a test.

Yes.

You’ll need to share or understand more of the output.

1 Like

To create a common start point, I have reinstalled my VPS (Ubuntu 22.04), apt update && apt upgrade, then began the standard discourse installation process.

In case this information is material, I did make a mistake while keying information during the 1st ./discourse-setup so issued control-C and then reran ./discourse-setup. The second run of ./discourse-setup pulls a new discourse/base as shown…

root@discourse:/var/discourse# ./discourse-setup 
The configuration file containers/app.yml already exists!

. . . reconfiguring . . .


Saving old file as app.yml.2024-07-29-151604.bak
Stopping existing container in 5 seconds or Control-C to cancel.
x86_64 arch detected.

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

2.0.20240708-0023: Pulling from discourse/base
76956b537f14: Pull complete 
c5ffad89ad3c: Pull complete 
71c31a50a587: Pull complete 
c1a1234dcb61: Pull complete 
9980a27afc32: Pull complete 
4f4fb700ef54: Pull complete 
304b565c70c9: Pull complete 
8ad811162d08: Pull complete 
2c324dce526d: Pull complete 
52d141c2b1c8: Pull complete 
4c08fdcd145a: Pull complete 
1b6035ac25c0: Pull complete 
9208d0f90623: Pull complete 
513dccf6f63f: Pull complete 
e0b141854963: Pull complete 
4476d7dd9441: Pull complete 
0fad77941078: Pull complete 
46c34476ea19: Pull complete 
ff0b86516349: Pull complete 
c33170d09c8b: Pull complete 
ed4a793ffe51: Pull complete 
3a7b2554e089: Pull complete 
3ad8a6408839: Pull complete 
e7c58bcc7f57: Pull complete 
59b2407fe431: Pull complete 
315160f4d4f8: Pull complete 
ad328ba96976: Pull complete 
825dca2e642e: Pull complete 
9fbd8c908047: Pull complete 
b1d30330e969: Pull complete 
8c76c65bb8e8: Pull complete 
9279965667b5: Pull complete 
a0ae3eb4d088: Pull complete 
819fb509ef8b: Pull complete 
c962935d47d4: Pull complete 
63b444b5bd1e: Pull complete 
7efa1c09faf6: Pull complete 
46c4327ce462: Pull complete 
b095ebe7bdf6: Pull complete 
3aa16a533cab: Pull complete 
41419e4f1948: Pull complete 
589837814d9a: Pull complete 
bd025ad1b844: Pull complete 
24762ff7528f: Pull complete 
fe364253c657: Pull complete 
Digest: sha256:025e9c1f6848c4726544c6ae873d710c62f547b72afb7f537aaa44eb5377cb5c
Status: Downloaded newer image for discourse/base:2.0.20240708-0023
docker.io/discourse/base:2.0.20240708-0023
app was not started !
./discourse-doctor may help diagnose the problem.

Found 3GB of memory and 2 physical CPU cores
setting db_shared_buffers = 768MB
setting UNICORN_WORKERS = 4
containers/app.yml memory parameters updated.

The discourse installation continued and ran to completion. I was able to create the initial account and login.

I, [2024-07-29T15:42:21.624379 #1]  INFO -- : Replacing location @discourse { with location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain in /etc/nginx/conf.d/discourse.conf
I, [2024-07-29T15:42:21.627858 #1]  INFO -- : > echo "Beginning of custom commands"
I, [2024-07-29T15:42:21.634022 #1]  INFO -- : Beginning of custom commands

I, [2024-07-29T15:42:21.637436 #1]  INFO -- : > echo "End of custom commands"
I, [2024-07-29T15:42:21.642766 #1]  INFO -- : End of custom commands

I, [2024-07-29T15:42:21.648034 #1]  INFO -- : Terminating async processes
I, [2024-07-29T15:42:21.649479 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 57
2024-07-29 15:42:21.651 UTC [57] LOG:  received fast shutdown request
I, [2024-07-29T15:42:21.652067 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 120
120:signal-handler (1722267741) Received SIGTERM scheduling shutdown...
2024-07-29 15:42:21.658 UTC [57] LOG:  aborting any active transactions
120:M 29 Jul 2024 15:42:21.667 # User requested shutdown...
120:M 29 Jul 2024 15:42:21.668 * Saving the final RDB snapshot before exiting.
2024-07-29 15:42:21.682 UTC [57] LOG:  background worker "logical replication launcher" (PID 72) exited with exit code 1
120:M 29 Jul 2024 15:42:21.682 * DB saved on disk
120:M 29 Jul 2024 15:42:21.683 # Redis is now ready to exit, bye bye...
2024-07-29 15:42:21.685 UTC [67] LOG:  shutting down
2024-07-29 15:42:21.806 UTC [57] LOG:  database system is shut down
sha256:6a6d6a8ea3559ad031a84fd48a164686e9440d7e857cb39619c2baba84a4b966
2b8eddd7b72415507d10cc404c40459c19c7ad3e025cb7bb69bcddb3c98b0197

+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -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_FORCE_HTTPS=true -e LC_ALL=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8 -e DISCOURSE_HOSTNAME=discourse3.greenbullfrog.com -e DISCOURSE_DEVELOPER_EMAILS=discourse-admin@greenbullfrog.com -e DISCOURSE_SMTP_ADDRESS=box.greenbullfrog.com -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=discourse@greenbullfrog.com -e DISCOURSE_SMTP_PASSWORD=lAtDyjbyqztzhrG -e DISCOURSE_SMTP_DOMAIN=discourse3.greenbullfrog.com -e DISCOURSE_NOTIFICATION_EMAIL=noreply@discourse3.greenbullfrog.com -e LETSENCRYPT_ACCOUNT_EMAIL=letsencrypt@greenbullfrog.com -h discourse-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:f9:8c:dd:3d:63 local_discourse/app /sbin/boot
a78541042858ed6a4dd739bb7c8243a50a4064f595fdf968c22c8b63afb68979
root@discourse:/var/discourse# 

Next, I began the process described at Migrate a phpBB3 forum to Discourse .

Here is the head of my import.yml file…

root@discourse:/var/discourse# head -23 containers/import.yml 
## 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"
  ## Uncomment the next line to enable the IPv6 listener
  #- "templates/web.ipv6.template.yml"
  - "templates/web.ratelimited.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"
  - "templates/import/phpbb3.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,
root@discourse:/var/discourse# 

The problem occurs when running the /var/discourse/launcher rebuild import command. Due to length, it is not possible to post the log of that command. However, you can download it from this NextCloud link…

@gerhard, this may still be in your wheelhouse.

I think that the issue is that the phpbb3 template removes /etc/service/unicorn and then the web template tries to change that file.

The easiest thing might be to delete these lines from web.template.yml

  - replace:
      tag: precompile
      filename: /etc/service/unicorn/run
      from: PRECOMPILE_ON_BOOT=1
      to: "PRECOMPILE_ON_BOOT=0"

But you’ll want to do it after you build the original container and then do something like

git checkout templates/web.template.yml

before you do another rebuild.

1 Like

Thank you for those instructions, @pfaffman .

Unfortunately I left the rebuild running and I returned to a disconnected ssh session so didn’t capture all of the build output. The rebuild did create a docker image and start the container, so I was reasonably satisfied that it had run to a normal end.

I put my phpbb3 data in the correct locations for a local import and issued the command to begin. The import is in progress now but will take some time to finish. I’ll reply tomorrow with a result.

1 Like

The import ran to completion and appears to have migrated most of the data. Some phpbb user accounts apparently have email accounts that upset Discourse. I think it might be a trailing space. I try to cleanup before I rerun the entire procedure.

Thanks for the help. I presume there will be a fix for the the import utility which otherwise will fail to build for the current version of Discourse. I suspect many people will not have the tech skills to dig into the problem and would just give up when encountering the error. That would result in fewer Discourse communities, and historic discussions lost to abandoned or deleted phpbb sites.

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