Skip to content

🐛 Bug Report: sync with meilisearch in php does not work #327

@barart

Description

@barart

👟 Reproduction steps

Just clone the repo and create a new function, execute it and you got error curl error on the execution logs, and inspecting the executor container it throw this error:

`
Fatal error: Uncaught Http\Discovery\Exception\DiscoveryFailedException: Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors

  • No valid candidate found using strategy "Http\Discovery\Strategy\CommonClassesStrategy". We tested the following candidates: Http\Discovery\Strategy\CommonClassesStrategy::symfonyPsr18Instantiate, GuzzleHttp\Client, Http\Discovery\Strategy\CommonClassesStrategy::buzzInstantiate.
  • No valid candidate found using strategy "Http\Discovery\Strategy\CommonPsr17ClassesStrategy". We tested the following candidates: .
    in /usr/local/server/src/function/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php:41
    Stack trace:
    0 /usr/local/server/src/function/vendor/php-http/discovery/src/ClassDiscovery.php(94): Http\Discovery\Exception\DiscoveryFailedException::create(Array)
    1 /usr/local/server/src/function/vendor/php-http/discovery/src/Psr18ClientDiscovery.php(26): Http\Discovery\ClassDiscovery::findOneByType('Psr\Http\Client...')
    2 /usr/local/server/src/function/vendor/meilisearch/meilisearch-php/src/Http/Client.php(47): Http\Discovery\Psr18ClientDiscovery::find()
    3 /usr/local/server/src/function/vendor/meilisearch/meilisearch-php/src/Client.php(52): Meilisearch\Http\Client->__construct('xxxxxxxxxxxxxx', 'zzzzzzzzzzzzz', NULL, NULL, Array, NULL)
    4 /usr/local/server/src/function/src/index.php(42): Meilisearch\Client->__construct('xxxxx', 'zzzz')
    5 /usr/local/server/src/server.php(194): {closure}(Object(RuntimeContext))
    6 /usr/local/server/src/server.php(203): {closure}()
    7 @swoole-src/library/core/Coroutine/functions.php(43): {closure}()
    }
    Next Http\Discovery\Exception\NotFoundException: No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter". in /usr/local/server/src/function/vendor/php-http/discovery/src/Psr18ClientDiscovery.php:28
    Stack trace:
    0 /usr/local/server/src/function/vendor/meilisearch/meilisearch-php/src/Http/Client.php(47): Http\Discovery\Psr18ClientDiscovery::find()
    1 /usr/local/server/src/function/vendor/meilisearch/meilisearch-php/src/Client.php(52): Meilisearch\Http\Client->__construct('xxxx', 'zzzzzzzzzzzz', NULL, NULL, Array, NULL)
    2 /usr/local/server/src/function/src/index.php(42): Meilisearch\Client->__construct('xxxxx', 'zzzzzzzzzzz')
    3 /usr/local/server/src/server.php(194): {closure}(Object(RuntimeContext))
    4 /usr/local/server/src/server.php(203): {closure}()
    5 @swoole-src/library/core/Coroutine/functions.php(43): {closure}()
    }
    thrown in /usr/local/server/src/function/vendor/php-http/discovery/src/Psr18ClientDiscovery.php on line 28
    `

👍 Expected behavior

should sync with meilisearch

👎 Actual Behavior

it throw error

🎲 Appwrite version

Version 1.5.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions