Problem/Motivation
On Drupal 8.9 and Acquia Search legacy (3/4). I recently upgraded from Acquia Connector 2.x branch to Acquia Connector 3.0.1. This release split out the acquia_search submodule into this module in the 2.x branch, so I included that as well.
So, I now have:
Acquia Connector 3.0.1
Acquia Search 2.1.24
Search API 1.19
Search API SOLR 1.10
Drupal 8.9
After updating and clearing caches, I'm unable to connect to Acquia Search in my dev server. I get status "Unavailable" on the Search API main config page. When clicking the "Acquia Search API Solr server" link, I get an exception "Solarium\Exception\UnexpectedValueException: Neither collection nor core set. in Solarium\Core\Client\Endpoint->getBaseUri() (line 289 of /mnt/www/html/(obfuscated)/vendor/solarium/solarium/src/Core/Client/Endpoint.php). "
Are these modules not the correct setup?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 3202247-21.patch | 1.13 KB | japerry |
| #18 | acquia_search_3202247-8.patch | 1.14 KB | srihari manepally |
| #7 | 3202247-7.patch | 2.19 KB | japerry |
Comments
Comment #2
japerryWere you able to fix this by trying to reconnect with your acquia cloud credentials? I reached out via your contact form, but no response. Would love to see what you're running into since we cannot reproduce this internally.
Comment #3
zann1e commentedI confirm that we have the same issue with our project.
Recently, we upgraded Drupal Core using Acquia/Lightning distribution to version 3.4.10.
Our current setup:
Drupal - 8.9.13
Acquia Connector - 3.0.2
Acquia Search - 2.1.24
Search API - 8.x-1.19
Search API Solr - 8.x-1.10
solarium/solarium - 6.0.4
When we try to open: /admin/config/search/search-api/server/acquia_search_server the error is displayed
Comment #4
bkosbornejaperry - I got your message, I thought I replied. I'll take another look at this today.
Comment #5
luke.leberI can also confirm we're seeing the same thing on Drupal 9.1.5 with:
Acquia Connector 3.0.2
Acquia Search 2.1.24
Search API 1.19
Search API SOLR 1.10
Solarium 6.1.1
Comment #6
bkosbornejaperry - sent you another email.
I still get the error reported in the issue. I’m not sure how I can “reconnect” it to Acquia subscription. I’d also be a bit concerned with doing so without knowing how it would affect the prod env.
Comment #7
japerrySo the 'possible cores' is returning null for anything but production, which is expected. I added a check after readonly mode is set to try to set it to the first available core on the account. This should work for those using the account id instead of one with a suffix.
Test this patch and let me know how it goes, and I can commit it.
Comment #8
bkosborneThanks! I deployed this patch to our dev server and can confirm the error is gone. My dev environment is now connecting to the production search index in read-only mode, just as before the upgrade.
Comment #9
luke.leberWon't #7 prevent the use of non-production search cores in general?
In our setup we have...
Am I missing something?
Nevertheless, after applying #7, we're still getting HTTP/500 on the /admin/config/search/search-api/server/acquia_search_server route.
Comment #10
luke.leberComment #11
janusman commentedI think we may want to address this in 2 ways:
Comment #12
luke.leberNot sure if it'd help in debugging or not, but here's how we've had our settings.php set up for the past 4 years.
The connection override part seems to no longer work with the latest versions of things.
It's starting to sound like this might be a separate issue.
Comment #13
japerryHmm, the connection override variable has changed a few times over the last few years, but this is what should be used today:
## For Search 2.x Solr 3/4
$config['acquia_search.settings']['default_search_core'] = 'ACBD-123456';
## For Search 3.x Solr 7
$config['acquia_search.settings']['override_search_core'] = 'ABCD-123456.dev.DBNAME';
Where dbname is the database name found in cloud ui for the environment you want to connect to.
Let me know if that works for you!
Comment #14
bburgHi,
"default_search_core" is not a 1-2-1 replacement of functionality for "connection_override", connection_override allowed me to override the connection information to a solr server I had running in docker for local development, e.g. this is what I was able to use with Acquia Search 8.x-1.*:
Correct me if I am wrong, but the "default_search_core" variable seems to allow me to define a core id, to connect to, that only exists on Acquia cloud. But I don't want to connect to Acquia cloud, I want to use my local solr server in docker so I can develop and test the update. Even so, it's really unclear how to set this up in the first place. I've been trying to follow the instructions at https://docs.acquia.com/acquia-search/multiple-cores/override/, until I've realized that support for a non-acquia hosted solr core seems to have been dropped.
I am in the process of trying to upgrade to Solr 7 on an existing site. The combination of this module seeming unable to use anything but Acquia hosted solr cores, and that upgrading Solr versions in the Acquia dashboard seems to apply to ALL Environments, means that I can't do any development and testing without pulling the trigger to permanently upgrade to Solr 7 on production. Which is not really feasible.
Comment #15
japerryAhh, I see what you're trying to do. Unfortunately the 'Acquia Search Server' uses a special class that authenticates via an event subscriber dispatched from solarium. Unfortunately this means you probably need to have a local server that you associate your acquia search index onto.
I created a ticket in our internal backlog to research this a bit more, because I totally understand what you're trying to do, especially if you have the search configuration we use deployed to your local docker solr server.
Comment #16
luke.leberJust a follow up that our TAM provisioned us additional cores for our extra dev environments so that we no longer needed the overrides.
Things are going smoothly now in our particular case. All it took was 6 more cores...heh.
Comment #17
shital.mahajan commentedHi
have placed below in settings.php as per https://docs.acquia.com/acquia-search/multiple-cores/override/
$config['acquia_search.settings']['override_search_core'] = 'ABCD-12345.prod.mysite';
but getting below as solr server status
search_api_solr.module server ID: test
URL: https://localhost:8083/
Acquia Search Solr module automatically selected the proper Solr connection based on the detected environment and configuration.
Solr core is currently unreachable.
Solr core authentication check fails.
and if removed $config['acquia_search.settings']['override_search_core'] from settings.php it worked with core provided in "search_api_server.test.yml" but not able to override core as per environment.
override_search_core is not working as expected in latest version.
Plesae suggest any solution.
Comment #18
srihari manepally commentedHi
I have tried to apply patch for 2.1.25 version but not worked. So I have modified patch it is now working fine for 2.1.25 version.
So for version 2.1.25 try to use acquia_search_3202247-8.patch
Thanks
Comment #19
srihari manepally commentedComment #20
avpadernoComment #21
japerryBackported these changes in this patch from the old Acquia Search Solr module. If you resave the configuration form, it should wipe out the old values.
Comment #22
ahmed_samir commentedPatch #7 throws:
Patch #18 works
Patch #21 is not applying
Comment #23
wwhurley commentedIn the Acquia environment Drupal uses the $ah_env attribute to determine which Solr core to use. If you're somewhere else without access to that you you can manually set which core to use by defining the "acquia_search.settings.default_search_core" in your settings.php. That would look something like:
Comment #24
japerryPatch 18 looks good to me. Fixed, I hope!