Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getcandy:meilisearch:setup Error: Index getcandy_orders not found #8

Closed
poppabear8883 opened this issue Dec 23, 2021 · 12 comments
Closed
Labels
bug Something isn't working

Comments

@poppabear8883
Copy link
Contributor

Output:

vagrant@homestead:~/projects/karve$ php artisan getcandy:meilisearch:setup

   MeiliSearch\Exceptions\ApiException 

  Index `getcandy_orders` not found.

  at vendor/meilisearch/meilisearch-php/src/Http/Client.php:211
    207▕ 
    208▕         if ($response->getStatusCode() >= 300) {
    209▕             $body = $this->jsonDecode($response->getBody()->getContents()) ?? $response->getReasonPhrase();
    210▕ 
  ➜ 211▕             throw new ApiException($response, $body);
    212▕         }
    213▕ 
    214▕         return $this->jsonDecode($response->getBody()->getContents());
    215▕     }

      +21 vendor frames 
  22  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Meilisearch is running and configured correctly:

A Master Key has been set. Requests to MeiliSearch won't be authorized unless you provide an authentication key.

Documentation:          https://docs.meilisearch.com
Source code:            https://github.com/meilisearch/meilisearch
Contact:                https://docs.meilisearch.com/resources/contact.html or bonjour@meilisearch.com

[2021-12-23T16:38:30Z INFO  actix_server::builder] Starting 1 workers
[2021-12-23T16:38:30Z INFO  actix_server::builder] Starting "actix-web-service-127.0.0.1:7700" service on 127.0.0.1:7700
[2021-12-23T16:38:46Z INFO  actix_web::middleware::logger] 127.0.0.1:60732 "GET /indexes HTTP/1.1" 200 2 "-" "GuzzleHttp/7" 0.000120
[2021-12-23T16:38:46Z INFO  actix_web::middleware::logger] 127.0.0.1:60732 "GET /indexes/getcandy_orders HTTP/1.1" 404 159 "-" "GuzzleHttp/7" 0.000089
@poppabear8883
Copy link
Contributor Author

poppabear8883 commented Dec 23, 2021

Routes don't seem to be getting registered ? Are we missing a step in the Install process ?

Routes are fine after running: php artisan optimize

However, above issue remains, is there no indexes routes ?

@glennjacobs
Copy link
Contributor

Seems a bit strange. I can’t replicate here. Can you let me know what version of Meilisearch you are running?

@poppabear8883
Copy link
Contributor Author

Database path:          "./data.ms"
Server listening on:    "http://127.0.0.1:7700"
Environment:            "development"
Commit SHA:             "0a1d2ce2318c26f36ddcb82d3159b8003120b84f"
Commit date:            "2021-11-15T18:02:07+00:00"
Package version:        "0.24.0"

@justtomisfine
Copy link

I got this as well when setting up mine, running 0.24.0 as well.

https://github.com/getcandy/core/blob/e451be656109fa61f6200608ef400e1bd912c2b0/src/Console/Commands/MeilisearchSetup.php#L50

Haven't had much experience in scout but I think we want to do createIndex instead of getIndex.

In the meantime, @poppabear8883, this can be fixed by doing php artisan scout:index getcandy_orders.

@glennjacobs glennjacobs added the bug Something isn't working label Dec 24, 2021
@alecritson
Copy link
Collaborator

There's an update on 2.0-beta4 so now when you run

php artisan getcandy:meilisearch:setup

It should now look to see if we have the required indexes and if not, create them. If, after updating and running this command, it still doesn't solve the issue, let us know :)

@poppabear8883
Copy link
Contributor Author

$ composer update getcandy/getcandy
...
  - Upgrading getcandy/getcandy (2.0-beta3 => 2.0-beta4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading getcandy/getcandy (2.0-beta4)
  - Upgrading getcandy/getcandy (2.0-beta3 => 2.0-beta4): Extracting archive
...
No publishable resources for tag [laravel-assets].
Publishing complete.
vagrant@homestead:~/projects/karve$ php artisan getcandy:meilisearch:setup

   MeiliSearch\Exceptions\ApiException 

  Index `getcandy_orders` not found.

  at vendor/meilisearch/meilisearch-php/src/Http/Client.php:211
    207▕ 
    208▕         if ($response->getStatusCode() >= 300) {
    209▕             $body = $this->jsonDecode($response->getBody()->getContents()) ?? $response->getReasonPhrase();
    210▕ 
  ➜ 211▕             throw new ApiException($response, $body);
    212▕         }
    213▕ 
    214▕         return $this->jsonDecode($response->getBody()->getContents());
    215▕     }

      +21 vendor frames 
  22  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

@alecritson
Copy link
Collaborator

🤔 It almost sounds like it hasn't updated the core for some reason...if you look at this PR this is the code introduced to handle it https://github.com/getcandy/core/pull/4/files can you confirm if this exists in vendor/getcandy/core/src/Console/Commands/MeilisearchSetup.php

The version for the core should be 2.0-beta3

@alecritson alecritson reopened this Jan 4, 2022
@poppabear8883
Copy link
Contributor Author

Appears you are correct, the above changes to getcandy/core were not updated via composer update getcandy/getcandy

getcandy/getcandy 's composer.json file looks like it should update it correctly ?

"require": {
        "php": "^8.0",
        "getcandy/core": "^2.0",
        "livewire/livewire": "^2.0",
        "getcandy/licensing": "dev-main",
        "livewire-ui/modal": "^1.0"
    },

@alecritson
Copy link
Collaborator

What if you tried this:

composer update getcandy/getcandy --with-dependencies

I'm not entirely sure why it didn't update, unless it was before Packagist had a chance to update their indexes? I tried an install this morning and it was pulling up to date versions in.

@poppabear8883
Copy link
Contributor Author

This seems to have pulled in the changes.

Updating dependencies
Lock file operations: 0 installs, 10 updates, 0 removals
  - Upgrading getcandy/core (2.0-beta2 => 2.0-beta3)
...

Maybe you are correct in assuming a Packagist issue ? We can probably close this issue until it further warrants additional attention ? I will attempt a fresh install later to confirm that the install process completes without issues.

@alecritson
Copy link
Collaborator

Sounds good. We've got a release scheduled soon so I'll try the updating to see why the core might not be updating at the same time, hopefully it's something simple!

@elephantux
Copy link

Got the same error on hub/orders page.
Clean setup, Laravel Framework 9.3.1

Alse get Index `getcandy_customers` not found. on hub/customers page

glennjacobs pushed a commit that referenced this issue Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants