nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.32k stars 4.06k forks source link

[Bug]: RuntimeException image not found: image:png With Circles Activated #44744

Closed JRGonz closed 2 months ago

JRGonz commented 6 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

After updating I am receiving this message and the activities app does not function and just gives nonstop error bubbles on the right.

Steps to reproduce

  1. Activate cirles.
  2. Go to activities as user.
  3. See errors in web ui and log.

Expected behavior

To not have errors and able to see the activity log.

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{                                                                                                                                                                                                                       
    "system": {                                                                                                                                                                                                         
        "instanceid": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                  
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                
        "secret": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                      
        "trusted_domains": [                                                                                                                                                                                            
            "host.domain.tld"                                                                                                                                                                                         
        ],                                                                                                                                                                                                              
        "datadirectory": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                               
        "default_phone_region": "US",                                                                                                                                                                                   
        "dbtype": "mysql",                                                                                                                                                                                              
        "version": "28.0.4.1",                                                                                                                                                                                          
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                             
        "overwrite.cli.url": "https:\/\/host.domain.tld",                                                                                                                                                             
        "dbname": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                      
        "dbhost": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                      
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***", 
        "installed": true,
        "maintenance_window_start": 1,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "PLAIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\Movie",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\Image"
        ],
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "maintenance": false,
        "overwriteprotocol": "https",
        "allow_local_remote_servers": "true",
        "loglevel": 3,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "theme": "",
        "memories.exiftool": "\/var\/www\/host.domain.tld\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/host.domain.tld\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.disable": false,
        "skeletondirectory": "\/var\/www\/skel",
        "default_language": "en",
        "default_locale": "en_US",
        "force_locale": "en_US"
    }
}

List of activated Apps

Enabled:                                                                                                                                                                                                       [20/1067]
  - activity: 2.20.0                                                                                                                                                                                                    
  - announcementcenter: 6.8.1                                                                                                                                                                                           
  - bruteforcesettings: 2.8.0                                                                                                                                                                                           
  - calendar: 4.6.7                                                                                                                                                                                                     
  - cloud_federation_api: 1.11.0                                                                                                                                                                                        
  - comments: 1.18.0                                                                                                                                                                                                    
  - contacts: 5.5.3                                                                                                                                                                                                     
  - dashboard: 7.8.0                                                                                                                                                                                                    
  - dav: 1.29.1                                                                                                                                                                                                         
  - deck: 1.12.2                                                                                                                                                                                                        
  - event_update_notification: 2.3.0                                                                                                                                                                                    
  - federatedfilesharing: 1.18.0                                                                                                                                                                                        
  - files: 2.0.0                                                                                                                                                                                                        
  - files_pdfviewer: 2.9.0                                                                                                                                                                                              
  - files_reminders: 1.1.0                                                                                                                                                                                              
  - files_sharing: 1.20.0                                                                                                                                                                                               
  - files_trashbin: 1.18.0                                                                                                                                                                                              
  - files_versions: 1.21.0                                                                                                                                                                                              
  - forms: 4.1.1                                                                                                                                                                                                        
  - groupfolders: 16.0.6                                                                                                                                                                                                
  - groupquota: 0.1.13
  - guests: 3.0.1
  - impersonate: 1.15.0
  - ldap_write_support: 1.10.0
  - login_notes: 1.5.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.7
  - memories: 7.2.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.4
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - polls: 7.0.3
  - previewgenerator: 5.5.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.19.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.3
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.6
  - support: 1.11.1
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - text: 3.9.1
  - theming: 2.3.0
Enabled:                                                                                                                                                                                                       [20/1067]
  - activity: 2.20.0                                                                                                                                                                                                    
  - announcementcenter: 6.8.1                                                                                                                                                                                           
  - bruteforcesettings: 2.8.0                                                                                                                                                                                           
  - calendar: 4.6.7                                                                                                                                                                                                     
  - cloud_federation_api: 1.11.0                                                                                                                                                                                        
  - comments: 1.18.0                                                                                                                                                                                                    
  - contacts: 5.5.3                                                                                                                                                                                                     
  - dashboard: 7.8.0                                                                                                                                                                                                    
  - dav: 1.29.1                                                                                                                                                                                                         
  - deck: 1.12.2                                                                                                                                                                                                        
  - event_update_notification: 2.3.0                                                                                                                                                                                    
  - federatedfilesharing: 1.18.0                                                                                                                                                                                        
  - files: 2.0.0                                                                                                                                                                                                        
  - files_pdfviewer: 2.9.0                                                                                                                                                                                              
  - files_reminders: 1.1.0                                                                                                                                                                                              
  - files_sharing: 1.20.0                                                                                                                                                                                               
  - files_trashbin: 1.18.0                                                                                                                                                                                              
  - files_versions: 1.21.0                                                                                                                                                                                              
  - forms: 4.1.1                                                                                                                                                                                                        
  - groupfolders: 16.0.6                                                                                                                                                                                                
  - groupquota: 0.1.13
  - guests: 3.0.1
  - impersonate: 1.15.0
  - ldap_write_support: 1.10.0
  - login_notes: 1.5.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.7
  - memories: 7.2.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.4
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - polls: 7.0.3
  - previewgenerator: 5.5.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.19.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.3
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.6
  - support: 1.11.1
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - text: 3.9.1
  - theming: 2.3.0
Enabled:                                                                                                                                                                                                       [20/1067]
  - activity: 2.20.0                                                                                                                                                                                                    
  - announcementcenter: 6.8.1                                                                                                                                                                                           
  - bruteforcesettings: 2.8.0                                                                                                                                                                                           
  - calendar: 4.6.7                                                                                                                                                                                                     
  - cloud_federation_api: 1.11.0                                                                                                                                                                                        
  - comments: 1.18.0                                                                                                                                                                                                    
  - contacts: 5.5.3                                                                                                                                                                                                     
  - dashboard: 7.8.0                                                                                                                                                                                                    
  - dav: 1.29.1                                                                                                                                                                                                         
  - deck: 1.12.2                                                                                                                                                                                                        
  - event_update_notification: 2.3.0                                                                                                                                                                                    
  - federatedfilesharing: 1.18.0                                                                                                                                                                                        
  - files: 2.0.0                                                                                                                                                                                                        
  - files_pdfviewer: 2.9.0                                                                                                                                                                                              
  - files_reminders: 1.1.0                                                                                                                                                                                              
  - files_sharing: 1.20.0                                                                                                                                                                                               
  - files_trashbin: 1.18.0                                                                                                                                                                                              
  - files_versions: 1.21.0                                                                                                                                                                                              
  - forms: 4.1.1                                                                                                                                                                                                        
  - groupfolders: 16.0.6                                                                                                                                                                                                
  - groupquota: 0.1.13
  - guests: 3.0.1
  - impersonate: 1.15.0
  - ldap_write_support: 1.10.0
  - login_notes: 1.5.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.7
  - memories: 7.2.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.4
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - polls: 7.0.3
  - previewgenerator: 5.5.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.19.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.3
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.6
  - support: 1.11.1
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_ldap: 1.19.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - audioplayer: 3.4.1 (installed 3.4.1)
  - circles: 28.0.0 (installed 28.0.0)
  - contactsinteraction: 1.9.0 (installed 1.6.0)
  - encryption: 2.16.0
  - federation: 1.18.0 (installed 1.18.0)
  - files_external: 1.20.0
  - firstrunwizard: 2.17.0 (installed 2.16.0)
  - photos: 2.4.0 (installed 2.4.0)
  - richdocumentscode: 23.5.1001 (installed 23.5.1001)
  - twofactor_totp: 10.0.0-beta.2

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"zDlH71Pqly27nSS4z9Sf","level":3,"time":"2024-04-09T03:50:59+00:00","remoteAddr":"192.168.1.76","user":"username","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity","message":"Exception thrown: RuntimeException","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","version":"28.0.4.1","exception":{"Exception":"RuntimeException","Message":"image not found: image:png webroot: serverroot:/var/www/host.domain.tld","Code":0,"Trace":[{"file":"/var/www/host.domain.tld/apps/circles/lib/Activity/Provider.php","line":96,"function":"imagePath","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/host.domain.tld/apps/circles/lib/Activity/Provider.php","line":67,"function":"setIcon","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/host.domain.tld/apps/activity/lib/GroupHelper.php","line":72,"function":"parse","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/host.domain.tld/apps/activity/lib/Data.php","line":248,"function":"addActivity","class":"OCA\\Activity\\GroupHelper","type":"->"},{"file":"/var/www/host.domain.tld/apps/activity/lib/Dashboard/ActivityWidget.php","line":152,"function":"get","class":"OCA\\Activity\\Data","type":"->"},{"file":"/var/www/host.domain.tld/apps/dashboard/lib/Controller/DashboardApiController.php","line":142,"function":"getItemsV2","class":"OCA\\Activity\\Dashboard\\ActivityWidget","type":"->"},{"file":"/var/www/host.domain.tld/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getWidgetItemsV2","class":"OCA\\Dashboard\\Controller\\DashboardApiController","type":"->"},{"file":"/var/www/host.domain.tld/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/host.domain.tld/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/host.domain.tld/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/host.domain.tld/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/host.domain.tld/ocs/v2.php","line":23,"args":["/var/www/host.domain.tld/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/host.domain.tld/lib/private/URLGenerator.php","Line":274,"CustomMessage":"Exception thrown: RuntimeException"}}

Additional info

I worked around this by disabling circles.

joshtrichards commented 6 months ago

Similar reports:

gibelium commented 6 months ago

Same issue here NC 28.0.4

excho0 commented 6 months ago

The code that causes the error:

/var/www/nextcloud/apps/circles/lib/Activity/Provider.php

private function setIcon(IEvent $event): void {
    $path = $this->urlGenerator->imagePath(
        Application::APP_ID,
        'circles.' . $this->activityManager->getRequirePNG() ? 'png' : 'svg'
    );
    $event->setIcon($this->urlGenerator->getAbsoluteURL($path));
}

and here is the fix:

private function setIcon(IEvent $event): void {
    $extension = $this->activityManager->getRequirePNG() ? 'png' : 'svg';
    $path = $this->urlGenerator->imagePath(
        Application::APP_ID,
        'circles.' . $extension
    );
    $event->setIcon($this->urlGenerator->getAbsoluteURL($path));
}

UPDATE:

I was looking in to the source code and It appears that they have already fixed the bug using a different version from the provided fix above. You can either use my version or simply wait for an update. I believe both versions should work. 🤗

rchaconmolero commented 6 months ago

We have same problem.

cyrzero commented 5 months ago

We have the same problem : "app": "activity", "method": "GET", "url": "/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity", "message": "Error while parsing activity event", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0", "version": "27.1.9.1", "data": { "exception": "{\"class\":\"RuntimeException\",\"message\":\"image not found: image:png webroot: serverroot:/var/www/server.com/www\",\"code\":0,\"file\":\"/var/www/server.com/www/lib/private/URLGenerator.php:274\",\"trace\":\"#0 /var/www/server.com/www/apps/circles/lib/Activity/Provider.php(96): OC\URLGenerator->imagePath()\n#1 /var/www/server.com/www/apps/circles/lib/Activity/Provider.php(67): OCA\Circles\Activity\Provider->setIcon()\n#2 /var/www/server.com/www/apps/activity/lib/GroupHelper.php(89): OCA\Circles\Activity\Provider->parse()\n#3 /var/www/server.com/www/apps/activity/lib/GroupHelper.php(76): OCA\Activity\GroupHelper->addEvent()\n#4 /var/www/server.com/www/apps/activity/lib/Data.php(260): OCA\Activity\GroupHelper->addActivity()\n#5 /var/www/server.com/www/apps/activity/lib/Dashboard/ActivityWidget.php(152): OCA\Activity\Data->get()\n#6 /var/www/server.com/www/apps/dashboard/lib/Controller/DashboardApiController.php(134): OCA\Activity\Dashboard\ActivityWidget->getItemsV2()\n#7 /var/www/server.com/www/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\Dashboard\Controller\DashboardApiController->getWidgetItemsV2()\n#8 /var/www/server.com/www/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()\n#9 /var/www/server.com/www/lib/private/AppFramework/App.php(183): OC\AppFramework\Http\Dispatcher->dispatch()\n#10 /var/www/server.com/www/lib/private/Route/Router.php(315): OC\AppFramework\App::main()\n#11 /var/www/server.com/www/ocs/v1.php(65): OC\Route\Router->match()\n#12 /var/www/server.com/www/ocs/v2.php(23): require_once('...')\n#13 {main}\"}", "app": "activity"

gonzalo commented 5 months ago

Same issue here.

I can confirm that @excho0 patch fix the issue for me

{ "reqId":"xxxxxxxx", "level":3, "time":"2024-05-23T11:41:17+00:00", "remoteAddr":"xxxxxxx", "user":"xxxxxxxxxxxxxx", "app":"no app in context", "method":"GET", "url":"/ocs/v2.php/apps/dashboard/api/v2/widget-items?widgets%5B%5D=activity", "message":"Exception thrown: RuntimeException", "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", "version":"27.1.8.1", "exception":{ "Exception":"RuntimeException", "Message":"image not found: image:png webroot: serverroot:/xxxxxxxxxxxx/www/nextcloud", "Code":0, "Trace":[ { "file":"/xxxxxxxxxxxxx/nextcloud/apps/circles/lib/Activity/Provider.php", "line":96, "function":"imagePath", "class":"OC\URLGenerator", "type":"->" }, { "file":"/xxxxxxxx/nextcloud/apps/circles/lib/Activity/Provider.php", "line":67, "function":"setIcon", "class":"OCA\Circles\Activity\Provider", "type":"->" }, { "file":"/xxxxxxxxx/nextcloud/apps/activity/lib/GroupHelper.php", "line":86, "function":"parse", "class":"OCA\Circles\Activity\Provider", "type":"->" }, { "file":"/xxxxxxx/www/nextcloud/apps/activity/lib/Data.php", "line":260, "function":"addActivity", "class":"OCA\Activity\GroupHelper", "type":"->" }, { "file":"/xxxxxxxxxx/nextcloud/apps/activity/lib/Dashboard/ActivityWidget.php", "line":152, "function":"get", "class":"OCA\Activity\Data", "type":"->" }, { "file":"/xxxxxxxxx/nextcloud/apps/dashboard/lib/Controller/DashboardApiController.php", "line":134, "function":"getItemsV2", "class":"OCA\Activity\Dashboard\ActivityWidget", "type":"->" }, { "file":"/xxxxxxxxxx/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"getWidgetItemsV2", "class":"OCA\Dashboard\Controller\DashboardApiController", "type":"->" }, { "file":"/xxxxxxxxxxxx/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\AppFramework\Http\Dispatcher", "type":"->" }, { "file":"/xxxxxxxxx/www/nextcloud/lib/private/AppFramework/App.php", "line":183, "function":"dispatch", "class":"OC\AppFramework\Http\Dispatcher", "type":"->" }, { "file":"/xxxxxxxx/www/nextcloud/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\AppFramework\App", "type":"::" }, { "file":"/xxxxxxxxx/www/nextcloud/ocs/v1.php", "line":65, "function":"match", "class":"OC\Route\Router", "type":"->" }, { "file":"/axxxxxxxxxd/www/nextcloud/ocs/v2.php", "line":23, "args":[ "/xxxxxxwww/nextcloud/ocs/v1.php" ], "function":"require_once" } ], "File":"/xxxxxx/www/nextcloud/lib/private/URLGenerator.php", "Line":274, "CustomMessage":"Exception thrown: RuntimeException" } }

gibelium commented 5 months ago

UPDATE:

I was looking in to the source code and It appears that they have already fixed the bug using a different version from the provided fix above. You can either use my version or simply wait for an update. I believe both versions should work. 🤗

A pull request would be a good idea to speed up the update process, wouldn't it?

excho0 commented 5 months ago

as i said I was looking in to the source code and It appears that they have already fixed the bug using a different version from the provided fix above. You can either use my version or simply wait for an update. I believe both versions should work. 🤗

gonzalo commented 5 months ago

After upgrading to latest nextcloud version fix is in place

joshtrichards commented 2 months ago

Fixed nextcloud/circles#1378