SyntaxError: Unexpected token { in JSON at position 1314

  • wpsolr
    Keymaster
    4 years, 2 months ago #16576

    What is your index configuration parameters in WPSOLR (name, path, http/https, host)?

    aksm
    Participant
    4 years, 2 months ago #16577

    Name: local_search
    path: /solr/wams
    scheme: http
    host: localhost

    wpsolr
    Keymaster
    4 years, 2 months ago #16578

    Strange, the error is for /solr/search

    Can you:
    – delete the index configuration in WPSOLR (with the checkbox “Delete the index data”)
    – Verify in Solr admin that the index is no more
    – Create a new index from WPSOLR
    – Check your logs

    wpsolr
    Keymaster
    4 years, 2 months ago #16579

    Also, the error mention port 443. You should use https?

    aksm
    Participant
    4 years, 2 months ago #16581

    Still getting the same error after recreating the index. I think that debug.log might be an old error. I cleared before recreating, and there’s nothing there now.

    What’s odd is that if I stop the indexing in the middle of the error, the dashboard shows that all the documents are in the index.

    wpsolr
    Keymaster
    4 years, 2 months ago #16582

    Can you check in the Solr admin that the documents are there?

    aksm
    Participant
    4 years, 2 months ago #16583

    Yup, all documents are there.

    wpsolr
    Keymaster
    4 years, 2 months ago #16584

    And when you publish a single document in the WP admin, no error?

    aksm
    Participant
    4 years, 2 months ago #16585

    Same error with single document.

    Hmm, I’m just noticing now an error at the bottom of the dashboard debugging:

    {“nb_results”:0,”status”:8,”message”:”Error on line 384 of file \/var\/www\/wordpress\/wp-content\/plugins\/wpsolr-pro\/wpsolr\/core\/ajax_solr_services.php: Trying to access array offset on value of type null”,”indexing_complete”:false}

    Could it be a PHP version problem?

    wpsolr
    Keymaster
    4 years, 2 months ago #16586

    Which PHP version is yours?

    aksm
    Participant
    4 years, 2 months ago #16587

    7.4

    wpsolr
    Keymaster
    4 years, 2 months ago #16588

    It looks like the error catching code is itself … in error.

    Can you edit file /wp-content/plugins/wpsolr-pro/wpsolr/core/ajax_solr_services.php and replace line 384:
    if ( E_ERROR === $last_error['type'] ) {

    with:
    if ( isset( $last_error ) && isset( $last_error['type'] ) && ( E_ERROR === $last_error['type'] ) ) {

    aksm
    Participant
    4 years, 2 months ago #16593

    That seems to do it. Thanks!

    wpsolr
    Keymaster
    4 years, 2 months ago #16598

    The fix will be delivered within the next release.

Viewing 14 posts - 16 through 29 (of 29 total)

You must be logged in to reply to this topic.