Error (log): image not found: image:png webroot

Hello!

Nextcloud version: 28.0.4
Operating system and version: ubuntu 22.04
Apache or nginx version: Apache/2.4.52
PHP version (eg, 7.4): 8.3.4

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Add new LDAP user
  2. Login
  3. Read entries in the log file Nextcloud

The output of your Nextcloud log in Admin > Logging:

{"reqId":"4NYalyz1HRZWzNpjGHjT","level":3,"time":"2024-04-03T16:41:28+03:00","remoteAddr":"REPLACE","user":"RELPACE","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/activity/api/v2/activity/all?format=json&previews=true&since=0","message":"Exception thrown: RuntimeException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0","version":"28.0.4.1","exception":{"Exception":"RuntimeException","Message":"image not found: image:png webroot: serverroot:/var/www/nextcloud","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/circles/lib/Activity/Provider.php","line":96,"function":"imagePath","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/apps/circles/lib/Activity/Provider.php","line":67,"function":"setIcon","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/GroupHelper.php","line":70,"function":"parse","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/Data.php","line":248,"function":"addActivity","class":"OCA\\Activity\\GroupHelper","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/Controller/APIv2Controller.php","line":205,"function":"get","class":"OCA\\Activity\\Data","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/Controller/APIv2Controller.php","line":152,"function":"get","class":"OCA\\Activity\\Controller\\APIv2Controller","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getFilter","class":"OCA\\Activity\\Controller\\APIv2Controller","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/URLGenerator.php","Line":274,"CustomMessage":"Exception thrown: RuntimeException"},"id":"660d62fe16bed"}
...
{"reqId":"byJUgHTM4XbLJRQBKtRX","level":3,"time":"2024-04-03T15:48:16+03:00","remoteAddr":"REPLACE","user":"--","app":"no app in context","method":"POST","url":"/apps/circles/async/1971e02f-d2a1-4477-96ec-799bdf6a8adb/","message":">> Member","userAgent":"--","version":"28.0.4.1","data":[],"id":"660d65df88040"}

More than 200 errors were generated in a few seconds:

RuntimeException
image not found: image:png webroot: serverroot:/var/www/nextcloud

Any ideas?

2 Likes

Today, this happened to my account. This is what the “Activities” app looks like

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));
 }

The error started to occur when I started testing the “collectives” and “circles” application

The workaround for now is to clean the DB

DELETE FROM oc_activity WHERE affecteduser = 'user';

I’m seeing the same error as well in my error log.

Nextcloud v 28.0.2 running in docker on Unraid

“RuntimeException
image not found: image:png webroot: serverroot:/app/www/public
Exception thrown: RuntimeException”

Steps to replicate it:

  1. Create “New collective”: Name “Test 5” → Create without members
  2. Collective list: “Test 5” → Settings → Delete collective
  3. Deleted collectives list: “Test 5” → Delete permanently: Collective and team
    3.1. or Delete permanently: Only collective
    3.2. Contacts app → Circles → “Test 5” → Delete circle
  4. Open Activity app

Update:

  1. Create new circle: Contacts app → Circles
  2. Delete circle: Contacts app → Circles
  3. Open Activity app

Update:

  1. Create new circle: Contacts app → Circles
  2. Add a new user to the circle
  3. Both users are getting errors in the Activity app

Temporary solution:
vim /etc/crontab

* * * * * root mysql -u root nextcloud -e "DELETE FROM oc_activity WHERE app = 'circles';"
* * * * * root sed -i '/image not found\: image\:png webroot\: serverroot/d' REPLACE_ME_nextcloud_log_file
3 Likes

Tracking as an open bug here: [Bug]: RuntimeException image not found: image:png With Circles Activated · Issue #44744 · nextcloud/server · GitHub

3 Likes

This might be annoying, but would you mind explaining exactly what this SQL command does? I am not an experienced SQL person, and would love to take the chance to learn how this solves the issue.

Also, why are the two commands you’ve offered different, do they achieve the same thing, or slightly different things that both fix the problem?

Thanks so much!

oc_activity is a table in the database that contains all event records. The SQL command deletes all entries (for all users) from this table where the header is “app” = “circles”. This solves the problem where the user cannot use the activity app

The second line removes a mention of an error from the nextсloud log file. You must specify the path to your nextсloud log file (REPLACE_ME_nextcloud_log_file)

1 Like

Hi team,

I’m also having the same issue. I will try the temporary solution later today and will let you know if it worked.

It will be nice if could be fixed with next patch.

Cheers

It did not worked for me. :sob:

What exactly didn’t work for you? Are there any error messages?

Still I was getting the same Could not load activities pop-ups and same error messages:

RuntimeException image not found: image:png webroot: serverroot:/var/www/nextcloud
Exception thrown: RuntimeException

I stop the notification and activities for push and for mail for circle and how I do not get this pop-up any more.
The cron solution above did not solved anything.

Solving cron just removes the consequences of the problem. Did you wait a minute for the cron task to complete? Try running the command without cron, the console may display some kind of error.

Your installation may require you to specify a password to access the database.

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. :hugs:

2 Likes

Please provide code changes it GitHub.
As soon as they are merged users should adapt it.

This works for me, thanks!

1 Like

With this code, the activity application works without problems, but the following message still appears in the nextcloud logs:

{"reqId":"qpPJjCuTPLvk4FjDeEpw","level":3,"time":"2024-04-19T06:50:01+03:00","remoteAddr":"","user":"--","app":"activity","method":"","url":"--","message":"Exception occurred while sending user digest email","userAgent":"--","version":"28.0.4.1","exception":{"Exception":"RuntimeException","Message":"image not found: image:circles.png webroot: serverroot:/var/www/nextcloud","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/circles/lib/Activity/Provider.php","line":106,"function":"imagePath","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/apps/circles/lib/Activity/Provider.php","line":67,"function":"setIcon","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/GroupHelper.php","line":72,"function":"parse","class":"OCA\\Circles\\Activity\\Provider","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/Data.php","line":248,"function":"addActivity","class":"OCA\\Activity\\GroupHelper","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/DigestSender.php","line":139,"function":"get","class":"OCA\\Activity\\Data","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/DigestSender.php","line":88,"function":"sendDigestForUser","class":"OCA\\Activity\\DigestSender","type":"->"},{"file":"/var/www/nextcloud/apps/activity/lib/BackgroundJob/DigestMail.php","line":45,"function":"sendDigests","class":"OCA\\Activity\\DigestSender","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/Job.php","line":54,"function":"run","class":"OCA\\Activity\\BackgroundJob\\DigestMail","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":60,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/URLGenerator.php","Line":274,"message":"Exception occurred while sending user digest email","exception":[],"CustomMessage":"Exception occurred while sending user digest email"},"id":"66222ead39ce6"}