Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken on Nextcloud 27 (Hub 5) #830

Closed
Mprogramavimai opened this issue Jun 13, 2023 · 31 comments · Fixed by #831
Closed

Broken on Nextcloud 27 (Hub 5) #830

Mprogramavimai opened this issue Jun 13, 2023 · 31 comments · Fixed by #831
Labels
bug Something isn't working enhancement New feature or request

Comments

@Mprogramavimai
Copy link

After an update to Nextcloud (version 26 => 27) the app broke. When testing in a clean installation the same issue also happens.

An unhandled exception has been thrown:
OCP\AutoloadNotAllowedException: Autoload path not allowed: /www/nextcloud.***.**/apps/onlyoffice/appinfo/application.php in /www/nextcloud.***.**/lib/autoloader.php:141
@dweimer
Copy link

dweimer commented Jun 13, 2023

I ran into same issue, unfortunately I don't have anything to contribute in a way of fixing it. Besides of course disabling the app.

@ckforum
Copy link

ckforum commented Jun 13, 2023

same issue here

@hackerspace-team
Copy link

I confirm the problem when updating

@happyxhw
Copy link

happyxhw commented Jun 14, 2023

one line log from nextcloud.log

    "reqId": "ERL2zZTCA96iNQZDY0AP",
    "level": 4,
    "time": "2023-06-14T03:31:03+00:00",
    "remoteAddr": "x.x.x.x",
    "user": "xxxxx",
    "app": "onlyoffice",
    "method": "GET",
    "url": "/ocs/v2.php/apps/notifications/api/v2/notifications?format=json",
    "message": "Error during app loading: Autoload path not allowed: /var/www/html/custom_apps/onlyoffice/appinfo/application.php",
    "userAgent": "Mozilla/5.0 (Linux) mirall/3.8.2git (Nextcloud, endeavouros-6.3.5-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
    "version": "27.0.0.8",
    "exception": {
        "Exception": "OCP\\AutoloadNotAllowedException",
        "Message": "Autoload path not allowed: /var/www/html/custom_apps/onlyoffice/appinfo/application.php",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/autoloader.php",
                "line": 166,
                "function": "isValidPath",
                "class": "OC\\Autoloader",
                "type": "->",
                "args": [
                    "/var/www/html/custom_apps/onlyoffice/appinfo/application.php"
                ]
            },
            {
                "function": "load",
                "class": "OC\\Autoloader",
                "type": "->",
                "args": [
                    "OCA\\Onlyoffice\\AppInfo\\Application"
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php",
                "line": 217,
                "function": "class_exists",
                "args": [
                    "OCA\\Onlyoffice\\AppInfo\\Application"
                ]
            },
            {
                "file": "/var/www/html/lib/private/App/AppManager.php",
                "line": 400,
                "function": "isBootable",
                "class": "OC\\AppFramework\\Bootstrap\\Coordinator",
                "type": "->",
                "args": [
                    "onlyoffice"
                ]
            },
            {
                "file": "/var/www/html/lib/private/App/AppManager.php",
                "line": 216,
                "function": "loadApp",
                "class": "OC\\App\\AppManager",
                "type": "->",
                "args": [
                    "onlyoffice"
                ]
            },
            {
                "file": "/var/www/html/lib/private/legacy/OC_App.php",
                "line": 126,
                "function": "loadApps",
                "class": "OC\\App\\AppManager",
                "type": "->",
                "args": [
                    []
                ]
            },
            {
                "file": "/var/www/html/ocs/v1.php",
                "line": 58,
                "function": "loadApps",
                "class": "OC_App",
                "type": "::",
                "args": []
            },
            {
                "file": "/var/www/html/ocs/v2.php",
                "line": 23,
                "args": [
                    "/var/www/html/ocs/v1.php"
                ],
                "function": "require_once"
            }
        ],
        "File": "/var/www/html/lib/autoloader.php",
        "Line": 141,
        "message": "Error during app loading: Autoload path not allowed: /var/www/html/custom_apps/onlyoffice/appinfo/application.php",
        "exception": {},
        "CustomMessage": "Error during app loading: Autoload path not allowed: /var/www/html/custom_apps/onlyoffice/appinfo/application.php"
    }
}

@blumentopferde
Copy link

I've got this problem too after upgrading from Nextcloud 26.0.2 to 27.0.0.

@v-bulynkin
Copy link

I have the same problem after moving to v. 27.
Lots of fatal errors appear in log when you enable Onlyoffice app.

Fatal | onlyoffice | OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/html/apps/onlyoffice/appinfo/application.php

[onlyoffice] Fatal: OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/html/apps/onlyoffice/appinfo/application.php at <<closure>>

0. /var/www/html/lib/autoloader.php line 166
   OC\Autoloader->isValidPath()
1. <<closure>>
   OC\Autoloader->load()
2. /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php line 217
   class_exists()
3. /var/www/html/lib/private/App/AppManager.php line 400
   OC\AppFramework\Bootstrap\Coordinator->isBootable()
4. /var/www/html/lib/private/App/AppManager.php line 216
   OC\App\AppManager->loadApp()
5. /var/www/html/lib/private/legacy/OC_App.php line 126
   OC\App\AppManager->loadApps()
6. /var/www/html/lib/base.php line 1044
   OC_App::loadApps()
7. /var/www/html/index.php line 36
   OC::handleRequest()

Fatal | no app in context | OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/html/apps/onlyoffice/lib/appconfig.php

[no app in context] Fatal: OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/html/apps/onlyoffice/lib/appconfig.php at <<closure>>

 0. /var/www/html/lib/autoloader.php line 166
    OC\Autoloader->isValidPath()
 1. /var/www/html/apps/documentserver_community/lib/AppInfo/Application.php line 76
    OC\Autoloader->load()
 2. /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php line 171
    OCA\DocumentServer\AppInfo\Application->OCA\DocumentServer\AppInfo\{closure}("*** sensitive parameters replaced ***")
 3. /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php line 122
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php line 138
    Pimple\Container->offsetGet()
 5. /var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php line 488
    OC\AppFramework\Utility\SimpleContainer->query()
 6. /var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php line 466
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
 7. /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php line 65
    OC\AppFramework\DependencyInjection\DIContainer->query()
 8. /var/www/html/apps/documentserver_community/lib/AppInfo/Application.php line 99
    OC\AppFramework\Utility\SimpleContainer->get()
 9. /var/www/html/apps/documentserver_community/lib/AppInfo/Application.php line 88
    OCA\DocumentServer\AppInfo\Application->getAutoConfig()
10. /var/www/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php line 45
    OCA\DocumentServer\AppInfo\Application->OCA\DocumentServer\AppInfo\{closure}("*** sensitive parameters replaced ***")
11. /var/www/html/lib/private/AppFramework/Bootstrap/BootContext.php line 50
    OC\AppFramework\Bootstrap\FunctionInjector->injectFn()
12. /var/www/html/apps/documentserver_community/lib/AppInfo/Application.php line 86
    OC\AppFramework\Bootstrap\BootContext->injectFn()
13. /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php line 200
    OCA\DocumentServer\AppInfo\Application->boot()
14. /var/www/html/lib/private/App/AppManager.php line 437
    OC\AppFramework\Bootstrap\Coordinator->bootApp()
15. /var/www/html/lib/private/App/AppManager.php line 216
    OC\App\AppManager->loadApp()
16. /var/www/html/lib/private/legacy/OC_App.php line 126
    OC\App\AppManager->loadApps()
17. /var/www/html/lib/base.php line 1044
    OC_App::loadApps()
18. /var/www/html/index.php line 36
    OC::handleRequest()

@LinneyS LinneyS added bug Something isn't working enhancement New feature or request labels Jun 14, 2023
@MilesTEG1
Copy link

Hope this will be fixed and a NC27 version will be released soon 😄

@smaxl
Copy link

smaxl commented Jun 14, 2023

Same issue - please fix it
Autoload path not allowed: /var/www/html/nextcloud/apps/onlyoffice

@masterwishx
Copy link

Same issue

image

@hackerspace-team
Copy link

hackerspace-team commented Jun 14, 2023

https://github.com/ONLYOFFICE/onlyoffice-nextcloud/actions/runs/5264098907
Thank for fix

@pbek
Copy link

pbek commented Jun 14, 2023

For qownnotesapi I just had to remove the appinfo/app.php and appinfo/application.php and move my controller (see: pbek/qownnotesapi@6465253). But afterward I ran into nextcloud/server#38797!

@Mprogramavimai
Copy link
Author

Mprogramavimai commented Jun 14, 2023

For me, the fix mentioned in the @hackerspace-team comment doesn't work. It throws an error:

OC\AppFramework\Utility\QueryNotFoundException: Could not resolve OCA\Onlyoffice\AppInfo\Application! Class "OCA\Onlyoffice\AppInfo\Application" does not exist

Could you (@hackerspace-team ) explain the steps that you took installing the plugin? Maybe I'm missing something?

Note: the error only appears when opening the onlyoffice section in the settings.

@hackerspace-team
Copy link

delete /apps/onlyoffice
download archive
unzip archive
activate plugin
done
work for me

@Mprogramavimai
Copy link
Author

Sorry for bothering, restarting apache and php-fpm fixed this for me, but because the changes are not yet upstreamed to the Nextcloud Appstore, I'll leave this issue for the developers to close.

@pbek
Copy link

pbek commented Jun 14, 2023

Yes, clearing the opcache seems very important in this case after classes got moved around.

@v-bulynkin
Copy link

v-bulynkin commented Jun 14, 2023

https://github.com/ONLYOFFICE/onlyoffice-nextcloud/actions/runs/5264098907
delete /apps/onlyoffice download archive unzip archive activate plugin done work for me

Works for me too without restarting/clearing anything.

@LinneyS LinneyS linked a pull request Jun 14, 2023 that will close this issue
@LinneyS LinneyS closed this as completed Jun 14, 2023
@piiskop
Copy link

piiskop commented Jun 14, 2023

I confirm that the issue persists.

Nextcloud asks me to do this:

The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
Missing index "mounts_user_root_path_index" in table "oc_mounts".

When I do this, I get the error message:

kalmer@test:/projektid/nextcloud$ sudo -u www-data php --define apc.enable_cli=1 occ db:add-missing-indices

An unhandled exception has been thrown:
OCP\AutoloadNotAllowedException: Autoload path not allowed: /projektid/nextcloud/apps/onlyoffice/appinfo/application.php in /projektid/nextcloud/lib/autoloader.php:141
Stack trace:
#0 /projektid/nextcloud/lib/autoloader.php(166): OC\Autoloader->isValidPath()
#1 [internal function]: OC\Autoloader->load()
#2 /projektid/nextcloud/lib/private/ServerContainer.php(106): class_exists()
#3 /projektid/nextcloud/lib/private/ServerContainer.php(186): OC\ServerContainer->getAppContainer()
#4 /projektid/nextcloud/lib/private/ServerContainer.php(153): OC\ServerContainer->getAppContainerForService()
#5 /projektid/nextcloud/lib/private/Console/Application.php(217): OC\ServerContainer->query()
#6 /projektid/nextcloud/lib/private/Console/Application.php(131): OC\Console\Application->loadCommandsFromInfoXml()
#7 /projektid/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#8 /projektid/nextcloud/occ(11): require_once('...')
#9 {main}kalmer@test:/projektid/nextcloud$

@pbek
Copy link

pbek commented Jun 14, 2023

After updating to the OnlyOffice App 8.0.0 I got the error message OC\AppFramework\Utility\QueryNotFoundException: Could not resolve OCA\Onlyoffice\AppInfo\Application! Class "OCA\Onlyoffice\AppInfo\Application" does not exist.

After removing the Nextcloud Docker container and starting it up again, the message was gone and OnlyOffice worked fine!

@ChristophWurst
Copy link

The autoloader must be cached and doesn't adapt to the new class paths. Therefore restarting helps.

@ckforum
Copy link

ckforum commented Jun 14, 2023

fix ok 4 me 8.0 but need to restart PHP 8.2 fpm service and nginx then activate the apps and it's ok
thanks for the quick fix (Debian 11 + php fpm 8.2 + nginx)

@piiskop
Copy link

piiskop commented Jun 14, 2023

This is not a fix for me as I am not using docker and Nextcloud is running on apache2.

@happyxhw
Copy link

fixed for me, nextcloud-fpm docker, thanks !

@ChristophWurst
Copy link

@piiskop restart apache2 then

@blumentopferde
Copy link

Fixed for me. A restart of apache2 was indeed necessary.

@piiskop
Copy link

piiskop commented Jun 16, 2023

Of course, I restarted apache2. Many times. No help. The issue remains.

@piiskop
Copy link

piiskop commented Jun 16, 2023

Please reopen the issue as it is not fixed. A while ago, I stopped creating new files with ONLYOFFICE after a data loss. Since then, I use LibreOffice and do things offline. I still have some files online that I used to use ONLYOFFICE for editing but now I see that it is not worth using ONLYOFFICE anymore at all. It is not acceptable that an upgrade in Nextcloud to a major version breaks down an app.

@pbek
Copy link

pbek commented Jun 16, 2023

This is a php autoloader "issue", not an app issue. Every app that had to move files around, because Nextcloud moved on had the same issue.

But I'm not sure how much you are paying for onlyoffice, to even have some "right" to complain. 😅

@linucksrox
Copy link

This should go without saying, but as an admin it's not advised to blindly upgrade to a new major version without testing, at least without anticipating that there may be kinks that still need to be ironed out. If that's too much to ask, I recommend following standard, admin 101 best practices and waiting to upgrade.

@piiskop
Copy link

piiskop commented Jun 17, 2023

I am not paying anything to ONLYOFFICE but attention. I use the community version and I always get a reaction from the Siberian developers. One of them usually gets angry if the complaint is not directly ONLYOFFICE-regarded but about Nextcloud or the connector as some other people are responsible for the connector and that connector is very poor.

@linucksrox, are you suggesting that rather should the admin be responsible for bugs in a major version than the developer? As I see it, Nextcloud developers have lots of development issues. I am wondering whether they test something at all not mentioning performing throughout integration testing as there are so many primitive issues like transparent icons on a white background and then there is a new major version and the issue still persists or there are new issues. Tons of unnecessary things are made for new releases and these important primitive things are still left unresolved. This is a very weird versioning policy.

@bluestar800
Copy link

systemctl restart php8.2-fpm this code can fix my issue
nginx + php8.2-fpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.