FS#69814 - [nextcloud] merged.css error

Attached to Project: Community Packages
Opened by Christophe Réquillart (crequill) - Saturday, 27 February 2021, 14:42 GMT
Last edited by David Runge (dvzrv) - Friday, 26 March 2021, 18:55 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
David Runge (dvzrv)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Nextcloud 21 has a file named /var/lib/nextcloud/apps/files/css/merged.scss with this content:
@import 'files.scss';
@import 'upload.scss';
@import 'mobile.scss';
@import 'detailsView.scss';
@import '../../../core/css/whatsnew.scss';

whatsnew.scss can not be found as this file is here: /usr/share/nextcloud/core/csss/whatsnew.scss

Additional info:
* package version(s): 21.0.0-7

Steps to reproduce:
With the original content, I get this error:
index","method":"GET","url":"/cloud/index.php/apps/files/","message":{"Exception":"ScssPhp\\ScssPhp\\Exception\\CompilerException","Message":"`../../../core/css/whatsnew.scss` file not found for @import: /var/lib/nextcloud/apps/files/css/merged.scss on line 5, at column 1\nCall Stack:\n#0 import /var/lib/nextcloud/apps/files/css/merged.scss (unknown file) on line 1","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":5377,"function":"error","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2475,"function":"findImport","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2688,"function":"compileImport","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2154,"function":"compileChild","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":5306,"function":"compileChildrenNoReturn","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2477,"function":"importFile","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2688,"function":"compileImport","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":2154,"function":"compileChild","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":570,"function":"compileChildrenNoReturn","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","line":401,"function":"compileRoot","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/SCSSCacher.php","line":343,"function":"compile","class":"ScssPhp\\ScssPhp\\Compiler","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/SCSSCacher.php","line":189,"function":"cache","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/CSSResourceLocator.php","line":111,"function":"process","class":"OC\\Template\\SCSSCacher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/CSSResourceLocator.php","line":86,"function":"cacheAndAppendScssIfExist","class":"OC\\Template\\CSSResourceLocator","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/ResourceLocator.php","line":79,"function":"doFind","class":"OC\\Template\\CSSResourceLocator","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/TemplateLayout.php","line":330,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/TemplateLayout.php","line":238,"function":"findStylesheetFiles","class":"OC\\TemplateLayout","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":183,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php","line":210,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":172,"function":"render","class":"OCP\\AppFramework\\Http\\TemplateResponse","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/webapps/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php","Line":5602,"CustomMessage":"--"}
This task depends upon

Closed by  David Runge (dvzrv)
Friday, 26 March 2021, 18:55 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Apps, that were partially provided by the packages in the repository were copied/moved to the writable apps location in /var/lib/nextcloud/apps, which introduces issues.
Comment by David Runge (dvzrv) - Saturday, 27 February 2021, 21:49 GMT
@crequill: Thanks for the report.

One arbitrary note: Why do you install the files app separately? It comes with nextcloud (in /usr/share/webapps/nextcloud/apps/files).
I guess the only way of getting around these sorts of issues would be to add a symlink:

ln -s /var/lib/nextcloud/core /usr/share/webapps/nextcloud/core

Please let me know whether this fixes your issue, then it can be added to the package.
Comment by Christophe Réquillart (crequill) - Sunday, 28 February 2021, 09:23 GMT
With nextcloud 21 package there was a lot of changes as the nextcloud user. The package nextcloud installed these files:

usr/share/webapps/nextcloud/wapps
var/
var/lib/
var/lib/nextcloud/
var/lib/nextcloud/apps/
var/lib/nextcloud/data/
var/log/
var/log/nextcloud/

As you see apps is now in var/lib/nextcloud and usr/share/webapps/nextcloud/wapps is a link to var/lib/nextcloud/apps. Nextcloud configuration has to reflect this new configuration. This is for security reason. As write in Archlinux wiki : "neither the data directory nor the writable apps directory is located below /usr/share/webapps/nextcloud/, as that directory is owned by root". /var/lib/nextcloud is owned by nextcloud user.
I don't change this on my own: it comes with the package update.

Will the new link with /usr/share/webapps/nextcloud/core break the security? If not I can test.

For the while I patch merged.scss and it works.
Comment by David Runge (dvzrv) - Sunday, 28 February 2021, 09:58 GMT
Argh, I should not answer tickets late at night:

>> ln -s /var/lib/nextcloud/core /usr/share/webapps/nextcloud/core

This should of course be the other way round!

ln -s /usr/share/webapps/nextcloud/core /var/lib/nextcloud/core

> Will the new link with /usr/share/webapps/nextcloud/core break the security? If not I can test.

No. /usr/share/webapps/nextcloud/core is owned by root and the other applications (installed via pacman) below /usr/share/webapps/nextcloud/apps have access to it as well.

> This is for security reason. As write in Archlinux wiki : "neither the data directory nor the writable apps directory is located below /usr/share/webapps/nextcloud/, as that directory is owned by root". /var/lib/nextcloud is owned by nextcloud user.

I know, as I wrote that :D

> I don't change this on my own: it comes with the package update.

The files app is definitely part of the nextcloud package (see `pacfile /usr/share/webapps/nextcloud/apps/files/`). Did you maybe copy the entire contents of /usr/share/webapps/nextcloud/apps over to /var/lib/nextcloud/apps?

Well, at any rate, I guess other apps will also run into this issue, if they rely on the css of the main application, so it's probably wise to add the symlink, mentioned above, to the package.
Comment by Christophe Réquillart (crequill) - Sunday, 28 February 2021, 17:51 GMT
I don’t know how to reproduce this problem. Yesterday I was using an account I use very little and I get the problem the first time I am connected to my account. And today I can’t reproduce the problem. I don’t know when Nextcloud calls merged.scss.
I create the link but I see non difference: all is working fine.
Yes I have move /usr/share/webapps/nextcloud/apps to /var/lib/nextcloud/ and change its owner and group. And update nextcloud configuration.
Comment by David Runge (dvzrv) - Friday, 26 March 2021, 18:54 GMT
> Yes I have move /usr/share/webapps/nextcloud/apps to /var/lib/nextcloud/ and change its owner and group. And update nextcloud configuration.

You should *not* move all your apps from that directory to /var/lib/nextcloud/apps, as those are partially the ones that are packaged via nextcloud-app-* packages or come with nextcloud itself.

Please make sure to rely on the packaged versions of the apps and only use the apps from the app store in cases where those are not available as packages (they will be installed to /var/lib/nextcloud/apps by nextcloud).

Loading...