Error PHP 8.1

  • Yann
    Participant
    2 years, 2 months ago #29140

    Hi,
    I get this error at the indexing windows after upgrading everything.
    Error on line 63 of file /var/www/html/wp-content/plugins/wpsolr-pro/wpsolr/core/vendor/rmccue/requests/library/Requests/Cookie/Jar.php: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice


    I now get:

    Error code: parsererror
    Error message: SyntaxError: Unexpected token { in JSON at position 339
    {“nb_results”:0,”status”:8192,”message”:”Error on line 160 of file \/var\/www\/html\/wp-content\/plugins\/wpsolr-pro\/wpsolr\/core\/vendor\/solarium\/solarium\/src\/Component\/RequestBuilder\/RequestParamsTrait.php: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated”,”indexing_complete”:false}{“nb_results”:0,”status”:8192,”message”:”Error on line 60 of file \/var\/www\/html\/wp-content\/plugins\/wp-mail-smtp\/vendor\/woocommerce\/action-scheduler\/classes\/ActionScheduler_DateTime.php: Return type of ActionScheduler_DateTime::setTimezone($timezone) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice”,”indexing_complete”:false}

    using PHP 8.1.2, Solr 8.11.1 on debian

    • This topic was modified 2 years, 2 months ago by wpsolr.
    • This topic was modified 2 years, 2 months ago by wpsolr.
    wpsolr
    Keymaster
    2 years, 2 months ago #29142

    It looks like compatibility issue with PHP 8.
    WPSOLR is tested with PHP 7.4

    Yann
    Participant
    2 years, 2 months ago #29145

    Thanks, I was able to downgrade. Caused other issues that are now fixed.
    Current one is now this on Solr:

    03/02/2022, 11:58:55
    ERROR false
    x:xxxxxxxxxxxxxx
    RequestHandlerBase
    org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Query Field 'title' is not a valid field name

    I must say that we had some specific settings in the Solr5 version before I upgrade to 8.11.1. The current version setting is curently vanilla. I do not know how to migrate ald settings to the new index I created. I am progressing one error fix at a time.

    wpsolr
    Keymaster
    2 years, 2 months ago #29147

    This error means that the “title” field is expected in your solr schema.xml.
    You need to merge your schema.xml and WPSOLR’s schema.xml.
    I advise to create a new index from WPSOLR admin. It will deploy the schema.xml required. You can then change it if necessary.

    Yann
    Participant
    2 years, 2 months ago #29151

    OK Thanks.
    Started over again with this, So got the new index running.
    I got 2 different type of infomration. Video and Pdf. Knowing it’s harder for pdf, I tried indexing only video. It went well.
    Back on the pdf articles indexing, I get this error from the index button:

    An error occured:
    Solr HTTP error: Bad Request (400) { "responseHeader":{ "status":400, "QTime":213}, "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","java.io.CharConversionException"], "msg":"Invalid UTF-8 middle byte 0x3c (at char #337493, byte #343591)", "code":400}}
    Yann
    Participant
    2 years, 2 months ago #29152

    Following another tip, I tested indexing 1 element at a time. I was able to index the first 27 files. I can see it’s not good.:
    search result with exerpt:
    Le fruit de la vigne
    ://biblia.com/bible/ec-sbgbibs212007/Jn15.1-3, “file_metadata”:, “pdf:PDFVersion”,, “xmp:CreatorTool”,, “Company”,, “stream_content_type”,, “pdf:hasXFA”,, …

    Maybe it is now related to the solr custom configuration we had on version 5 ?

    • This reply was modified 2 years, 2 months ago by wpsolr.
    wpsolr
    Keymaster
    2 years, 2 months ago #29154

    Can you describe the problem/error?

    Yann
    Participant
    2 years, 2 months ago #29155

    When I index, i get the utf8 error as desceibed 2 posts up here after the first 27 pdf.
    For the ones that get indexed, it seems to keep document coding in the result. The text exerpt I guess. You can test it at egliserealite.com.

    wpsolr
    Keymaster
    2 years, 2 months ago #29156

    As other PDfs are indexed fine, you should prevent this PDF being indexed: edit your post and use the WPSOLR’s meta box check box “Do not search” for that.

    Yann
    Participant
    2 years, 2 months ago #29158

    Hi,
    I made a lot of test and found out a weird behaviour that makes me think it’s not the pdf. (btw, It was working with old 2017 installation).

    1. Index using step 3. of the wpsolr plugin admin,
    2. Error raise, I find the title of the post from the debug information
    2

    3. I find and open the problematic post
    4. I just save the post without doing anychange:
    4
    You see that it raise a indexing error.
    5. I can see there is no text in the post description and the exerpt. I add a space in the post description and save again:
    https://ibb.co/47qtwn2
    Now it works….
    6. I also tested add a space in the exerpt field and it also works.

    So, it makes me think it is really not pdf related. I got 700 like that. Any idea how ot fix this?

    wpsolr
    Keymaster
    2 years, 2 months ago #29162

    I just tested indexing some posts with only a title with Solr 8.9. It went well.

    Yann
    Participant
    2 years, 2 months ago #29168

    Huh What is this answer? Is it supposed to help me fix the issues for the client?
    Still having Invalid UTF-8 middle byte 0x3c (at char #337493, byte #343591), search results are bad. All of that after paying 400$ plus sysadmin to upgrade from Solr V5.4

    wpsolr
    Keymaster
    2 years, 2 months ago #29169

    What is this answer? Is it supposed to help me fix the issues for the client?

    It just means I could not replicate your issue on my environments. I gave you my Solr version, so you can compare to yours eventually. You can eventually set a whitespace character to all your description by hand or code, as a workaround.

    All of that after paying 400$ plus sysadmin to upgrade from Solr V5.4

    This has nothing to do with WPSOLR. We do not install, maintain, or host Solr for clients. But we provide connectors to some Solr hosting services, like Opensolr or Searchstax, if you do not want to do it.

    Still having Invalid UTF-8 middle byte 0x3c

    This is an error that comes from a format problem in documents. Nothing that can be fixed. You can check similar issue on https://www.wpsolr.com/forums/topic/indexing-error-invalid-utf-8-middle-byte-0x3c/.

    Please create a topic for each of those issues. It will be easier to follow up each problem individually.

    This topic was about PHP 8.1, and was mentioned by you as solved, therefore closed.

    • This reply was modified 2 years, 2 months ago by wpsolr.
    • This reply was modified 2 years, 2 months ago by wpsolr.
    • This reply was modified 2 years, 2 months ago by wpsolr.
Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.