1 (edited by pradtf 2016-10-03 17:02)

Topic: [SOLVED] vanished posts

running PunBB 1.4.1 with postgresql 9.5 and many posts seem to have disappeared.

everything was fine on the old setup with postgresql 9.1 and all posts were showing up perfectly (including the latex equations). this was on a debian system inside of a virtual machine using openvz. the webserver was lighttp.

we switch to a ubuntu server (and no virtual machine) with postgresql 9.5 and apache2 copying the punbb directory (with permissions intact) and doing a postgresql dumpall. when we restored the dump and tried to go to the forums all posts seem to be showing up just fine except mine! and i am the admin!

here is an example from http://towardsfreedom.com/tfbb/
http://towardsfreedom.com/tfbb/viewforum.php?id=14

you'll see that clicking on any topic say "steps":
http://towardsfreedom.com/tfbb/viewtopic.php?id=67

show my input contains only the signature. the complete post does exist on the postgresql database though.

also, some of my posts occasionally do appear, but i have not been able to figure out a pattern yet.

i've tried to rebuild the index, but doing so seems to accomplish nothing.

i would appreciate ideas which may lead to a solution. thx!

in friendship,
prad

Re: [SOLVED] vanished posts

What is written in the error.log file?

Parserus, UserAgentAnalyzer.
I speak only Russian  :P

Re: [SOLVED] vanished posts

You can throw me a file of your forum and database.? I'll see what I can do.

Re: [SOLVED] vanished posts

Visman wrote:

What is written in the error.log file?

doing a tail -f on error-towardsfreedom.com.log
anytime we go to a topic where we see actual posts
(eg http://towardsfreedom.com/tfbb/viewtopic.php?id=68)

the log fills up with errors:

====
[Sun Oct 02 09:42:00.945047 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#2 used as offset, casting to integer (2) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.948806 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#4 used as offset, casting to integer (4) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.949553 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#5 used as offset, casting to integer (5) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.950121 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#6 used as offset, casting to integer (6) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.950435 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#7 used as offset, casting to integer (7) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.953007 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#8 used as offset, casting to integer (8) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.955488 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#11 used as offset, casting to integer (11) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.958182 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#12 used as offset, casting to integer (12) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.958792 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.959210 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.960181 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#13 used as offset, casting to integer (13) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
====

line 123 in pgsql.php is
                        $this->last_query_text[$this->query_result] = $sql;
i wonder what resource ids #2-12 are? these show up in the PHP Notices.

then there are the last two entries the latter being a notice with resource #13, but the former being a warning
[Sun Oct 02 09:42:00.959210 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14

complaining about some defunct code i think. line 776 is
       $text = preg_replace($pattern, $replace, $text);
this is php version 7.0.8 that we are using.


whenever i go to a topic page to see actual posts, a similar pattern shows up:
1. php notices involving ids from #2-x
2. the php warning on preg_replace
3. the php notice involving id one more than x

could the problem be that my punbb 1.4 is not compatible with the newer php 7.08?

in friendship,
prad

Re: [SOLVED] vanished posts

PanBB.Ru wrote:

You can throw me a file of your forum and database.? I'll see what I can do.

thx! i appreciate the offer!

however, i don't quite understand what you mean by "a file of your forum and database".

do you want me to make a tar of the entire forum and a dump of the tfbb database???!

in friendship,
prad

Re: [SOLVED] vanished posts

@pradtf, pgsql.php file:
1.

            $this->last_query_text[$this->query_result] = $sql;

-->

            $this->last_query_text[intval($this->query_result)] = $sql;

2.

        if ($query_id && $this->last_query_text[$query_id] != '')

-->

        if ($query_id && $this->last_query_text[intval($query_id)] != '')

3.

            if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $table_name))

-->

            if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[intval($query_id)], $table_name))
Parserus, UserAgentAnalyzer.
I speak only Russian  :P

7 (edited by pradtf 2016-10-03 05:26)

Re: [SOLVED] vanished posts

@visman

thx!

i added the intval as indicated in the three places.
i greped to make sure those were the only three.

the posts still do not show up.

however, the lines in the error log are reduced - only 3 this time:

====
[Sun Oct 02 22:24:27.449578 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 22:24:27.450212 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 722, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 22:24:27.450308 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
====

and they all relate to the parser.php file whereas before there was only one such line in the errorlog before.
no problems showing up for pgsql.php though!

in friendship,
prad

Re: [SOLVED] vanished posts

As of PHP 5.5.0 E_DEPRECATED level error is emitted when passing in the "\e" modifier. As of PHP 7.0.0 E_WARNING is emited in this case and "\e" modifier has no effect.

http://php.net/manual/en/function.preg-replace.php

Reduce the PHP version or PunBB upgrade to version 1.4.4 (it is necessary to update expansions too).

Be sure to make a backup of the forum and database!

Parserus, UserAgentAnalyzer.
I speak only Russian  :P

9 (edited by pradtf 2016-10-03 17:01)

Re: [SOLVED] vanished posts

@visman

thank you very much for all your assistance! once again you folks have come through for me!!
everything seems to be working perfectly!

i recall being well taken care of back in 2007:
http://punbb.informer.com/forums/post/96393/#p96393

and even back to the days when anderson(punbb's original creator, i think) was running the show.

i will mark the thread solved!

in friendship,
prad