Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2018-04-09 04:57:50

jasonrohrer
New member
Registered: 2017-02-28
Posts: 4

Error: Unable to insert search results.

I've been using FluxBB for years on various sites.  Search has always worked great.

v1.5.10

The site in question has been up and running Flux for more than a year now with no issues.

BUT... I tried searching today (maybe for the first time) and got an error that I've never seen before:

An error was encountered
Error: Unable to insert search results.

You can see an example of this here:

onehouronelife.com/forums/search.php?action=search&keywords=test&author=&search_in=0&sort_by=0&sort_dir=DESC&show_as=topics&search=Submit

The strange thing is that it seems to be intermittent.

I just got it to work a few times, with other failures in between.




This other site of mine is has a working search:

cordialminuet.com/incrementensemble/forums/

That one is v1.5.8


I'm pretty sure I carried out the same install procedure on both, though it was a long time ago.

I looked in the code and can't see anything obvious that would cause the problem.


Any ideas about what I'm doing wrong?

Offline

#2 2018-04-09 07:07:58

Mark
Member
From: Southport, Uk
Registered: 2008-05-03
Posts: 507

Re: Error: Unable to insert search results.

enable debug mode and see what the error says.
insert this into config.php

define('PUN_DEBUG', 1);

disable that again though once you see what it says

Offline

#3 2018-04-10 14:49:13

jasonrohrer
New member
Registered: 2017-02-28
Posts: 4

Re: Error: Unable to insert search results.

I see:

File: /search.php
Line: 438

FluxBB reported: Unable to insert search results

Database reported: Duplicate entry '963932192' for key 'PRIMARY' (Errno: 1062)

Seems like mt_rand may be returning the same value over and over.  If I hit reload, I see that ID and then also this one:

Database reported: Duplicate entry '1273124119' for key 'PRIMARY' (Errno: 1062)

Only those two values....

I think the reason it is intermittent is that eventually the blocking cached search is cleared after it gets old enough, and then a new search can finally go through.

PHP 5.6.30-10+deb.sury.org~xenial+2 (cli)

The seeding call mt_srand isn't being done anywhere in FluxBB.

After PHP 4.2, the seeding is supposed to be done automatically.

Looks like it is not being done in this case.

I realized that the hosts that are working are running on CentOS/Apache, and this one that isn't working is running on Ubuntu/nginx (Linode).

So, there's some difference there...

Interesting that mt_rand is ONLY called in search.

The rest of the code seems to call only rand...  hmmm....

Switching to rand fixed it.

Offline

#4 2018-04-10 18:29:19

Mark
Member
From: Southport, Uk
Registered: 2008-05-03
Posts: 507

Re: Error: Unable to insert search results.

dont know if rebuilding search index will fix that?
admin_maintenance.php

Offline

#5 2018-04-10 21:40:46

jasonrohrer
New member
Registered: 2017-02-28
Posts: 4

Re: Error: Unable to insert search results.

mt_rand is returning the same number over and over, so I don't think rebuilding the search index will help.  If the search ID is the same as the last search ID, there will be a collision.

For whatever reason, my install of PHP isn't seeding mt_rand correctly, but IS seeding rand correctly.  I don't think mt_rand is even needed here.

Is fluxbb still being actively developed somewhere?  I looked at github, and thought about submitting a work-around for this problem, but the github project looks like it hasn't been touched in a while.

Offline

#6 2018-04-11 06:46:55

Mark
Member
From: Southport, Uk
Registered: 2008-05-03
Posts: 507

Re: Error: Unable to insert search results.

i think the lead developer is working on a new software (flarum) so fluxbb is slowly being pushed away by looks of it

Offline

#7 2018-04-11 07:01:11

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,512
Website

Re: Error: Unable to insert search results.

@jasonroher: Please feel free to submit a pull request.

I will release a new version of FluxBB in the next few days anyway, so I would love to include this fix.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#8 2018-04-11 14:53:54

jasonrohrer
New member
Registered: 2017-02-28
Posts: 4

Re: Error: Unable to insert search results.

Done.

Flarum looks cool, by the way.

Offline

Board footer

Powered by FluxBB