[Bug]: Application without an icon is causing a runtime exception
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia con lib/private/NavigationManager.php e lib/private/URLGenerator.php, quindi riproduci il problema usando un’app generata il cui appinfo/info.xml ometta l’icona di navigazione. Traccia come viene risolto il percorso dell’icona predefinita. Il lavoro è completato quando un’app abilitata senza quella voce opzionale carica la normale interfaccia web senza un’eccezione a runtime.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
A third-party application without a navigations/navigation/icon entry in the appinfo/info.xml file is causing a runtime exception once the app is enabled, because the default-app-icon.svg file cannot be found.
The issue seems to be that the default-app-icon.svg file is shipped in this folder:
core/img/places/default-app-icon.svg
The lib/private/NavigationManager.php tries to get the imagePath like this:
if ($icon === null) {
$icon = $this->urlGenerator->imagePath('core', 'default-app-icon');
}
The imagePath function in the lib/private/URLGenerator.php file has a very large if/else block for searching all kinds of folders, but the core/img/places folder is not part of that.
Based on the developer manual the navigations/navigation/icon entry is optional, so Nextcloud should be able to handle it:
https://docs.nextcloud.com/server/latest/developer_manual/app_development/info.html
Steps to reproduce
-
Have a working Nextcloud installation, make sure the web interface works
-
Generate a
helloworldapplication with the application generator: -
Extract the archive, put it into the apps folder, give it proper permissions, etc.
-
Edit the
appinfo/info.xmlfile manually, remove thenavigations/navigation/iconline entirely. -
Enable the application with
occ app:enable helloworld -
Refresh the Nextcloud page in your browser, you should see a runtime exception with an error message
Expected behavior
Nextcloud should display the usual web interface instead of the runtime exception.
Nextcloud Server version
32
Operating system
Other
PHP engine version
PHP 8.4
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
{"reqId":"lpHmBHRz36uuCcFhxJ2V","level":3,"time":"2026-04-20T11:31:45+00:00","remoteAddr":"192.168.2.200","user":"udi","app":"index","method":"GET","url":"/index.phpboard/","scriptName":"/index.php","message":"image not found: image:default-app-icon webroot: serverroot:/var/www/nextcloud/htdocs","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0","version":"32.0.6.1","exception":{"Exception":"RuntimeException","Message":"image not found: image:default-app-icon webroot: serverroot:/var/www/nextcloud/htdocs","Code":0,"Trace":[{"file":"/var/www/nextcloud/htdocs/lib/private/NavigationManager.php","line":378,"function":"imagePath","class":"OC\\URLGenerator","type":"->","args":["core","default-app-icon"]},{"file":"/var/www/nextcloud/htdocs/lib/private/NavigationManager.php","line":125,"function":"init","class":"OC\\NavigationManager","type":"->","args":[]},{"file":"/var/www/nextcloud/htdocs/lib/private/TemplateLayout.php","line":77,"function":"getAll","class":"OC\\NavigationManager","type":"->","args":[]},{"file":"/var/www/nextcloud/htdocs/lib/private/Template/Template.php","line":115,"function":"getPageTemplate","class":"OC\\TemplateLayout","type":"->","args":["user","dashboard"]},{"file":"/var/www/nextcloud/htdocs/lib/public/AppFramework/Http/TemplateResponse.php","line":195,"function":"fetchPage","class":"OC\\Template\\Template","type":"->","args":[{"id-app-content":"#app-dashboard","id-app-navigation":null,"pageTitle":"Ir\u00e1ny\u00edt\u00f3pult"}]},{"file":"/var/www/nextcloud/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":163,"function":"render","class":"OCP\\AppFramework\\Http\\TemplateResponse","type":"->","args":[]},{"file":"/var/www/nextcloud/htdocs/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Dashboard\\Controller\\DashboardController"},"index"]},{"file":"/var/www/nextcloud/htdocs/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Dashboard\\Controller\\DashboardController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"dashboard.dashboard.index"}]},{"file":"/var/www/nextcloud/htdocs/lib/base.php","line":1091,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/dashboard/"]},{"file":"/var/www/nextcloud/htdocs/index.php","line":25,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/htdocs/lib/private/URLGenerator.php","Line":252,"message":"image not found: image:default-app-icon webroot: serverroot:/var/www/nextcloud/htdocs","exception":{},"CustomMessage":"image not found: image:default-app-icon webroot: serverroot:/var/www/nextcloud/htdocs"}}
Additional info
No response
- Lingua principale
- PHP
- Stelle
- 37k
- Fork
- 5.3k
- Merge medio
- 2g 1h
- PR unite (30g)
- 723
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/server
-
1. to develop technical debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/server
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
[Admin]: Installation failsAperta🧠 Admin
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
pluginsGLPI/tag#389 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 78/100
opencart/opencart#15763 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
support
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
opnsense/core#10976 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno