FlatPress 1.4-dev Github 1905 - Rebuild index failure

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
laborix
Posts: 151
Joined: Sat Feb 16, 2019 3:51 pm

FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by laborix » Fri Feb 28, 2025 4:44 pm

If you want to transfer about 500 posts from an old FlatPress installation to FlatPress 1.4-dev Github 1905, the following error occurs at the first attempt:

Code: Select all

BACKUP INDEX to fp-content/index1740766205
Cannot backup old index. STOP. 
Did you just purge the cache? If so, the index was in use to create a new cache. This is done now, please simply reload the current page
After clicking on Empty the theme and template cache in the administration and then Rebuild index again, it takes up to three attempts before it works.
Alternatively, manually deleting the cache/compile on the webspace.

This error appeared several times when testing the FlatPress Github versions :roll:

Tested in an online live version with FlatPress 1.4-dev Github 1905
Environment Apache and PHP 8.4.4

best regards

laborix
Posts: 151
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by laborix » Fri Feb 28, 2025 6:18 pm

Ok, new results,

add an other Flatpress Blog (more than 100 entries) into the current test environment, same failure with the Rebuild index. But if you do

Code: Select all

... please simply reload the current page ...
the Index is rebuild successfully ;) So I think, the full situation with Rebuild Index should be tested ...

best regards

Small remark: FlatPress 1.4-dev Github 1905 can easily cope with almost 700 posts in a PrettyUrls setup and that relatively quickly.

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by fraenkiman » Wed Mar 05, 2025 8:02 pm

Hello Laborix,

there seems to be an access problem here:

Code: Select all

Warning: rename(fp-content/index,fp-content/index1741122088) [<a href='/phpmanual/function.rename.html'>function.rename.html</a>]: Access denied (code: 5) in \flatpress-master-1905\admin\panels\maintain\admin.maintain.php on line 147
Apparently $oldidx files are still in use and therefore cannot be renamed. I have changed the logic a bit. First the files are copied and only if successful the old ones are deleted.

Can you please copy the following file into the directory /admin/panels/maintain and test it again? Unfortunately I don't have 100++ entries at hand.
admin.maintain.01.zip
(2.61 KiB) Downloaded 1157 times
With best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

laborix
Posts: 151
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by laborix » Fri Mar 07, 2025 1:25 pm

fraenkiman wrote: Wed Mar 05, 2025 8:02 pm... Can you please copy the following file into the directory /admin/panels/maintain and test it again? ...
Hi fraenkiman,
Ok, it doesn't seem to be that easy.

Installed FlatPress Github 1908, clicked through a bit, rebuild index with one page works. Then copied 100 content pages to /fp-conent and rebuild index, all ok. Played a bit, content pages open in tab, rebuild works and rebuild does not work (see error)

Code: Select all

ENTERING LOWRES MODE

BACKUP INDEX to fp-content/index1741352260
Cannot backup old index. STOP. 
Did you just purge the cache? If so, the index was in use to create a new cache. This is done now, please simply reload the current page.
Then tested with Purge theme and templates cache, rebuild works and rebuild does not work (see error).

Adding the new admin.maintain.php, Purge theme and templates cache, rebuild works and rebuild does not work. Now I tested with open pages and after the 3rd or 4th rebuild this error occurs:

Code: Select all

BACKUP INDEX to fp-content/index1741352814
<br />
<b>Warning</b>:  rmdir(fp-content/index): Directory not empty in <b>../fpgit1908/admin/panels/maintain/admin.maintain.php</b> on line <b>298</b><br />
<br />
<b>Warning</b>:  fopen(fp-content/index/index-0.dat): Failed to open stream: Permission denied in <b>../fpgit1908/fp-includes/core/core.entry.php</b> on line <b>68</b><br />
<br />
<b>Warning</b>:  fopen(fp-content/index/index.strings.dat): Failed to open stream: Permission denied in <b>../fpgit1908/fp-includes/core/core.entry.php</b> on line <b>68</b><br />
<br />
<b>Fatal error</b>:  Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given in ../fpgit1908/fp-includes/core/core.bplustree.class.php:2613
Stack trace:
#0 ../fpgit1908/fp-includes/core/core.bplustree.class.php(2613): fwrite(false, 'BPTSTRINGS')
#1 ../fpgit1908/fp-includes/core/core.entry.php(73): SBPlusTree-&gt;startup()
#2 ../fpgit1908/fp-includes/core/core.entry.php(329): entry_index-&gt;__construct()
#3 ../fpgit1908/admin/panels/maintain/admin.maintain.php(43): entry_init()
#4 ../fpgit1908/admin/panels/maintain/admin.maintain.php(155): s_entry_crawler-&gt;__construct()
#5 ../fpgit1908/admin/includes/panels.prototypes.php(193): admin_maintain_default-&gt;dodo('rebuild')
#6 ../fpgit1908/admin/includes/panels.prototypes.php(129): AdminPanelAction-&gt;docommand('do', 'rebuild')
#7 ../fpgit1908/admin/main.php(91): AdminPanelAction-&gt;exec()
#8 ../fpgit1908/admin/main.php(210): main()
#9 ../fpgit1908/admin.php(5): require('../htdo...')
#10 {main}
  thrown in <b>../fpgit1908/fp-includes/core/core.bplustree.class.php</b> on line <b>2613</b><br />
So, now the big question?
Permission denied or Argument #1 ($stream) must be of type resource, false given.

I will test again with more content pages, but unfortunately I have no idea what exactly is happening here :roll:

best regards

laborix
Posts: 151
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by laborix » Fri Mar 07, 2025 2:23 pm

laborix wrote: Fri Mar 07, 2025 1:25 pm... I will test again with more content pages, ...
New test environment, Nginx 1.27 Server and PHP 8.1.31

OK, tested on Nginx 1.27 and PHP 8.1.31. Same errors by Rebuild index (see my posting from Fr Mär 07, 2025 2:25 pm).
Rebuild works and Rebuild not works and I don't know why :roll:

I thought it was due to the server and PHP version, but it doesn't seem to be the case

best regards

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress 1.4-dev Github 1905 - Rebuild index failure

Post by fraenkiman » Fri Mar 07, 2025 11:24 pm

Hello Laborix,
laborix wrote: Fri Mar 07, 2025 1:25 pm Now I tested with open pages and after the 3rd or 4th rebuild this error occurs:
that won't work either, neither with the original function nor with the customized one. You keep the “old” index in use with the open pages. This can then neither be renamed nor deleted. Theoretically, in order to rebuild the index, you would have to put FlatPress into a maintenance mode, which does not exist.

I would therefore leave the original “Rebuild index” function as it is, with the proviso that the LOWRES page may have to be reloaded.

Best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests