appwrite / appwrite/templates

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

Open
#327 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
174
Forks
129
Avg merge
2h 46m
Merged PRs (30d)
3

Description

### 👟 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?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.