nextcloud / translate2

MIT License
1 stars 2 forks source link

Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages #21

Open DerFips opened 1 month ago

DerFips commented 1 month ago

How to use GitHub


Steps to reproduce

Unfortunately, I do not really recall what else I've done till this does not work anymore. However, I was uploading an amount of files and was playing with disabling some apps I don't use anymore. I've also added a Deepl API Key (removing didn't solve error!) and installed some external apps.

Expected behaviour

Files App should load and show me files and file structure.

Actual behaviour

Files App gives out an internal server error on web frontent. Image Using the Nextcloud Client on a mobile, I can still access my files and file structure. Every other page on the web frontend works fine.

Server configuration

Operating system: Linux 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 Webserver: Apache/2.4.62 (Debian) (apache2handler) Database: sqlite3 3.40.1 PHP version: 8.2.23 Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, a> Nextcloud version: 30.0.0 - 30.0.0.14 Where did you install Nextcloud from: Docker Image

List of activated apps Enabled: - activity: 3.0.0 - admin_audit: 1.20.0 - analytics: 5.0.1 - app_api: 3.2.1 - assistant: 2.1.1 - bookmarks: 15.0.2 - bruteforcesettings: 3.0.0 - calendar: 5.0.1 - cfg_share_links: 6.1.1 - circles: 30.0.0-dev - cloud_federation_api: 1.13.0 - comments: 1.20.1 - contacts: 6.1.0 - contactsinteraction: 1.11.0 - context_chat: 3.1.0 - cospend: 2.0.0 - dashboard: 7.10.0 - dav: 1.31.1 - federatedfilesharing: 1.20.0 - federation: 1.20.0 - files: 2.2.0 - files_antivirus: 5.6.0 - files_downloadlimit: 3.0.0 - files_pdfviewer: 3.0.0 - files_reminders: 1.3.0 - files_sharing: 1.22.0 - files_trashbin: 1.20.1 - files_versions: 1.23.0 - firstrunwizard: 3.0.0 - guests: 4.0.0 - integration_deepl: 1.3.0 - integration_gitlab: 3.1.2 - integration_openproject: 2.7.0 - integration_openstreetmap: 2.0.1 - integration_tmdb: 2.0.0 - jitsi: 0.18.0 - logreader: 3.0.0 - lookup_server_connector: 1.18.0 - mail: 4.0.1 - metadata: 0.21.0 - news: 24.0.0 - nextcloud_announcements: 2.0.0 - notes: 4.11.0 - notifications: 3.0.0 - oauth2: 1.18.1 - openotp_auth: 1.30.0 - otpmanager: 0.5.4 - password_policy: 2.0.0 - photos: 3.0.2 - previewgenerator: 5.6.0 - privacy: 2.0.0 - provisioning_api: 1.20.0 - recommendations: 3.0.0 - related_resources: 1.5.0 - richdocuments: 8.5.1 - richdocumentscode: 24.4.802 - serverinfo: 2.0.0 - settings: 1.13.0 - sharebymail: 1.20.0 - spreed: 20.0.1 - support: 2.0.0 - survey_client: 2.0.0 - suspicious_login: 8.0.0 - systemtags: 1.20.0 - tasks: 0.16.1 - text: 4.1.0 - text2image_stablediffusion: 2.0.0 - theming: 2.5.0 - translate: 2.2.0 - twofactor_backupcodes: 1.19.0 - twofactor_nextcloud_notification: 4.0.0 - updatenotification: 1.20.0 - user_status: 1.10.0 - viewer: 3.0.0 - weather_status: 1.10.0 - webhook_listeners: 1.1.0-dev - welcome: 1.2.0 - workflowengine: 2.12.0 Disabled: - encryption - files_external - twofactor_totp - user_ldap
Nextcloud configuration ``` { "htaccess.RewriteBase": "\/", "memcache.local": "\\OC\\Memcache\\APCu", "apps_paths": [ { "path": "\/var\/www\/html\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/www\/html\/custom_apps", "url": "\/custom_apps", "writable": true } ], "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "sqlite3", "version": "30.0.0.14", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "overwriteprotocol": "https", "installed": true, "maintenance": false, "default_phone_region": "DE", "theme": "", "loglevel": 0, "updater.release.channel": "stable", "onlyoffice": { "verify_peer_off": true }, "app_install_overwrite": [ "metadata", "sharerenamer", "news", "cfg_share_links", "jitsi", "otpmanager" ], "data-fingerprint": "c3f5880c067113f2bd0cf5b8e55ef935", "mail_smtpmode": "smtp", "mail_smtpsecure": "ssl", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "memories.exiftool": "\/var\/www\/html\/apps\/memories\/bin-ext\/exiftool-amd64-glibc", "memories.vod.path": "\/var\/www\/html\/apps\/memories\/bin-ext\/go-vod-amd64", "maintenance_window_start": 1, "preview_max_memory": 512, "enable_previews": true, "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\OpenDocument", "OC\\Preview\\Krita", "OC\\Preview\\HEIC" ] } ```

Cron Configuration: Array ( [backgroundjobs_mode] => cron [lastcron] => 1728985549 )

External storages: files_external is disabled

Encryption: no

User-backends:

Browser

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15 Ddg/18.0.1

Nextcloud.log

nextcloud.log for specific error ``` { "reqId": "stqfLmnFJwF8eaEneooY", "level": 3, "time": "2024-10-15T09:38:22+00:00", "remoteAddr": "77.189.115.245", "user": "Philipp", "app": "index", "method": "GET", "url": "/apps/files/", "message": "Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages() in file '/var/www/html/lib/private/Translation/TranslationManager.php' line 47", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15 Ddg/18.0.1", "version": "30.0.0.14", "exception": { "Exception": "Exception", "Message": "Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages() in file '/var/www/html/lib/private/Translation/TranslationManager.php' line 47", "Code": 0, "Trace": [ { "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 161, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ [ "OCA\\Files\\Controller\\ViewController" ], "index" ] }, { "file": "/var/www/html/lib/private/Route/Router.php", "line": 302, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\Files\\Controller\\ViewController", "index", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "files.view.index" ] ] }, { "file": "/var/www/html/lib/base.php", "line": 1001, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/files/" ] }, { "file": "/var/www/html/index.php", "line": 24, "function": "handleRequest", "class": "OC", "type": "::", "args": [] } ], "File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "Line": 146, "Previous": { "Exception": "Error", "Message": "Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages()", "Code": 0, "Trace": [ { "file": "/var/www/html/apps/text/lib/Service/InitialStateProvider.php", "line": 62, "function": "getLanguages", "class": "OC\\Translation\\TranslationManager", "type": "->", "args": [] }, { "file": "/var/www/html/apps/text/lib/Listeners/FilesLoadAdditionalScriptsListener.php", "line": 37, "function": "provideState", "class": "OCA\\Text\\Service\\InitialStateProvider", "type": "->", "args": [] }, { "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line": 68, "function": "handle", "class": "OCA\\Text\\Listeners\\FilesLoadAdditionalScriptsListener", "type": "->", "args": [ [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ] ] }, { "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 230, "function": "__invoke", "class": "OC\\EventDispatcher\\ServiceEventListener", "type": "->", "args": [ [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ], "OCA\\Files\\Event\\LoadAdditionalScriptsEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line": 59, "function": "callListeners", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->", "args": [ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCA\\Files\\Event\\LoadAdditionalScriptsEvent", [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ] ] }, { "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line": 67, "function": "dispatch", "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher", "type": "->", "args": [ [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ], "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ] }, { "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line": 79, "function": "dispatch", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->", "args": [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent", [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ] ] }, { "file": "/var/www/html/apps/files/lib/Controller/ViewController.php", "line": 187, "function": "dispatchTyped", "class": "OC\\EventDispatcher\\EventDispatcher", "type": "->", "args": [ [ "OCA\\Files\\Event\\LoadAdditionalScriptsEvent" ] ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 208, "function": "index", "class": "OCA\\Files\\Controller\\ViewController", "type": "->", "args": [ "", "", null, false ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 114, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ [ "OCA\\Files\\Controller\\ViewController" ], "index" ] }, { "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 161, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ [ "OCA\\Files\\Controller\\ViewController" ], "index" ] }, { "file": "/var/www/html/lib/private/Route/Router.php", "line": 302, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\Files\\Controller\\ViewController", "index", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "files.view.index" ] ] }, { "file": "/var/www/html/lib/base.php", "line": 1001, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/files/" ] }, { "file": "/var/www/html/index.php", "line": 24, "function": "handleRequest", "class": "OC", "type": "::", "args": [] } ], "File": "/var/www/html/lib/private/Translation/TranslationManager.php", "Line": 47 }, "message": "Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages() in file '/var/www/html/lib/private/Translation/TranslationManager.php' line 47", "exception": {}, "CustomMessage": "Call to undefined method OCP\\TaskProcessing\\IProvider@anonymous::getAvailableLanguages() in file '/var/www/html/lib/private/Translation/TranslationManager.php' line 47" } } ```

Please let me know if I missed anything. Thanks for your help!

ChristophWurst commented 1 month ago

Dear @DerFips,

thank you for your report. This errors seems unrelated to supsicious login. Is the Files app still broken when you disable this app?

DerFips commented 1 month ago

Thanks for the question, @ChristophWurst. I've disabled the app and also executed the command occ translate:download-models but it didn't solve the error. Same message in logile.

ChristophWurst commented 1 month ago

Thanks. This means the problem is not caused by this app.

juliusknorr commented 1 month ago

The trace looks like it is failing in server:

https://github.com/nextcloud/server/blob/dae7c159f728a90ffa53247d6e033abdae5d2bd6/lib/private/Translation/TranslationManager.php#L57

@marcelklehr Any idea?

marcelklehr commented 1 month ago

Somebody (some app) seems to have registered a TaskProcessing provider as a TranslationProvider

juliusknorr commented 1 month ago

I cannot see any in our org that does that, maybe an app_api app in some way?

marcelklehr commented 1 month ago

Yeah, it's very strange.

marcelklehr commented 1 month ago

@andrey18106 Do you have some insight? The provider seems to be an anonymous class, so looks like it's coming from AppAPI, no?

DerFips commented 1 month ago

Thank you all, I've just disabled Translate2 (https://apps.nextcloud.com/apps/translate2) and now it works again. Looks like this ExApp is causing the problem!

andrey18106 commented 1 month ago

@andrey18106 Do you have some insight? The provider seems to be an anonymous class, so looks like it's coming from AppAPI, no?

The provider is indeed registered using anonymous class in AppAPI. There were no changes made in API on our side (the method is present in trait, and used for each provider), maybe something unexpected in DB? Check oc_ex_translation table.