PHPBB3 Import failling at first stage

I’ve set up a brand new Discourse, I’ve activated it and it works fine. No changes have been applied at all. I’m trying to perform a PHPBB3 import, but it’s failing very early on, before the sql dump has even been called upon. Seems there is a problem creating a directory, but can’t understand why or how to fix.

First I run these:

cd /var/discourse
cp containers/app.yml containers/import.yml
nano containers/import.yml

Then I update the import.yml to add the entry to the list of templates.

Then I run this:

/var/discourse/launcher stop app
/var/discourse/launcher rebuild import

But it fails to bootstrap and gives me this in failed:

FAILED

--------------------

Pups::ExecError: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadbclient-dev mariadb-server failed with return #<Process::Status: pid 751 exit 100>

Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'

exec failed with the params {"cmd"=>["mkdir -p /shared/import/mysql/data", "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8", "add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'", "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadbclient-dev mariadb-server", "sed -Ei 's/^log/#&/' /etc/mysql/my.cnf"]}

35bdae869b75c936048af19f082aa5eded27d1ec77b9c53c48216d794775142d

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

Pulling my hair out trying to fix this. Please can anyone suggest where I’m going wrong?

Digging into this a bit deeper has led me to this post which seems to be the same error I’m having.

I noticed that the fix was to update the repos with the latest Ubuntu version. I’ve changed this section in phpbb3.template.yml:

cmd:
          - mkdir -p /shared/import/mysql/data
          - apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
          - add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'
          - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadbclient-dev mariadb-server
          - sed -Ei 's/^log/#&/' /etc/mysql/my.cnf

to:

cmd:
          - mkdir -p /shared/import/mysql/data
          - apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
          - add-apt-repository 'deb [arch=amd64,i386] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu bionic main'
          - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadbclient-dev mariadb-server
          - sed -Ei 's/^log/#&/' /etc/mysql/my.cnf

But it looks like this is still failing because the key used is now out of date. Can anyone help me with the key so I can test this theory?

We switched from Ubuntu to Debian. That’s why it isn’t working anymore.
I gave it a quick try and it mostly works by applying the following changes, but somehow the MariaDB server didn’t automatically start. I’ll have a look when I have more time…

You could manually apply those changes to the template for now and start the server by running service mysql stop and service mysql start inside the container afterwards. That should work.

3 Likes

That fix seems to be working. I’ll continue with the import and see how it goes. Thanks a lot.

I’m having trouble running import_phpbb3.sh inside the import container. I had to restart the mysql by using the commands

/etc/init.d/mysql stop

and

/etc/init.d/mysql start

then I could enter the import container, where I ran import_phpbb3.sh, but it failed:

root@mydiscourse-import:/var/www/discourse# import_phpbb3.sh

The phpBB3 import is starting...

**Traceback** (most recent call last):

9: from script/import_scripts/phpbb3.rb:13:in `<main>'

8: from script/import_scripts/phpbb3.rb:14:in `<module:ImportScripts>'

7: from script/import_scripts/phpbb3.rb:26:in `<module:PhpBB3>'

6: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:9:in `create'

5: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:9:in `new'

4: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:15:in `initialize'

3: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:39:in `create_database_client'

2: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:39:in `new'

1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect': **Access denied for user 'root'@'localhost' (** **Mysql2::Error** **)**

Can you suggest how to proceed?

Can you give it another try? It should work again.

cd /var/discourse
git pull
./launcher rebuild import
3 Likes

Thanks, I’ve tried it but I’m still getting an error I’m afraid:

The phpBB3 import is starting...
**Traceback** (most recent call last):
9: from script/import_scripts/phpbb3.rb:13:in `<main>'
8: from script/import_scripts/phpbb3.rb:14:in `<module:ImportScripts>'
7: from script/import_scripts/phpbb3.rb:26:in `<module:PhpBB3>'
6: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:9:in `create'
5: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:9:in `new'
4: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:15:in `initialize'
3: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:39:in `create_database_client'
2: from /var/www/discourse/script/import_scripts/phpbb3/database/database.rb:39:in `new'
1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect': **Unknown database 'phpbb' (** **Mysql2::Error** **)**

Please make sure that /var/discourse/shared/standalone/import/data/phpbb_mysql.sql exists and is a valid database dump. Then delete /var/discourse/shared/standalone/import/mysql/imported and try again.

3 Likes

Deleting /var/discourse/shared/standalone/import/mysql/imported worked and the import has begun! I’ll report back my results when the import has completed.

2 Likes

Everything seems to have worked. I’m running through the Sidekiq processes now.

Really grateful for your efforts on this @gerhard, you’ve put an end to a lot of stress for me. Thanks a lot.

4 Likes

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