News: Error: Class 'FeedIo\Reader\Fixer\LastModified' not found

Created on 2 Feb 2021  路  11Comments  路  Source: nextcloud/news

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 don not fill out all items in the issue template.

Explain the Problem

Error: Class 'FeedIo\Reader\Fixer\LastModified' not found

Steps to Reproduce

Explain what you did to encounter the issue

  1. Downloaded the news.tar.gz from the Github/Releases
  2. Moved the existing news folder to another place
  3. Extracted news.tar.gz and fixed the owner
  4. php occ upgrade

System Information

  • News app version: 15.2.0
  • Nextcloud version: 20.0.6
  • Cron type: Cronjob
  • PHP version: 7.4-FPM
  • Database and version: PostgreSQL 14
  • Browser and version: Firefox 85
  • Distribution and version: Ubuntu 20.04

Contents of nextcloud/data/nextcloud.log

{
"reqId": "YBmj8fQDLZB5cWzO1e1bYwAARRM",
"level": 3,
"time": "2021-02-02T20:11:45+01:00",
"remoteAddr": "192.168.10.2",
"user": "3A60C52D-9415-4F28-A2B7-71A8CBD7A9E3",
"app": "index",
"method": "GET",
"url": "/apps/news/feeds",
"message": {
    "Exception": "Error",
    "Message": "Class 'FeedIo\\Reader\\Fixer\\LastModified' not found",
    "Code": 0,
    "Trace": [
        {
            "file": "/var/www/cloud/apps/news/vendor/debril/feed-io/src/FeedIo/FeedIo.php",
            "line": 208,
            "function": "getBaseFixers",
            "class": "FeedIo\\FeedIo",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/apps/news/vendor/debril/feed-io/src/FeedIo/FeedIo.php",
            "line": 120,
            "function": "loadFixerSet",
            "class": "FeedIo\\FeedIo",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/apps/news/lib/AppInfo/Application.php",
            "line": 137,
            "function": "__construct",
            "class": "FeedIo\\FeedIo",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 155,
            "function": "OCA\\News\\AppInfo\\{closure}",
            "class": "OCA\\News\\AppInfo\\Application",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/3rdparty/pimple/pimple/src/Pimple/Container.php",
            "line": 118,
            "function": "OC\\AppFramework\\Utility\\{closure}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 122,
            "function": "offsetGet",
            "class": "Pimple\\Container",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 449,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 427,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 87,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "function": "OC\\AppFramework\\Utility\\{closure}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 101,
            "function": "array_map"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 109,
            "function": "buildClass",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 126,
            "function": "resolve",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 455,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 427,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 87,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "function": "OC\\AppFramework\\Utility\\{closure}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 101,
            "function": "array_map"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 109,
            "function": "buildClass",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 126,
            "function": "resolve",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 455,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 427,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 87,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "function": "OC\\AppFramework\\Utility\\{closure}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 101,
            "function": "array_map"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 109,
            "function": "buildClass",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 126,
            "function": "resolve",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 455,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 427,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 87,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "function": "OC\\AppFramework\\Utility\\{closure}",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": [
                "*** sensitive parameters replaced ***"
            ]
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 101,
            "function": "array_map"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 109,
            "function": "buildClass",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/Utility/SimpleContainer.php",
            "line": 126,
            "function": "resolve",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 455,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
            "line": 427,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/AppFramework/App.php",
            "line": 139,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/lib/private/Route/Router.php",
            "line": 309,
            "function": "main",
            "class": "OC\\AppFramework\\App",
            "type": "::"
        },
        {
            "file": "/var/www/cloud/lib/base.php",
            "line": 1008,
            "function": "match",
            "class": "OC\\Route\\Router",
            "type": "->"
        },
        {
            "file": "/var/www/cloud/index.php",
            "line": 37,
            "function": "handleRequest",
            "class": "OC",
            "type": "::"
        }
    ],
    "File": "/var/www/cloud/apps/news/vendor/debril/feed-io/src/FeedIo/FeedIo.php",
    "Line": 235,
    "CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
"version": "20.0.6.1",
"id": "6019a4b3a53a8"
}

bug

All 11 comments

Just for info: I (temporarily) reverted back to News 15.1.1

I updated to News version 15.2.2 via app store but error still occurs.

I can't reproduce this. How did you update?

@SMillerDev
Yesterday I tried to update via app store and run into the same issues as mentiond in #1107
Then tried to update it manually via downloading it from Github (v 15.2.0).
Error occured 1st time.

Reverted back.

Today I downloaded 15.2.2 from app store without any issues.
After the update I received the same error message.

@SMillerDev @derritter88

I know what's going on, it's a deployment issue. In v4.8.0, FeedIo.php at line 235 is as following: https://github.com/alexdebril/feed-io/blob/master/src/FeedIo/FeedIo.php#L235

Here's the full method

    public function getBaseFixers() : array
    {
        return array(
            new Reader\Fixer\HttpLastModified(),
            new Reader\Fixer\PublicId(),
        );
    }

in the previous version it was like this https://github.com/alexdebril/feed-io/blob/v4.7.16/src/FeedIo/FeedIo.php#L235:

    public function getBaseFixers() : array
    {
        return array(
            new Reader\Fixer\LastModified(),
            new Reader\Fixer\LastModifiedSince(),
            new Reader\Fixer\HttpLastModified(),
            new Reader\Fixer\PublicId(),
        );
    }

And in v4.8.0, the LastModified fixer was removed because no longer required (and clearly not called by feed-io's users).

So the explanation must be that during the composer install or whatsoever, some of the files were updated / removed but src/FeedIo/FeedIo.php stayed in its previous state. Why ? Probably because of a permission issue, I suspect that the initial installation was done with a high-privileged user (for instance, root) and the updates were made with another one (www-data ? user with UID 1000 ?), so some of the files can't be updated. It's a highroad to random bugs, I highly recommend to wipe the vendor/ folder and re-install it cleanly (I'm not aware of the exact deployment process, but at the end vendor/ must contain the dependencies as they are described in composer.lock)

I've thought the same, but the https://github.com/nextcloud/news/releases/download/15.2.2/news.tar.gz only contains the following and this is what allegedly was installed ..?

        return array(
            new Reader\Fixer\HttpLastModified(),
            new Reader\Fixer\PublicId(),
        );

How could this happen if the app folder was replaced entirely as reported?

Maybe just as a sidenote my detailed steps for the manual process:
I disabled the News app via php occ
Replaced the folder and "chowned" to www-data
Enabled the app again

For the automatic process all steps were done by the www-data user.

Smells like cache then. what happens after you restart Apache ?

Haven't tried that yet - give me a second and I'll restart Apache & PHP7.4-FPM

Smells like cache then. what happens after you restart Apache ?

That solved the issue!!!
Many thanks.

Should that be documented somewhere?

Should that be documented somewhere?

That's really "how do I maintain a PHP server", I don't think that's up to news (or nextcloud) to document

Was this page helpful?
0 / 5 - 0 ratings