Laravel/Meilisearch -您是否忘记添加\“http(s)://\"?

mzsu5hc0  于 2022-11-26  发布在  其他
关注(0)|答案(1)|浏览(91)

bounty将在2天后过期。回答此问题可获得+50声望奖励。Felix希望吸引更多人关注此问题。

我目前正试图让我的网站和Laravel锻造运行。
虽然我的本地网站一切正常,但我在制作网站上遇到了一个错误。
我尝试使用具有“Searchable”特性的模型的任何POST请求都会返回如下错误:

[2022-11-16 06:06:49] production.ERROR: Invalid URL: scheme is missing in "/indexes/comments/documents/delete-batch". Did you forget to add "http(s)://"? {"userId":1,"exception":"[object] (Symfony\\Component\\HttpClient\\Psr18RequestException(code: 0): Invalid URL: scheme is missing in \"/indexes/comments/documents/delete-batch\". Did you forget to add \"http(s)://\"? at /home/forge/mainchan.com/vendor/symfony/http-client/Psr18Client.php:122)
[stacktrace]
#0 /home/forge/mainchan.com/vendor/meilisearch/meilisearch-php/src/Http/Client.php(162): Symfony\\Component\\HttpClient\\Psr18Client->sendRequest()
#1 /home/forge/mainchan.com/vendor/meilisearch/meilisearch-php/src/Http/Client.php(99): MeiliSearch\\Http\\Client->execute()
#2 /home/forge/mainchan.com/vendor/meilisearch/meilisearch-php/src/Endpoints/Delegates/HandlesDocuments.php(89): MeiliSearch\\Http\\Client->post()
#3 /home/forge/mainchan.com/vendor/laravel/scout/src/Engines/MeiliSearchEngine.php(96): MeiliSearch\\Endpoints\\Indexes->deleteDocuments()
#4 /home/forge/mainchan.com/vendor/laravel/scout/src/Searchable.php(84): Laravel\\Scout\\Engines\\MeiliSearchEngine->delete()
#5 /home/forge/mainchan.com/vendor/laravel/scout/src/Searchable.php(46): App\\Comment->queueRemoveFromSearch()
#6 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php(124): Illuminate\\Database\\Eloquent\\Collection->Laravel\\Scout\\{closure}()
#7 /home/forge/mainchan.com/vendor/laravel/scout/src/Searchable.php(192): Illuminate\\Support\\Collection->__call()
#8 /home/forge/mainchan.com/vendor/laravel/scout/src/ModelObserver.php(103): App\\Comment->unsearchable()
#9 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(424): Laravel\\Scout\\ModelObserver->saved()
#10 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#11 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(189): Illuminate\\Events\\Dispatcher->dispatch()
#12 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1035): Illuminate\\Database\\Eloquent\\Model->fireModelEvent()
#13 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1006): Illuminate\\Database\\Eloquent\\Model->finishSave()
#14 /home/forge/mainchan.com/app/Http/Controllers/SubmitCommentController.php(194): Illuminate\\Database\\Eloquent\\Model->save()
#15 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\SubmitCommentController->postComment()
#16 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#17 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#18 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#19 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run()
#20 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#21 /home/forge/mainchan.com/app/Http/Middleware/CheckBanned.php(32): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\CheckBanned->handle()
#23 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#25 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(103): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#27 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(55): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()
#28 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#29 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#31 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#33 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#35 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(103): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()
#37 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(55): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()
#38 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#39 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#41 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#43 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#45 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#46 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then()
#48 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack()
#49 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute()
#50 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute()
#51 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch()
#52 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#53 /home/forge/mainchan.com/vendor/beyondcode/laravel-query-detector/src/QueryDetectorMiddleware.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BeyondCode\\QueryDetector\\QueryDetectorMiddleware->handle()
#55 /home/forge/mainchan.com/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#57 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#59 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#60 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#62 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#63 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#65 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#67 /home/forge/mainchan.com/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle()
#69 /home/forge/mainchan.com/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#70 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#71 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#72 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then()
#73 /home/forge/mainchan.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#74 /home/forge/mainchan.com/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#75 {main}

它将始终显示“无效URL:scheme”和:是否忘记添加“http(s)://"?"。
我注意到在所有这些日志中似乎都有一些与“MeiliSearchEngine”有关的东西。
其他人有过类似的问题吗?
如果我不得不猜测,这是错误可能是造成时,meilisearch是试图索引这些新的可搜索模型。
这是我的侦察机配置

return [

    'driver' => env('SCOUT_DRIVER', 'algolia'),

    'prefix' => env('SCOUT_PREFIX', ''),

    'queue' => env('SCOUT_QUEUE', false),

    'after_commit' => false,

    'chunk' => [
        'searchable' => 500,
        'unsearchable' => 500,
    ],

    'soft_delete' => false,

    'identify' => env('SCOUT_IDENTIFY', false),

    'algolia' => [
        'id' => env('ALGOLIA_APP_ID', ''),
        'secret' => env('ALGOLIA_SECRET', ''),
    ],
    
    'meilisearch' => [
        'host' => env('MEILISEARCH_HOST', 'http://127.0.0.1:7700'),
        'key' => env('MEILISEARCH_KEY', null),
        'settings' => [
            \App\Submission::class => [
                'updateFilterableAttributes'=> ['nsfw',],
            ],      
        ],  
    ],
];
webghufk

webghufk1#

.env文件中有重复的SCOUT_DRIVER变量。

相关问题