After doing some updates Jetty can no longer find Solr when trying to run CKAN on Ubuntu 18.04. A fresh install of CKAN is not working in development or prod.
This is using the 3.6.2+dfsg-18~18.04
package.
I can tell Jetty9 is running but it can't find solr.
Any help or pointers would be great.
WARNI [pysolr] Unable to extract error message from invalid XML: mismatched tag: line 10, column 2
ERROR [pysolr] Solr responded with an error (HTTP 404): [Reason: None]
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><title>Error 404 Not Found</title></head><body><h2>HTTP ERROR 404</h2><p>Problem accessing /solr/select/. Reason:<pre> Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.15.v20190215</a><hr/></body></html>
ERROR [ckan.controllers.package] Dataset search error: ('SOLR returned an error running query: {\'sort\': \'score desc, metadata_modified desc\', \'fq\': [u\'\', u\'+site_id:"default"\', \'+state:active\', u\'+permission_labels:("public" OR "creator-aedc3c62-8492-48b7-9640-0c362bb2b537")\'], \'facet.mincount\': 1, \'rows\': 21, \'facet.field\': [u\'organization\', u\'groups\', u\'tags\', u\'res_format\', u\'license_id\'], \'facet.limit\': \'50\', \'facet\': \'true\', \'q\': \'*:*\', \'start\': 0, \'wt\': \'json\', \'fl\': \'id validated_data_dict\'} Error: SolrError(u\'Solr responded with an error (HTTP 404): [Reason: None]\\n<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><title>Error 404 Not Found</title></head><body><h2>HTTP ERROR 404</h2><p>Problem accessing /solr/select/. Reason:<pre> Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.15.v20190215</a><hr/></body></html>\',)',)
INFO [ckan.lib.base] /dataset render time 0.079 seconds
paster serve /etc/ckan/default/development.ini
/dataset
pageThis was working in February without issues by following the docs (which includes the comment from here).
I have noticed that in the newest solr-jetty
package it adds the symlink by default which will mean the step to add this in the CKAN docs will fail as the symlink already exists. I've tried removing and adding it back to get the different permissions on the file with no luck.
Also, the first step under Solr setup instructs to update lines in the /etc/default/jetty
file that no longer exist. I believe these should be moved to /etc/jetty9/start.ini
but i've done both with no luck either.
solr-jetty
package but same result (however symlink step worked as that wasn't included in the previous package).
sudo apt install libsolr-java=3.6.2+dfsg-11 solr-common=3.6.2+dfsg-11 solr-jetty=3.6.2+dfsg-11
sudo apt-get install python-dev postgresql libpq-dev python-pip python-virtualenv git-core redis-server
sudo apt install libsolr-java=3.6.2+dfsg-11 solr-common=3.6.2+dfsg-11 solr-jetty=3.6.2+dfsg-11
sudo apt install openjdk-8-jdk
I'm not adding this as an answer as this just abandons using the solr-jetty
package which doesn't answer the question or how to get solr-jetty
to work. However, after getting solr-jetty
to work (see below answer) I've decided to switch to using this solution which uses solr directly.
Currently the solr-jetty
package breaks for this setup. It appears to be a permission and file issue. Here is one way to get it working.
Thanks goes to this PR!
Make the following solr updates:
sudo mkdir /etc/systemd/system/jetty9.service.d
sudo nano /etc/systemd/system/jetty9.service.d/solr.conf
and add
[Service]
ReadWritePaths=/var/lib/solr
sudo nano /etc/solr/solr-jetty.xml
and replace with the below configuration. sudo service jetty9 restart
and you may have to systemctl daemon-reload
Step 3.3 solr-jetty.xml
:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- Context configuration file for the Solr web application in Jetty -->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/solr</Set>
<Set name="war">/usr/share/solr/web</Set>
<!-- Set the solr.solr.home system property -->
<Call name="setProperty" class="java.lang.System">
<Arg type="String">solr.solr.home</Arg>
<Arg type="String">/usr/share/solr</Arg>
</Call>
<!-- Enable symlinks -->
<!-- Disabled due to being deprecated
<Call name="addAliasCheck">
<Arg>
<New class="org.eclipse.jetty.server.handler.ContextHandler$ApproveSameSuffixAliases"/>
</Arg>
</Call>
-->
</Configure>
See this issue for additional info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With