I would like to point out that there is currently a bug in the Solarium library which prevents the search_api_attachments properly working with Acquia Search platform. The issue is described here: https://github.com/solariumphp/solarium/issues/301
To explain the problem:
If you try to use the Acquia Search with Drupal 8 and search_api_attachments with Acquia Solr server, the test button is returning error Solr HTTP Error: Internal Server Error. I have worked with Acquia and the problem is that Solarium is not properly building the HTTP request multipart/form-data, missing the boundary formatting.
The error on the Solr server is
5083388 [qtp1790022093-12] ERROR org.apache.solr.servlet.SolrDispatchFilter – null:org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:931) at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
I have provided an fix for this, but currently is in pending pull request (https://github.com/solariumphp/solarium/pull/413). The dependencies would need to be updated once the issue is fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2696901.patch | 3.79 KB | mkalkbrenner |
Comments
Comment #2
izus commentedok
thanks for this :)
Comment #3
snufkin commentedAttaching a patch based on @cristiroma's work (so all credits to him) that fix this from the module's side by enforcing the adapter type and fix the name of the file referenced.
IMHO basename($file) should go into this module, but the enforcement of the adapter should be handled in the backend code, since this use case could be specific to Acquia Cloud (I have not tested with standalone solr installations).
Regardless I'll attach the full patch here, so we can take it from there.
Comment #4
izus commentedhi,
i tested and here is what i noticed
somehow this doesn't work for me and the value i have with ->getAdapter is Solarium\Core\Client\Adapter\Curl
i tested and the Json::decode($json_data) has the $filepath and so basename($filepath) is not found
Comment #5
janusman commentedSo I found that this is a combination of issues:
To fix, I tried this combination:
Screenshots are great. Here's one!
Please review.
Comment #6
janusman commentedI have had 3 different customers/sites try out this patch (along with the patched Solarium as mentioned above) and it fixed the issue for them.
Because of that I am going to mark this as RTBC. We just need some noise on the Solarium PR so that it gets fixed there too!
Comment #7
izus commentedPlease drop a line here when the solarium PR is merged, so that we can merge this issue as well.
Big Thank to all contributors.
Comment #8
mkalkbrennerThis part is covered by #2862528: Solr Extractor causes Error with wrong method call and is not related to Acquia Search in any way.
What I can see from the new tests included in search_api solr itself, that basepath() operation is not required for a local Solr server. Maybe I didn't recognize a detailed explanation here, but I don't understand why it should be done. Just like @izus in #4
Meanwhile this is handled within the Solr Connectors. The default connector I wrote uses curl while the acquia connector I wrote uses "http".
Comment #9
mkalkbrennerAfter reviewing SolrExtractor::extract() completely, I think we should do something else here. Most of the code should be moved to search_api_solr, some parts to the backend, some parts to the connector. Then Acquia is able to fix their stuff in their own connector. And solr_attachments can avoid some configuration options which aren't required anymore. For examplt the 'solr_tika_path' is absolutely specific for the connector plugin and shouldn't be configurable.
Comment #10
mkalkbrennerOK, I provided the required methods by #2870333: Support connector specific tika based extraction.
The attached patch now simplifies the extractor implementation here.
And it enables Acquia to overwrite SolrConnectorPluginBase::getContentFromExtractResult() in their own connector.
Comment #11
mkalkbrennerComment #12
mkalkbrennerComment #13
cspitzlayMakes sense to me.
Comment #15
izus commentedThanks all.
This is now merged and will be part of today's release ( first beta)
Comment #16
janusman commentedNote that the Solarium fix is progressing: https://github.com/solariumphp/solarium/pull/484 was merged into the
developbranch, hopefully will be included in new release soon.Comment #17
greggmarshall@mkalkbrenner can you post the versions of each module you are using that makes it work? We're not seeing it functioning on Acquia Search and suspect some of the code "pushed" from #5 to other modules didn't make it.
Comment #18
jaydubb181 commentedI've confirmed #5 will at least get you through the /admin/config/search/search_api_attachments configuration screen with the following versions of modules / patches installed:
search_api 8.x-1.0-beta4
search_api_solr 8.x-1.0-beta1
acquia_connector 8.x-1.7
search_api_attachments 8.x-1.0-alpha5 (with the following patches applied)
Comment #19
mkalkbrenner@greggmarshall I can't test with Acquia Search. All that I can tell is that our tests on travis.org cover the extraction as well and they're always passing: https://travis-ci.org/mkalkbrenner/search_api_solr
Others second that it's working on their local Solr installations.
But as @janusman is pointing out here, there're some steps required to get things to work on Acquia Search. Therefor I suggest to open an issue at https://www.drupal.org/project/acquia_connector
The good news are that any fixes required could be done by themselves in their connector.
Comment #20
greggmarshallThank you both. @jaydubb181 from our team found a combination of modules and patches and posted them in #18 for future Google visitors.
Comment #22
janusman commentedLet me try to explain the reasoning...
IIUC, the problem will show up when using any (not just Acquia's) backend via the "Solr Extractor" (e.g. Extract-via-HTTP-request) method, because of these reasons:
So, either we try to:
Of course, if my assumption that all "Solr Extractor" requests are broken without the Solarium patch is wrong... then I understand if this has a lower urgency. I don't see how a Tika-via-http-request method would ever work given the brokenness of the multipart handling in Solarium fixed in https://github.com/solariumphp/solarium/pull/484 .
If, however, my assumption is true, then maybe we should document that patching to Solarium is needed? Or should the composer.json file included with this module specify patching from https://github.com/solariumphp/solarium/pull/484 ?
Comment #23
janusman commentedI did more digging and found that:
Comment #24
emarchak commented@janusman,
It's unclear what the current state of this is for the 1.0-beta3 version. I've patched Solarium with pull/519, but it none of the search_api_attachments patches apply.
Have they been included in beta3 releases?
Comment #25
manningpete commentedCan we please reopen this issue? This patch doesn't apply to 8.6 and needs a reroll
Comment #26
izus commentedreopened the issue
Contributions/patches/documentation are welcome
community rocks !
Comment #27
b_sharpe commentedI'm not sure why this needs re-opening? The patches in this thread are already in the latest release. All I did was install this module (beta11 at this point in time) and then the solarium patch listed in #23: https://patch-diff.githubusercontent.com/raw/solariumphp/solarium/pull/5...
Confirmed working on Acquia solr.
Comment #28
cspitzlay@manningpete: Just guessing, but if I take literally what you have said: "This patch doesn't apply to 8.6" ... could it be that you tried to apply the patch to Drupal Core 8.6 instead of the module code of search_api_attachments?
Comment #29
izus commented#27 is clear about the solarium patch
idk if something can be done for this in search_api_solr
but in search_api_attachments i'm sure we can do nothing more for it
Thanks all for your contributions