Is ThemesService missing from latest NextCloud zip?

I want to install NextCloud server on Debian 12.

For that I found this tutorial:

It instructs to download NC:

curl -o nextcloud.zip https://download.nextcloud.com/server/releases/latest.zip
unzip nextcloud.zip

But when I visit http://nextcloud.howtoforge.local/ in my browser (domain is defined in /etc/hosts for now, will deal with it later when I get NC itself working), I get this error:

Internal Server Error

When I lookup /var/www/nextcloud/data/nextcloud.log I see the following 3 messages being logged:

{"reqId":"X7FssjFBX4MnYXvKDBiC","level":3,"time":"2025-04-10T22:59:09+00:00","remoteAddr":"127.0.0.1","user":"--","app":"index","method":"GET","url":"/","message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":155,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":42,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":39,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":183,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":120,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":113,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":210,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":83,"function":"printGuestPage","class":"OC_Template","type":"::"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":55,"function":"display","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":973,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":113,"message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","exception":{},"CustomMessage":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist"}}
{"reqId":"X7FssjFBX4MnYXvKDBiC","level":3,"time":"2025-04-10T22:59:09+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/","message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":155,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":42,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":39,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":183,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":120,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":113,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":210,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":83,"function":"printGuestPage","class":"OC_Template","type":"::"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":55,"function":"display","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":973,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":113,"message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","exception":{},"CustomMessage":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist"}}
{"reqId":"X7FssjFBX4MnYXvKDBiC","level":3,"time":"2025-04-10T22:59:09+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/","message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":155,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":42,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":39,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":183,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":120,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":113,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":297,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line":89,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":113,"message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","exception":{},"CustomMessage":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist"}}

When I look inside that zip file I see no OCA directory. Did you forget to add OCA\\Theming\\Service\\ThemesService to your latest zip?

1 Like

I am experiencing the same issue as well.

1 Like

When I look inside that zip file I see no OCA directory. Did you forget to add OCA\\Theming\\Service\\ThemesService to your latest zip?

The file for that class should be located at apps/theming/lib/Service/ThemesService.php.

It appears in the .zip file I downloaded.

Follow-up: One of the LSIO image maintainers just reported a similar issue as a potential bug.

1 Like

I start to wonder could some apache or php misconfiguration lead to this error?

For testing I tried to download https://download.nextcloud.com/server/releases/latest-29.zip instead but got the same error just different line numbers.

{"reqId":"rIoeTT6Hsk5s1kiiqfvY","level":3,"time":"2025-04-11T23:00:46+00:00","remoteAddr":"127.0.0.1","user":"--","app":"index","method":"GET","url":"/","message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":173,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":64,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":55,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":215,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":235,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":107,"function":"printGuestPage","class":"OC_Template","type":"::"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":79,"function":"display","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":1015,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":135,"message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","exception":{},"CustomMessage":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist"}}
{"reqId":"rIoeTT6Hsk5s1kiiqfvY","level":3,"time":"2025-04-11T23:00:46+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/","message":"Exception thrown: OC\\AppFramework\\Utility\\QueryNotFoundException","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":173,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":64,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":55,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":215,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":235,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":107,"function":"printGuestPage","class":"OC_Template","type":"::"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":79,"function":"display","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":1015,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":135,"CustomMessage":"Exception thrown: OC\\AppFramework\\Utility\\QueryNotFoundException"}}
{"reqId":"rIoeTT6Hsk5s1kiiqfvY","level":3,"time":"2025-04-11T23:00:46+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/","message":"Exception thrown: OC\\AppFramework\\Utility\\QueryNotFoundException","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"","exception":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Theming\\Service\\ThemesService! Class \"OCA\\Theming\\Service\\ThemesService\" does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":173,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":64,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":55,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":215,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":320,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line":114,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":135,"CustomMessage":"Exception thrown: OC\\AppFramework\\Utility\\QueryNotFoundException"}}

The file for that class should be located at apps/theming/lib/Service/ThemesService.php.

Yep I can confirm it is there and I have extracted it.

So it seems like misleading error message that is caused by something else. Any ideas what it might be?

There is an issue in the latest release, sorry for that.

For 29 use https://download.nextcloud.com/server/releases/nextcloud-29.0.14.zip

For 30 use https://download.nextcloud.com/server/releases/nextcloud-30.0.8.zip

For 31 use https://download.nextcloud.com/server/releases/nextcloud-31.0.2.zip

For 31 you can also use the latest version and apply the patch at [stable31] ignore missing theming app by ArtificialOwl · Pull Request #52135 · nextcloud/server · GitHub
(It might be possible that it also cleanly applies to 29/30, but I haven’t checked)

Thanks, that helped me to get it working.

I wonder why didn’t latest 29 work? I expected that only 31 has latest but you seem to maintain multiple latest at the same time? Like latest 29, latest 30 and latest 31?

To get the updated installation working again, I did the following:

  • manually applied the patch from #52135

Still not working

  • overwrite everything with the files from 31.0.3.zip

This did also nothing, same error persisted.

  • overwrite everything with the files from 31.0.2.zip
  • change version in config.php to “fix” the Downgrade message

now it was accessible again via the web UI

To recreate the error, I then ran the upgrade again:

  • run updater.phar again

After that, the system still was working (even without the patch)

Something’s really strange here…

latest.zip is always the latest release Nextcloud version (31.0.x in this case). But we also have the latest release of each major release, so latest-29.zip refers to 29.0.15 at the moment, which has the same issue. That’s why 29.0.14 works.

So to be clear:

  • That was a working installation that stopped working after upgrade? (From which version did you upgrade?)
    or
  • It was a new installation, that failed to install?

I am also facing the same issue. When I start the manual installation the script redirects to the error “Internal Server Error” Upon checking the logs it throws the following error.

“message”:“Could not resolve OCA\Theming\Service\ThemesService! Class "OCA\Theming\Service\ThemesService" does not exist”

I am testing on PHP 8.1 and Mysql 8.0

I believe that many people are getting this issue and I guess this will get resolved in 31.0.4 version. May I know Is there any ETA for the 31.0.4

Should be released tomorrow: Maintenance and Release Schedule · nextcloud/server Wiki · GitHub