How to solve mbslave:command not found error

I installed pgAdmin on Ubuntu, and ran this:

# in musicbrainz-docker directory
sudo docker-compose ps --all db

>          Name                        Command               State    Ports  
> ---------------------------------------------------------------------------
> musicbrainz-docker_db_1   docker-entrypoint.sh postg ...   Up      5432/tcp

When trying to register the server in pgAdmin I used:
Hostname/address: 0.0.0.0
Port: 5432
Maintenance database: postgres
Username: musicbrainz
Kerberos authentication: OFF
Password: musicbrainz
Role:
Service:

Upon clicking Save I get the following error:

Unable to connect to server: connection to server at “0.0.0.0”, port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?

Any ideas?

I then tried this:

# in musicbrainz-docker directory
echo MUSICBRAINZ_DOCKER_HOST_IPADDRCOL=127.0.0.1: >> .env
sudo docker-compose up -d db

and then ran:
ssh -L 63333:localhost:5432 joe@foo.com

and received an error:
ssh: connect to host foo.com port 22: Connection refused

I’ve noticed there is an SSH Tunnel page in pgAdmin too. I tried:

Hostname/address: 127.0.0.1
Port: 5432

SSH Tunnel:
Tunnel host: 633333
Tunnel port: 22
Username: musicbrainz
Identity file:
Password: musicbrainz

Unabled to connect to server: Failed to create the SSH tunnel. Error: Count not establish session to SSH gateway

So I’m stuck again. Please help out if you can. Thanks!

I ran this as you suggested and got:

$ admin/configure add publishing-all-ports
Successfully set/updated COMPOSE_FILE in ‘/home/jho/musicbrainz-docker/.env’.
$ sudo docker-compose up -d
ERROR: The Compose file is invalid because:
Service search has neither an image nor a build context specified. At least one must be provided.

Now I always get the following:

$ sudo docker-compose ps --all db
ERROR: The Compose file is invalid because:
Service mq has neither an image nor a build context specified. At least one must be provided.

Does this mean I have to reset my installation again, or can this be rolled back?

Did you setup the Search Server (search indexes) and MQ as mentioned in the instructions too or only created the database?

As I wrote above: Please use snapshots to undo unwanted modifications.
Or you can modify the (hidden) .env file manually.

@jho88, my bad, the port is not exposed by default, otherwise it should show something like 0.0.0.0:5432->5432/tcp.

You never really need to reset your installation, snapshot or not.

You were in the right direction by publishing ports. Unfortunately publishing ports of services that are not defined caused the compose config to be invalid. Only the database port must be published. I just updated the repository to handle this use case that never occurred before. That should do it:

# in musicbrainz-docker directory
git pull origin master;
admin/configure rm publishing-all-ports;
admin/configure add publishing-db-port;
sudo docker-compose up -d

Maybe you could help @jho88, explaining how you would reset the containers/the installation.
Especially after his statement:

1 Like

Which I did above, but it isn’t needed here.

1 Like

Hey guys, I installed DBeaver as suggested by @InvisibleMan78 above, (it seems more user friendly than pgAdmin), republished the ports as per @yvanzo, connected to 0.0.0.0:5432 and it works! I can see data!!

Thanks so much to you both of you for your patience and help over the past few days.

I will try to come back and post a summary of lessons learnt here shortly, in case other community members are also having similar problems, but in the meantime thanks again!

4 Likes

Below is a summary of lessons learnt from my Docker installation, with helpful guidance given from @InvisibleMan78 and @yvanzo above. Please let me know if I make any further mistakes in my points below.

My environment:
Windows 11
VMWare Workstation 16 Player
Ubuntu 64-bit v22.04

Steps:
1.0 While being aware of points below, follow steps here: GitHub - metabrainz/musicbrainz-docker: Docker Compose project for the MusicBrainz Server with replication, search, and development setup

2.0 Set enough storage for VM. 50GB wasn’t enough, 300GB worked ok

3.0 Use frequent snapshots to rollback to a stable point when things go wrong. For VMWare Player this involves simply making a copy of the VM files. This can save a huge amount of time and rework effort.

4.0 Downloading the db files separately and running:

sudo docker-compose run --rm musicbrainz createdb.sh -fetch

without the fetch also saved me a lot of time and effort when things went wrong.

4.1 Download db files from musicbrainz ftp site. Ensure all files 
    are from the same datetime-stamped folder. 

4.2 Run the above createdb.sh command **with** fetch just 
    briefly enough for the musicbrainz-docker_dbdump folder 
    to be created. Then quickly Ctrl-C to quit the command. 

4.3 Use:

> sudo docker volume inspect --format '{{.Mountpoint}}' musicbrainz-docker_dbdump

to tell you where musicbrainz-docker_dbdump folder is located. 

4.4 Copy downloaded db files to the musicbrainz-docker_dbdump.

4.5 Run **without** fetch flag:

> sudo docker-compose run --rm musicbrainz createdb.sh

5.0 Once database was created I chose not to install indexes but went straight to next step below.

6.0 Publish ports with:

#in musicbrainz-docker directory
git pull origin master;
admin/configure add publishing-db-port;
sudo docker-compose up -d

7.0 Install DBeaver. (I tried pgAdmin, but personally didn’t find it so user-friendly).

8.0 In DBeaver, connect to 0.0.0.0:5432, username: musicbrainz, password: musicbrainz. Also under PostgreSQL tab check the “Show all databases” checkbox.

9.0 Database should be in DBeaver ready to view and use!

6 Likes

Thank you for your summary of the lessons learnt.

Just one small comment:
With your point 6.0 you publish only 1 single port, the one to access the db.

The previously used script publishing-all-ports would publish ALL ports for ALL services db, mq, redis and search (additionally to musicbrainz) on the host. This expects that ALL services has been installed/defined.
Your mentioned script publishing-db-port exists only since a few days.

Thanks to this feedback, the file publishing-db-port has indeed been added and the section about publishing ports has been updated too.

For other people interested in switching their current mirror to a database-only mirror, detailed steps are available in today release notes:

3 Likes