New SOLR server says ‘Solr HTTP error: Upgrade Required (426)’

  • webmasterbslnl
    Participant
    8 months, 2 weeks ago #35275

    Hi,
    I created a new SOLR server (Solr 8 docker in a k8s platform) which is accessed over https port 443. I then entered my server details on tab 0 and press the button ‘check the index status….’. After 10 seconds the message ‘Solr HTTP error: Upgrade Required (426)’ is shown. I discussed this with the k8s tech people and they say WPSOLR makes a call using HTTP1.0 which is obsolete and no longer allowed. I tried it on a different WordPress host and same thing happened. Finally traced it down to solarium calling the server at \wpsolr-pro\wpsolr\core\vendor\solarium\solarium\src\Core\Client\Adapter\Http.php:176 using a setting ‘protocol_version = 1.0’ at line 79. Hacking it to ‘1.1’ helped, the index got created without problem. Indexing documents remains a problem however. After a few successful batches of 10 documents the indexing stops:

    Error on line 176 of file ...../plugins/wpsolr-pro/wpsolr/core/vendor/solarium/solarium/src/Core/Client/Adapter/Http.php: file_get_contents(https://test.k8s.somewhere.com:443/solr/acc-test/update?omitHeader=false&wt=json&json.nl=flat): Failed to open stream: HTTP request failed!

    Can you think of a solution? Can I force solarium to use the curl adapter instead of http? I have curl support enabled in my webserver.

    wpsolr
    Keymaster
    8 months, 2 weeks ago #35278

    You can try to fix the code in wpsolr/core/classes/engines/solarium/class-wpsolr-solariumclient.php, line 66.

    Replace:
    return new Client( new Http(), new EventDispatcher(), $solarium_config );
    with
    return new Client( Solarium\Core\Client\Adapter\Curl(), new EventDispatcher(), $solarium_config );

    If this is fine, I’ll add an option in WPSOLR 23.4’s Solr index screen to switch from http() to Curl().

    webmasterbslnl
    Participant
    8 months, 2 weeks ago #35280

    It works with this fixed line 66:
    return new Client( new Curl(), new EventDispatcher(), $solarium_config );
    (so replace new Http() with new Curl()) and also replace at line 6 (or add if you want to be able to choose between the two later):
    use Solarium\Core\Client\Adapter\Curl;
    fyi: index performance seems the same if I compare the two options on another Solr server that does accept http 1.0.

    Thanks for your help!

    wpsolr
    Keymaster
    8 months, 2 weeks ago #35281

    It will be delivered in WPSOLR 23.4.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.