-
Notifications
You must be signed in to change notification settings - Fork 6
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
执行 addtoindex 命令报错 InvalidArgumentException #7
Comments
Did you do the step 3 Change info in admin setting before run this command? |
@ganuonglachanh 配置了的 因为我这里是跑在k8s里面的,所以需要修改下host地址 |
If you're sure the host is correct, does the password is same as the default (SecretPassword)? P/S: and if you're using Chinese, locale should not be "eng" (an ISO 639-3 locale code eg. If alls above info is correct, please send you detail setup info :) |
@ganuonglachanh 中文的话 locale code 应该设置成多少?zho?不对,用默认的 eng 在 Sonic 这边是可以生成一部分索引的,只是不全~
|
Sonic locale code for Chinese should be "cmn" https://github.com/ppshobi/psonic/blob/master/src/Ingest.php Please send you detail setup info for futher investigation and could you please use English for conversation? |
Sorry!
3Q |
Thanks, I tested with valeriansaliou/sonic:v1.3.2 with no error. Is your flarum install is test data? Could you send me the exported database of test flarum? If you couldn't provide database, what is your charset and collation setting in flarum config.php ? You can try to debug the content that have error by adding this code to the line 69 of src/Console/AddToIndex.php
then rerun the |
Same problem here. I couldn't provide the database but I can share the config in config.php: 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', When I add the |
After update codes near flarum-sonic/src/Console/AddToIndex.php Line 71 in ebbeb19
we can see that for a 52kib long string it takes 60s long hanging to throw the exception: So I guess there might be some hard timeout limit being set to 60s
This issue from dependency might be related: ppshobi/psonic#23 |
A temp workaround is to continue push after the exception thrown after 60s timeout, for this u can update this line flarum-sonic/src/Console/AddToIndex.php Line 71 in ebbeb19
try {
$ingest->push('postCollection', 'flarumBucket', $post->id,$post->content, $locale);
} catch (\Throwable $th) {
echo "$post->id failed: " . strlen($post->content) . ' bytes ' . round((microtime(true) - $start) * 1000, 2) . 'ms passed' . PHP_EOL;
} |
I found a note from the author of upstream sonic repo: valeriansaliou/sonic#43 (comment)
|
Thanks @n0099 for the investigation, fixed in new release |
Hi @ganuonglachanh , I'm willing to tryout the new fix, but it seems that the new release is not installable by composer? Running composer update still gives 0.1.5 |
Seems he forgot to sync the release on packagist. |
Good suggestion, will try 😋 |
Released new version, I lost in time @@ |
php flarum sonic:addtoindex
Starting...
Flush old postCollection: 1
Adding to index...
In Ingest.php line 63:
[InvalidArgumentException]
sonic:addtoindex
The text was updated successfully, but these errors were encountered: