news icon indicating copy to clipboard operation
news copied to clipboard

Error in reference to object..

Open noci2012 opened this issue 1 year ago • 4 comments

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

  • [x] I have read the CONTRIBUTING.md and followed the provided tips
  • [x] I accept that the issue will be closed without comment if I do not check here
  • [x] I accept that the issue will be closed without comment if I do not fill out all items in the issue template.

Explain the Problem

Call to a member function replaceChild() on null Error while running background job OCA\News\Cron\UpdaterJob (id: 611, arguments: null)

Steps to Reproduce

Explain what you did to encounter the issue

  1. Install
  2. Check Log after cron has been running
  3. Profit!

System Information

  • News app version: 25.0.0.alpha6
  • Nextcloud version: 29.0.1RC1
  • Cron type: (system cron/python updater/...) Cron
  • PHP version: 8.3
  • Database and version: MariaDB
  • Browser and version: Firefox/Chromium, latest
  • OS and version: Linux Gentoo latest
Contents of nextcloud/data/nextcloud.log Error
{"reqId":"dw0u5P4ppJcVWuB276vs","level":3,"time":"2024-05-19T15:55:22+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job OCA\\News\\Cron\\UpdaterJob (id: 611, arguments: null)","userAgent":"--","version":"29.0.1.0","exception":{"Exception":"Error","Message":"Call to a member function replaceChild() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/news/lib/Scraper/Scraper.php","line":78,"function":"parse","class":"fivefilters\\Readability\\Readability","type":"->"},{"file":"/var/www/nextcloud/apps/news/lib/Fetcher/FeedFetcher.php","line":167,"function":"scrape","class":"OCA\\News\\Scraper\\Scraper","type":"->"},{"file":"/var/www/nextcloud/apps/news/lib/Service/FeedServiceV2.php","line":279,"function":"fetch","class":"OCA\\News\\Fetcher\\FeedFetcher","type":"->"},{"file":"/var/www/nextcloud/apps/news/lib/Service/FeedServiceV2.php","line":364,"function":"fetch","class":"OCA\\News\\Service\\FeedServiceV2","type":"->"},{"file":"/var/www/nextcloud/apps/news/lib/Service/UpdaterService.php","line":63,"function":"fetchAll","class":"OCA\\News\\Service\\FeedServiceV2","type":"->"},{"file":"/var/www/nextcloud/apps/news/lib/Cron/UpdaterJob.php","line":74,"function":"update","class":"OCA\\News\\Service\\UpdaterService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\\News\\Cron\\UpdaterJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":176,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/apps/news/vendor/fivefilters/readability.php/src/Readability.php","Line":227,"message":"Error while running background job OCA\\News\\Cron\\UpdaterJob (id: 611, arguments: null)","exception":[],"CustomMessage":"Error while running background job OCA\\News\\Cron\\UpdaterJob (id: 611, arguments: null)"},"id":"664a20f3df2cc"}
Contents of Browser Error Console Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put here
Not relevant in cron job.

noci2012 avatar May 19 '24 16:05 noci2012

Hi my first assumption would be that your php version is to modern for the scraping library that is behind the full text feature.

There is an upgrade available but to use it we had to drop support for PHP 8.0 I think.

Grotax avatar May 20 '24 08:05 Grotax

Nextcloud 28/29 = PHP 8.3 too modern? ....
php 8.2 will be EOL startinf December 2024..., ie. 7 months of support left.

noci2012 avatar May 20 '24 21:05 noci2012

Seems like you didn't understand me, which is fine. You can open a PR if you have a suggestion.

My tip would be to use a different distro for something like nextcloud + community apps. Rolling distros will be to fast with upgrades and not everything in PHP is backwards compatible.

Grotax avatar May 20 '24 21:05 Grotax

First of all i am a sysadmin... (OpenVMS + Linux on the side), not a PHP programmer, i can read code and do simple patches so I guess a PR is a big ask.

grepping....repalceChild shows this file show hits. news/vendor/fivefilters/readability.php/src/Readability.php Here the objects are ....

The lib/Scanner/Scanner.php in the error is

    public function getRTL(bool $default = false): bool
    {
        if ($this->readability === null) {                        #<-- Line 78
            return $default;
        }

Version 8.4 is mentioned in recent changes (last month). (The supplied Readability library is from 2021 AFAICT).

noci2012 avatar May 20 '24 21:05 noci2012