Open cnych opened 2 years ago
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. eng
for English)
If alls above info is correct, please send you detail setup info :)
@ganuonglachanh 中文的话 locale code 应该设置成多少?zho?不对,用默认的 eng 在 Sonic 这边是可以生成一部分索引的,只是不全~
Ingest.php
这个文件是在什么地方呢?没有找到
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!
valeriansaliou/sonic:v1.3.2
docker image in kubernetescomposer require ganuonglachanh/sonic
commandphp flarum sonic:addtoindex
command. Finally got the error mentioned above!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
echo $post->content . PHP_EOL;
then rerun the php flarum sonic:addtoindex
command
Hello, I encountered the same problem, I did the debugging according to your meaning, and the content of one of my articles appeared above the console error. Also I have set the “cmn”
thx!
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 echo $post->content . PHP_EOL;
to the code, I noticed that before Ingest.php
throws InvalidArgumentException
, a very long post is printed in the console and it stayed there for quite a while. I guess it is something related to size limit exceeded...
a very long post is printed in the console and it stayed there for quite a while
After update codes near https://github.com/ganuonglachanh/flarum-sonic/blob/ebbeb19331055f7491157018ea4b5c7a09fc373d/src/Console/AddToIndex.php#L71 to:
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
I guess it is something related to size limit exceeded...
This issue from dependency might be related: https://github.com/ppshobi/psonic/pull/23 After applying this pr manually, I'm still encountering this exception.
A temp workaround is to continue push after the exception thrown after 60s timeout, for this u can update this line https://github.com/ganuonglachanh/flarum-sonic/blob/ebbeb19331055f7491157018ea4b5c7a09fc373d/src/Console/AddToIndex.php#L71 with
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: https://github.com/valeriansaliou/sonic/issues/43#issuecomment-476492283
Notice that there's no ERR for the async protocol (ie. if an EVENT never comes due to an error). You may thus implement a timeout strategy on your end.
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.
You can manually change the composer package source to the github repo: https://stackoverflow.com/questions/12954051/use-php-composer-to-clone-git-repo https://getcomposer.org/doc/05-repositories.md, or just git clone
and rename its path inside vendor
.
Seems he forgot to sync the release on packagist.
You can manually change the composer package source to the github repo: https://stackoverflow.com/questions/12954051/use-php-composer-to-clone-git-repo https://getcomposer.org/doc/05-repositories.md, or just
git clone
and rename its path insidevendor
.
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