Étrange souci que j'ai rencontré sur un projet Drupal avec searchApi relié à SearchStax.
Sur certaines page j'avais un code retour 500 « internal server error » alors que beaucoup d'autres fonctionnaient sans souci... Pas vraiment de log sur Searchstax pour creuser, ni d'option de debug. Le plus étrange, la même requête dans postman répondait correctement, mais en la faisant via le binaire curl, erreur aussi.
Cela semblait arriver sur les très grosses requêtes, sur une de celles qui posait souci, le body de la requête était proche de 8ko, oui, plus de 8000 caractères.
En finissant par comparer les headers, la solution se trouvait dans le « Accept-Encoding: gzip » présent par défaut dans postman. En l'ajoutant à la requête curl, c'est ok.
J'ai donc utilisé un event pour l'ajouter à l'ensemble des requêtes searchApi :
mon_module/src/EventSubscriber/MonModuleSearchSubscriber.php
<?php
namespace Drupal\mon_module\EventSubscriber;
use Solarium\Core\Event\PostCreateRequest as PostCreateRequestEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Pop_produit event subscriber.
*/
class MonModuleSearchSubscriber implements EventSubscriberInterface {
public static function getSubscribedEvents(): array {
return [
PostCreateRequestEvent::class => ['postCreateRequestAddHeader'],
];
}
public function postCreateRequestAddHeader(PostCreateRequestEvent $e) {
$request = $e->getRequest();
$request->addHeader('Accept-Encoding: gzip');
}
}
Plus d'erreur, mais on se retrouve maintenant avec une réponse encodée en gzip, il faut la décoder, pas possible d'utiliser un event ici, j'ai donc du faire un patch pour le fichier search_api_solr/Plugin/search_api/backend/SearchApiSolrBackend.php :
diff --git a/src/Plugin/search_api/backend/SearchApiSolrBackend.php b/src/Plugin/search_api/backend/SearchApiSolrBackend.php
index 752df404..0af49932 100644
--- a/src/Plugin/search_api/backend/SearchApiSolrBackend.php
+++ b/src/Plugin/search_api/backend/SearchApiSolrBackend.php
@@ -1930,6 +1930,9 @@ class SearchApiSolrBackend extends BackendPluginBase implements SolrBackendInter
// Send search request.
$response = $connector->search($solarium_query, $this->getCollectionEndpoint($index));
$body = $response->getBody();
+ if (@gzdecode($body) !== FALSE) {
+ $body = gzdecode($body);
+ }
if (200 != $response->getStatusCode()) {
throw new SearchApiSolrException(strip_tags($body), $response->getStatusCode());
}
et l'ajouter à mon composer.json (voir plus bas pour en savoir plus sur les patchs et composer) :
"patches": {
"drupal/search_api_solr": {
"Gzip Encoding": "./files/patches/search_api_solr_gzip_encoding.patch"
}
}
C'est pas fou, il y a peut-être une solution plus propre, mais j'espère que ça aidera quelqu'un car les ressources sur le sujet semblent inexistantes. La page searchstax concernant ce code d'erreur ne donne aucune piste pointant sur ce genre de solution.
Merci Romain pour m'avoir mis sur la bonne piste !
Contenus en rapport
Si vous utilisez composer pour gérer votre instance de Drupal, vous avez parfois besoin d'appliquer un patch (de votre conception ou depuis drupal.org) que ce soit pour un module tiers ou pour le core.
Si on est "à l'ancienne" on a le core et les module sous gestionnaire de version (git par exemple), cela reste simple, vous appliquez le patch et commitez le tout.
Avec Drupal et Drupal 8 encore plus la recherche passe la plupart du temps par Search API, une interface qui se branche devant plusieurs moteur de base de données (SolR, ElasticSearch, Database...)
Commentaires
Grow Your Asphalt Paving Business with Digital Marketing
In today’s competitive landscape, having a strong online presence is essential for asphalt paving contractors. Customers are increasingly turning to the internet to find local services, and if your business isn’t visible online, you’re missing valuable opportunities. Digital marketing—such as SEO, web design, lead generation, and Google Business Profile optimization—can help you reach more clients, generate leads, and grow your business.
Partnering with <a href="https://asphaltpavingmarketers.com/">Paver Marketers</a> can give your paving business the tools it needs to succeed in the digital world.
Why Digital Marketing Matters for Paving Contractors
Asphalt paving businesses need digital marketing to:
Increase Visibility: Show up in local search results when customers are searching for paving services.
Generate Leads: Attract and convert visitors into customers through effective lead generation strategies.
Enhance Engagement: Build trust and engage with customers on social media, email, and Google.
Track Results: Measure success and optimize campaigns for the best ROI.
Best Digital Marketing Services for Asphalt Paving Contractors
1. SEO for Asphalt Paving Contractors
SEO helps your business rank higher in search results for local keywords, making it easier for customers to find you online. Local SEO, keyword optimization, and content creation are key to improving your visibility.
2. Web Design for Asphalt Paving Contractors
A well-designed, responsive website helps convert visitors into leads. A clean, user-friendly website that’s optimized for mobile and search engines can significantly boost your business.
3. Google Business Profile Optimization
Optimizing your Google Business Profile increases your local visibility, builds trust with customer reviews, and helps customers find your business easily.
4. Lead Generation Services
Lead generation strategies like PPC, landing pages, and email marketing help attract potential clients who are actively searching for paving services and turn them into paying customers.
FAQs
1. How does SEO help my business?
SEO improves your website’s ranking in search results, making it easier for customers to find your paving services online.
2. Why is a good website essential for my business?
A well-designed website helps convert visitors into customers and plays a crucial role in SEO.
3. How does Google Business Profile optimization help my business?
It improves local visibility, builds trust through reviews, and ensures your business shows up in local searches.
4. What is lead generation, and how can it help my business?
Lead generation attracts and nurtures potential customers, turning them into loyal clients.
Start leveraging digital marketing today with <a href="https://asphaltpavingmarketers.com/">Paver Marketers</a> and watch your asphalt paving business thrive!
Thank you so much for this!
[url=https://agencjaprawjazdy.com/]kup zarejestrowane prawo jazdy[/url]
[url=https://xn--fhrerscheinanbieter-59b.com/]führerschein kaufen 2024[/url]
[url=https://ajokorttitoimisto.com/]ostaa rekisteröity ajokortti[/url]
[url=https://xn--valdijogostvny-6gb3qqd.com/]regisztrált jogosítvány vásárlás[/url]
[url=https://www.rijbewijshulp.com/]nederlands rijbewijs kopen[/url]
[url=https://www.echt-rijbewijs.com/]acheter permis de conduire enregistré en préfecture 2024[/url]
[url=https://xn--kanalvozakedozvole-2gc.com/]kupiti registriranu vozačku dozvolu[/url]
[url=https://xn--frerkortkanal-bnb.com/]kjøpe registrert førerkort[/url]
[url=https://xn--krkortshjlpare-eib3z.com/]Köp äkta svenskt körkort[/url]
[url=https://ajudaparacarteirademotorista.com/]comprar carteira de motorista online[/url]
[url=https://koopeenrijbewijscbr.com/]rijbewijs kopen[/url]
[url=https://belgischrijbewijs.com]Rijbewijs Kopen Belgie[/url]
[url=https://comprarepatente.com]comprare patente[/url]
[code]<a href="https://www.documentosenespanol.com/" >Comprar carnet de conducir en españa</a>[/code]
[code]<a href="https://ajokorttitoimisto.com/" >ostaa rekisteröity ajokortti</a>[/code]
[code]<a href="https://agencjaprawjazdy.com/" >kup zarejestrowane prawo jazdy</a>[/code]
[code]<a href="https://xn--kanalvozakedozvole-2gc.com/" >kupiti registriranu vozačku dozvolu</a>[/code]
[code]<a href="https://xn--frerkortkanal-bnb.com/" >kjøpe registrert førerkort</a>[/code]
[code]<a href="https://slavicdocuments.com/" >купити регистровану возачку дозволу</a>[/code]
[code]<a href="https://xn--fhrerscheinkanal-jzb.com/" >registrierten Führerschein kaufen</a>[/code]
[code]<a href="https://www.docsofireland.com/" >Buy Irish driver’s license 2024</a>[/code]
[code]<a href="https://www.docsdebelgique.com/" >acheter un permis de conduire belge enregistré</a>[/code]
[code]<a href="https://www.docsofluxembourg.com/" >Acheter un permis de conduire luxembourgeois</a>[/code]
[code]<a href="https://xn--fhrerscheinanbieter-59b.com/" >führerschein kaufen 2024</a>[/code]
[code]<a href="https://ajudaparacarteirademotorista.com/" >comprar carteira de motorista online</a>[/code]
[code]<a href="https://www.echt-rijbewijs.com/" >Koop echt Belgisch rijbewijs</a>[/code]
[code]<a href="https://www.rijbewijshulp.com/" >nederlands rijbewijs kopen</a>[/code]
[code]<a href="https://xn--valdijogostvny-6gb3qqd.com/" >regisztrált jogosítvány vásárlás</a>[/code]
[code]<a href="https://xn--krkortshjlpare-eib3z.com/" >Köp äkta svenskt körkort</a>[/code]
[code]<a href="https://koopeenrijbewijscbr.com/" rel="dofollow">rijbewijs kopen</a>[/code]
[code]<a href="https://belgischrijbewijs.com" rel="dofollow">Rijbewijs Kopen Belgie</a>[/code]
[code]<a href="https://comprarepatente.com" rel="dofollow">comprare patente</a>[/code]
[code]<a href="https://xn--fhrerscheintuv-gsb.com" rel="dofollow">fuhrerschein kaufen</a>[/code]
[code]<a href="https://xn--cartade-conduo-2hb7d.com" rel="dofollow">comprar carta de conduçao</a>[/code]
[code]<a href="https://omegastrains.com/" >weed store online</a>[/code]
[code]<a href="https://thepathtolaw.com/" >PTE exam preparation</a>[/code]
Zoals altijd bedankt voor deze geweldige berichten. Uitstekende berichten, ik zal nooit een van uw berichten missen.
Ook kunnen wij u helpen uw verlopen Nederlandse rijbewijs binnen drie tot vijf dagen zonder stress te verlengen.
There are many other advantages when purchasing a secondhand mobility scooter. You'll likely get the same warranty and support as the original owner and that is a significant benefit in the long-term. It's also cheaper than brand-new models. You'll save money and avoid the expense of hundreds of dollars for a used mobility scooter. If you know how to negotiate, the cost is likely to be affordable.
https://www.echt-rijbewijs.com/
https://xn--fhrerscheinanbieter-59b.com/
https://www.rijbewijshulp.com/
https://xn--valdijogostvny-6gb3qqd.com/
https://xn--fhrerscheinkanal-jzb.com/
https://www.docsofireland.com/
You'll save money and avoid the expense of hundreds of dollars for a used mobility scooter. If you know how to negotiate, the cost is likely to be affordable.
You may be wondering how to claim compensation for yourself or someone you love has been involved in a car accident. This article will explain the New York State car accident legal process, In certain circumstances, you could also be in a position to sue the at-fault driver for wrongfully dying.
https://www.documentosenespanol.com/
https://ajudaparacarteirademotorista.com/
https://xn--krkortshjlpare-eib3z.com/
https://xn--krekorthjlpere-8ib3z.com/
https://www.docsdebelgique.com/
https://www.docsofluxembourg.com/
https://agencjaprawjazdy.com/
https://xn--kanalvozakedozvole-2gc.com/
A person can file a lawsuit against an at-fault driver in order to recover compensation for their injuries, property damage or loss of earning capacity and more. In certain circumstances, you could also be in a position to sue the at-fault driver for wrongfully dying.
https://koopeenrijbewijscbr.com/
https://belgischrijbewijs.com
https://comprarepatente.com
https://xn--fhrerscheintuv-gsb.com
https://xn--cartade-conduo-2hb7d.com
https://omegastrains.com/
https://xn--frerkortkanal-bnb.com/
https://slavicdocuments.com/
https://ajokorttitoimisto.com/
https://thepathtolaw.com/
Köpa körkort Guns for sale kjøpe førerkort kupie prawo jazdy Führerschein kaufen Comprare la patente Rijbewijs kopen Comprar carta de condução acheter un permis de conduire kupiti vozačku dozvolu koupit řidičský průkaz Führerschein kaufen Comprare patente legalne prawo jazdy do kupienia gdzie można kupić prawo jazdy z wpisem do rejestru sig mcx spear for sale sig mcx spear lt for sale Henry long ranger express Smith Wesson m&p fpc for sale henry 45-70 all weather picatinny rail for sale Henry long ranger for sale plr 16 for sale Henry big boy revolver for sale Henry model x for sale Marlin 1895 trapper for sale marlin model 336 classic for sale sig romeo m17 for sale sig romeo x for sale Comprare patente B Napoli Comprare patente in Roma Comprare la patente a Roma Dove Comprare patente Comprare la patente a Milano Comprare la patente a Palermo Comprare la patente Bulgaria Comprare patente Nautica Comprare patente in Italia Comprare patente Austriaca Comprare patente Illegale Comprare patente b Führerschein kaufen 400 Euros Führerschein kaufen forum registrierten führerschein kaufen berlin Führerschein kaufen Österreich Führerschein kaufen darknet Führerschein kaufen Ausland Führerschein kaufen Polen Deutschen Führerschein kaufen EU Führerschein kaufen Führerschein kaufen Erfahrungen Führerschein Klass B kaufen führerschein kaufen für 500 euro Kjøp falsk førerkort Kjøp falsk førerkort klass b Kjøp svensk førerkort Førerkort klass A Tester ved fornyelse av førerkort Amerikansk førerkort i Norge Bestille nytt førerkort Norsk førerkort i utlandet Kjøpe førerkort klasse c Kjøp førerkort på nett Bytte Førerkort Til Norsk Köp körkort online Köp spanskt körkort Köpa körkort på darknet Körkortonline logga in Köpa körkort utomlands Hur mycket kostar körkort körkort online Köpa körkort EU Köpa danskt körkort Köp svenskt körkort Köp norge körkort
https://solid-arms.com/
https://kupiprawojazdy.com
https://xn--skandinaviskkrkort-p3b.com/
https://acquistapatentediguida.com/
https://geregistreerdrijbewijskopen.com/
https://dokumenteanzeigen.com/
https://kjopeforerkort.com/
https://comprar-cartadeconducao.com/
https://acheter-permis-de-conduire.com/
https://kupiti-vozaku-dozvolu.com/
https://koupi-tridicskyprukaz.com/
https://fuhrerschein-online-kaufen.com/
https://comprare-la-patente.com/
https://kupie-prawo-jazdy.com/
https://kupiprawojazdy.com/gdzie-mozna-kupic-prawo-jazdy-z-wpisem-do-re…
https://solid-arms.com/product/henry-all-weather-45-70-picatinny-rail/
https://solid-arms.com/product/mcx-spear/
https://solid-arms.com/product/sig-sauer-mcx-spear-lt/
https://solid-arms.com/product/henry-long-ranger-express/
https://solid-arms.com/product/smith-wesson-mp-fpc/
https://solid-arms.com/product/plr-16/
https://solid-arms.com/product/big-boy-revolver/
https://solid-arms.com/product/marlin-1895-trapper/
https://solid-arms.com/product/henry-x-model/
https://solid-arms.com/product/model-336-classic/
https://solid-arms.com/product/romeo-m17/
https://solid-arms.com/product/henry-long-ranger/
https://solid-arms.com/product/sig-romeo-x/
https://acquistapatentediguida.com/2023/04/24/comprare-patente-b-napoli/
https://acquistapatentediguida.com/2023/04/24/comprare-patente-in-roman…
https://acquistapatentediguida.com/2023/04/25/comprare-la-patente-a-rom…
https://acquistapatentediguida.com/2023/04/27/dove-comprare-patente/
https://acquistapatentediguida.com/2023/04/28/comprare-la-patente-a-mil…
https://acquistapatentediguida.com/2023/04/29/comprare-patente-a-palerm…
https://acquistapatentediguida.com/2023/04/30/comprare-la-patente-bulga…
https://acquistapatentediguida.com/2023/04/30/comprare-patente-nautica/
https://acquistapatentediguida.com/2023/04/30/comprare-patente-in-itali…
https://acquistapatentediguida.com/2023/05/02/comprare-patente-austriac…
https://acquistapatentediguida.com/2023/09/29/comprare-patente-illegale/
https://acquistapatentediguida.com/comprare-patente-b/
https://dokumenteanzeigen.com/index.php/2023/06/02/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/06/01/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/06/01/registrierten-fuhrer…
https://dokumenteanzeigen.com/index.php/2023/05/31/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/05/31/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/05/30/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/05/27/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/05/27/fuhrerschein-b-kaufe…
https://dokumenteanzeigen.com/index.php/2023/05/21/fuhrerschein-kaufen-…
https://dokumenteanzeigen.com/index.php/2023/05/23/eu-fuhrerschein-kauf…
https://dokumenteanzeigen.com/index.php/2023/10/25/fuhrerschein-kaufen-…
https://kjopeforerkort.com/2023/06/07/kjop-falsk-forerkort/
https://kjopeforerkort.com/2023/06/06/kjop-forerkort-klasse-b/
https://kjopeforerkort.com/2023/06/06/kjop-svensk-forerkort/
https://kjopeforerkort.com/2023/06/05/forerkort-klasse-a/
https://kjopeforerkort.com/2023/06/05/tester-ved-fornyelse-av-forerkort/
https://kjopeforerkort.com/2023/06/05/amerikansk-forerkort-i-norge/
https://kjopeforerkort.com/2023/06/04/bestill-nytt-forerkort-tapt/
https://kjopeforerkort.com/2023/06/04/norsk-forerkort-i-utlandet/
https://kjopeforerkort.com/2023/06/04/kjope-forerkort-klasse-c/
https://kjopeforerkort.com/2023/06/04/kjop-forerkort-pa-nett/
https://xn--skandinaviskkrkort-p3b.com/kop-korkort-online/
https://xn--skandinaviskkrkort-p3b.com/kop-spanskt-korkort/
https://xn--skandinaviskkrkort-p3b.com/kopa-korkort-pa-darknet/
https://xn--skandinaviskkrkort-p3b.com/korkortonline-logga-in/
https://xn--skandinaviskkrkort-p3b.com/kopa-korkort-utomlands/
https://xn--skandinaviskkrkort-p3b.com/hur-mycket-kostar-korkort/
https://xn--skandinaviskkrkort-p3b.com/korkort-online/
https://xn--skandinaviskkrkort-p3b.com/kopa-korkort-eu/
https://xn--skandinaviskkrkort-p3b.com/kopa-danskt-korkort/
https://xn--skandinaviskkrkort-p3b.com/kop-svenskt-korkort/
https://xn--skandinaviskkrkort-p3b.com/kop-norge-korkort/
Ajouter un commentaire