Help compiling the search server

I am trying to compile the search server following the instructions from Search server setup

When compiling the search server i am getting the following error:
[ERROR] /opt/musicbrainz/search-server/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java:[400,53] error: incompatible types: String cannot be converted to PrimaryType [ERROR] /opt/musicbrainz/search-server/index/src/main/java/org/musicbrainz/search/index/ReleaseIndex.java:[407,38] error: no suitable method found for add(String) [ERROR] method Collection.add(SecondaryType) is not applicable (argument mismatch; String cannot be converted to SecondaryType) method List.add(SecondaryType) is not applicable (argument mismatch; String cannot be converted to SecondaryType)

My guess is this a problem with the classes generated by the mmd-schema not matching what the search server is expecting.
I have tried compiling the mmd-schema cleanly by checking out from git and running mvn install without modification.
I have also tried to following the steps in the README file but the instructions are not clear.
Could someone give me some ideas on how to compile this?
If possible could someone send me thair jar file containing the mmd-schema so i can install it in my local maven repository and reverse engineer what needs to be done.

Hi there!

Things are still quite discombobulated on this front, sorry. Too much cleanup from the schema change still pending. :frowning:

On mmd-schema check out: 4f677727e8e. mvn package && mvn install and then search-server should compile.

2 Likes

Thank you rob.
I have now been able to compile the search server.

1 Like

Hello El Jefe,

Ran into the same issue as the original OP and pulled the commit 4f677727e8e down re-ran package and install and now having a different issue.

The only difference is I’m running openjdk- 1.8.x. versus 1.6 in case that impacts this build. Details follow:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/data/search_server/index/src/main/java/org/musicbrainz/search/index/WorkIndex.java:[165,44] error: no suitable method found for add(String)

method Collection.add(Attribute) is not applicable
  (argument mismatch; String cannot be converted to Attribute)
method List.add(Attribute) is not applicable
  (argument mismatch; String cannot be converted to Attribute)

/data/search_server/index/src/main/java/org/musicbrainz/search/index/WorkIndex.java:[195,48] error: no suitable method found for add(String)

method Collection.add(Attribute) is not applicable
  (argument mismatch; String cannot be converted to Attribute)
method List.add(Attribute) is not applicable
  (argument mismatch; String cannot be converted to Attribute)

/data/search_server/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java:[928,57] error: cannot find symbol

could not parse error message: symbol: class Track
location: class TrackList
/data/search_server/index/src/main/java/org/musicbrainz/search/index/RecordingIndex.java:928: error: cannot find symbol
org.musicbrainz.mmd2.Medium.TrackList.Track track = of.createMediumTrackListTrack();

In the meantime I’ve fixed the code to allow both mmd-schema and search-server to compile from HEAD. All the tests pass, but I haven’t had a chance to actually test the code in a live setup yet. The latest jar/war files are on the ftp site:

http://ftp.musicbrainz.org/pub/musicbrainz/search/

I’d love to hear from you on how they are working. Also, we prefer using the Oracle Java to compile the search server files, so I haven’t tested the openjdk for compiling.

1 Like

Using search-indexer-e76ee6f.jar to build the search index and searchserver-e76ee6f.war i finally have a search server working on my machine at home.

2 Likes

Hi. I’m having a few issues compiling the search server and I’m hoping you can help get things sorted. Specifically, when throwing the “mvn package” command into the search-server folder, we are getting the following error:

“Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project servlet: Compilation failure: Compilation failure:”

I have java 8 jdk, maven 2 and tomcat 7 installed. Please let me know what you think at your earliest possible convenience. Thanks! – Nico

The search server it’s in the process of being replaced with a solr based search server.

You can download the compiled binary for the current lucune search server from the ftp server above.

Thanks for your response. What files do I need and where should I place them?

You need to build a search index and configure tomcat to display the results.

Download the search indexer from:
http://ftp.musicbrainz.org/pub/musicbrainz/search/index/index.jar

You want to store the indexes in the following directory as that is what the web app is expecting.
/home/search/indexdata

You will end up running something like the following to build the indexes:
java -Xmx512M -jar $SEARCH_UPDATER_JAR --indexes $INDEXES --db-host $DB_HOST --db-name $DB_NAME --db-user $DB_USER --db-password “$DB_PASSWORD” --indexes-dir $INDEXES_DIR $@
This may take days depending on how fast your server is.

Download the following and rename it to ROOT.war
http://ftp.musicbrainz.org/pub/musicbrainz/search/servlet/searchserver.war

install tomcat 8 and place the war file in /var/lib/tomcat8/webapps directory
restart tomcat for it to deploy.

1 Like

I’m getting this error “org.postgresql.util.PSQLException: FATAL: password authentication failed for user “musicbrainz”” when making “java -Xmx512M -jar index.jar --indexes-dir /home/search/indexdata --db-name musicbrainz_db --db-user musicbrainz --db-password musicbrainz”.

I have created an user called “musicbrainz” in psql. Do you know what can be that error?

Thanks in advance.

Postgresql by default does not allow you to connect to it over the network by username and password so you need to enable this first.

The first thing you need to do is get postgresql to listen on a network.
edit postgresql.conf this may be in /etc/postgresql/9.5/main for debian / ubuntu.
listen_addresses = '*'
port = 5432

You then need to let postgresql know what machines to accept connections over what authentication methods.
edit pg_hba.conf and add a ip range to accept connections from.
The below will allow you to conect over tcp to the local database using username and password,
host all all 127.0.0.1/32 md5

Thanks for your quick response. I have edited postgresql.conf as you suggested and my pg_hba.conf looks like this:

local all all trust
local all postgres md5
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5

But I’m still getting the same authentication error. Do you know if I need some more configuration?

Have you restarted the database as this configuration is only read on startup.

Hi. Seems I have everything I need regarding the search server. How can I test if it’s working properly? And what should I set to LUCENE_SERVER in DBDefs.pm?

Thanks!

You should be able to set LUCENE_SERVER to localhost:8080

I use apache as a reverse proxy and map localhost:8080 to search.musicbrainz.dns.id.au
I then set LUCENE_SERVER to search.musicbrainz.dns.id.au

Setting LUCENE_SERVER to both localhost:8080 and localhost:80 gives me the following error:

Can’t connect to localhost:80

Connection refused at /home/ubuntu/perl5/lib/perl5/LWP/Protocol/http.pm line 46.

I switched Connector to port 80 following the Musicbrainz instructions here: https://github.com/metabrainz/search-server#tuning-tomcat

I also found a difference between what I did renaming the war file to ROOT.war and the instructions from Musicbrainz where seems to make a different step here: https://github.com/metabrainz/search-server#deploy-the-search-server-code

Thanks