Import module seems broken

Found a bug? Tell us!!
Post Reply
SingingKyle
Posts: 1
Joined: Thu Nov 24, 2022 4:49 am

Import module seems broken

Post by SingingKyle »

I just installed Serendipity 2.4 latest release on a server running Ubuntu 22.04 with php 8.0. My server configuration is php-fpm via apache2 behind an nginx proxy. I chose an SQLite database, which was successfully created during the installation. I played around just a little adding plugins, making posts and comments and editing things, and all worked really well. This is currently a test installation, but I wanted to see how possible it would be to import from my current blog via the RSS importer, to see how feasible it may be to migrate permanently to Serendipity. I actually have my blog that I migrated off WordPress when it broke, and I was able after lots of cussin' and fussin' as some say here in the States, to get the WordPress database imported into a new temporary WordPress installation, which I promptly exported as an XML file, so I could in fact import from WordPress in any number of ways as well. The problem is that I am unable to get any Serendipity importer to work. I first tried running the generic RSS importer, but was met with a blank page. I then tried the WordPress importer and received the same blank screen. Thinking that maybe it had something to do with one of the plugins I had installed during my initial tests, I wiped the whole installation and performed a clean install, eventually finding that I needed to restart php8.0-fpm in order to clean things up completely. After restarting php8.0-fpm, reinstalling Serendipity and then restarting php8.0-fpm again just for luck, I immediately logged in as the admin user I created during installation, immediately went to the maintenance page and tried to select an importer. Again I started with generic RSS, then tried WordPress, and both times I was greeted with the same blank screen. I then just for grins tried every importer listed, and the blank screen greeted me every time. The problem seems to occur before any options for the import are to be presented. My error logs are now jam packed with error messages similar to:

Code: Select all

[Thu Nov 24 03:09:37.725275 2022] [proxy_fcgi:error] [pid 1849832:tid 140040780846656] [client xx.xx.xx.xx:0] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, null given in /path/to/site/public_html/include/admin/importers/generic.inc.php:50\nStack trace:\n#0 /path/to/site/public_html/include/admin/import.inc.php(214): Serendipity_Import_Generic->validateData()\n#1 /path/to/site/public_html/serendipity_admin.php(169): include('...')\n#2 {main}\n  thrown in /path/to/site/public_html/include/admin/importers/generic.inc.php on line 50', referer: https://mysite.test/serendipity_admin.php?serendipity[adminModule]=maintenance
These are not real paths of course, I just removed username and domain info from the message, along with my client IP. Every time I chose any importer, a similar error message appeared in my logs, so I only chose the last one as an example. Thank you very much for anything that would help resolve this.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Import module seems broken

Post by onli »

It seems you run into a PHP 8.0 incompatibility we hadn't noticed before. I would recommend to run the import with PHP 7.4, but 1) I'm not sure the importer works currently, it seems it wasn't visited in a while by a dev 2) Ubuntu 22.04 does not come with that version, right?

But that's a bug that does need fixing, and we need to make sure it stays working by adding test cases. At least the RSS and wordpress import really needs to work.

If you have some development experience it would be great if you could help out.

To whoever works on this: The error message is relatively clear, sizeof() gets a null in include/admin/importers/generic.inc.php on line 50, something that can be checked and the error avoided. Could be as simple as making it a sizeof($var ?? []), without having checked the code yet. Question might be why it gets a null, but maybe that and the response 0 was expected.
Hanjo Iwanowitsch
Regular
Posts: 44
Joined: Sun Feb 26, 2006 3:37 pm
Location: Eutin, Germany
Contact:

Re: Import module seems broken

Post by Hanjo Iwanowitsch »

Ladies & gentlemen,

the problem still persists (S9y 2.40, PHP 8.0.30). Is there hope that it will be solved?

Kind regards,
Hanjo.
Post Reply