Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing icons in Files app after 12.0.1 upgrade #6028

Closed
ladrua opened this issue Aug 8, 2017 · 55 comments · Fixed by #7061
Closed

Missing icons in Files app after 12.0.1 upgrade #6028

ladrua opened this issue Aug 8, 2017 · 55 comments · Fixed by #7061

Comments

@ladrua
Copy link

ladrua commented Aug 8, 2017

Steps to reproduce

  1. Upgrade to 12.0.1 manual from source.
  2. run occ upgrade
  3. Go to Files app.

Expected behaviour

Normal files view.

Actual behaviour

Files view is missing all icons, seems like some css is not acting as it should either. No errors found in log or in browser.

Server configuration

Operating system:
ubuntu 14.04.5 docker image
Web server:
Apache 2.4
Database:
MySQL 5.7.19
PHP version:
PHP 7.0
Nextcloud version: (see Nextcloud admin page)
12.0.1.5
Updated from an older Nextcloud/ownCloud or fresh install:
12.0.0.39
Where did you install Nextcloud from:
Download stable sources from nextcloud.com

@pixelipo
Copy link
Contributor

pixelipo commented Aug 8, 2017

Sounds like permissions issue to me. Nextcloud needs to be able to generate CSS file out of existing (S)CSS ones.

@ladrua
Copy link
Author

ladrua commented Aug 8, 2017

Yeah, thats what I thought too, but ran chown www-data -R nextcloud/ just to be sure, still problem. And its only the Files app, the others are ok.

@pachulo
Copy link
Contributor

pachulo commented Aug 8, 2017

Hey @ladrua ! Does this looks like the bug you are seeing?

image

@ladrua
Copy link
Author

ladrua commented Aug 8, 2017

@pachulo yes, exactly.

@pachulo
Copy link
Contributor

pachulo commented Aug 8, 2017

Well, we are experiencing this behaviour also in the nextcloud snap, as described here nextcloud-snap/nextcloud-snap#334 (comment)

We are seeing these errors in the Chrome dev tools console:
image

With the error pointing to this piece of Javascript:
image

My Javascript/CSS foo is weak, so I cannot really tell why it is adding that "cs" to the ".nav-icon-favorites" style:

image

For example:
http://localhost/cs/apps/files/img/share.svg?v=1 -> 404
http://localhost/apps/files/img/share.svg?v=1 -> 200

Besides that, Firefox dev tools show this error when trying to inspect a missing icon:
image

It basically says that it could not load it.

For the record: I've also tried spinning a nextcloud Docker container with 12.0.1 (using this https://github.com/nextcloud/docker) and the icons are shown OK.

@ladrua
Copy link
Author

ladrua commented Aug 9, 2017

I am not getting those error messages, actually no error messages at all.

@maxcrees
Copy link
Member

Having a similar issue upon upgrading to 12.0.1.
1502352247. Developer console has this to say:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src 'nonce-Q0NRZGx3bzUzM3YwU0FqSDBOU0ZPRXRVdTVSQkt3cmdHR05ZK1JPeTlSND06UDAxUm9HVUtxaFdrUEg2L2w3SE1kVEU5ek5rTFhscVJXZ1FpZ1hubHAxQT0=' 'unsafe-eval'”). Source: onsubmit attribute on DIV element.
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src 'nonce-Q0NRZGx3bzUzM3YwU0FqSDBOU0ZPRXRVdTVSQkt3cmdHR05ZK1JPeTlSND06UDAxUm9HVUtxaFdrUEg2L2w3SE1kVEU5ek5rTFhscVJXZ1FpZ1hubHAxQT0=' 'unsafe-eval'”). Source: onchange attribute on DIV element.
Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src 'nonce-Q0NRZGx3bzUzM3YwU0FqSDBOU0ZPRXRVdTVSQkt3cmdHR05ZK1JPeTlSND06UDAxUm9HVUtxaFdrUEg2L2w3SE1kVEU5ek5rTFhscVJXZ1FpZ1hubHAxQT0=' 'unsafe-eval'”). Source: onfocusin attribute on DIV element.

nextcloud.log:

{"reqId":"nFRG5VopzGXvpjzzevRL","level":3,"time":"2017-08-10T08:04:56+00:00","remoteAddr":"76.29.2.249","user":"mcrees","app":"lib","method":"GET","url":"\/apps\/files\/","message
":"ResourceLocator can not find a web root (root: \/usr\/share\/webapps\/nextcloud\/apps\/files, file: css\/files\/97738d638fe5012b793d0a1648c632d0-merged.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36","version":"12.0.1.5"}

@zenny
Copy link

zenny commented Aug 10, 2017

+1 this bug haunted me after the upgrade to 12.0.1 in alpine linux. Is there a way to downgrade?

@kyrofa
Copy link
Member

kyrofa commented Aug 10, 2017

@sroracle that sounds an awful lot like #5057 ... are you sure you're not on v12.0.0?

@tatwaffe
Copy link

tatwaffe commented Aug 11, 2017

Running into same issue after upgrading to 12.0.1

NC LOG:

{"reqId":"DEJNW6Og0FAltsTeIEfc","level":3,"time":"2017-08-11T10:38:38+02:00","remoteAddr":"83.164.193.18","user":"admin","app":"lib","method":"GET","url":"\/apps\/files\/","message":"ResourceLocator can not find a web root (root: \/srv\/web\/nextcloud\/apps\/files, file: css\/files\/1130ef96bf4e8bb336970e2ff913b21c-merged.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko\/20100101 Firefox\/54.0","version":"12.0.1.5"}
{"reqId":"DEJNW6Og0FAltsTeIEfc","level":3,"time":"2017-08-11T10:38:38+02:00","remoteAddr":"83.164.193.18","user":"admin","app":"lib","method":"GET","url":"\/apps\/files\/","message":"ResourceLocator can not find a web root (root: \/srv\/web\/nextcloud\/apps\/files_sharing, file: css\/files_sharing\/1130ef96bf4e8bb336970e2ff913b21c-mergedAdditionalStyles.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko\/20100101 Firefox\/54.0","version":"12.0.1.5"}
{"reqId":"DEJNW6Og0FAltsTeIEfc","level":3,"time":"2017-08-11T10:38:38+02:00","remoteAddr":"83.164.193.18","user":"admin","app":"lib","method":"GET","url":"\/apps\/files\/","message":"ResourceLocator can not find a web root (root: \/srv\/web\/nextcloud\/apps\/files_texteditor, file: css\/files_texteditor\/1130ef96bf4e8bb336970e2ff913b21c-merged.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko\/20100101 Firefox\/54.0","version":"12.0.1.5"}

I use symlinks as follows:

apps -> /srv/gluster/vol0/nextcloud/apps/
apps_c -> /srv/gluster/vol0/nextcloud/apps_c/
config -> /srv/gluster/vol0/nextcloud/config
data -> /srv/gluster/vol0/nextcloud/data

Documentroot is
"/srv/web/nextcloud"

Workaround:
Set manually $tmpRoot to DocumentRoot "/srv/web/nextcloud"

/lib/private/Template/CSSResourceLocator.php 
do {
+                                      $tmpRoot='/srv/web/nextcloud';
                                        if (isset($this->mapping[$tmpRoot])) {
                                                $webRoot = $this->mapping[$t

@zenny
Copy link

zenny commented Aug 11, 2017

@tatwaffe , Thanks for the pointer, but in my case, it was pointing to a different folder, thus assigning $tmpRoot='/usr/share/webapps/nextcloud' seems of no help:

"message":"ResourceLocator can not find a web root (root: /usr/share/webapps/nextcloud/apps/files_texteditor, file: index.php/css/files_texteditor/761d09b04274346884d55b9f24176730-merged.css, webRoot: , throw: true)",

The symlinks are all pointing to where they should except I couldn't see an apps_c pointer, fyi.

@zenny
Copy link

zenny commented Aug 11, 2017

Mine seems like the long outstanding bug as discussed here: #5081 and #5057. More specifically #5252 and #5289 (comment) which does not seem to address the issue. :-(

@rnalrd
Copy link

rnalrd commented Aug 11, 2017

Same problem here after upgrade 12.0.0->12.0.1

Log shows:

{"reqId":"JsFxKMADXgdgMYC0IUEv","level":3,"time":"2017-08-11T19:34:31+00:00","remoteAddr":"192.168.1.1","user":"rnalrd","app":"lib","method":"GET","url":"\/index.php\/apps\/files\/?dir=\/","message":"ResourceLocator can not find a web root (root: \/usr\/share\/webapps\/nextcloud\/apps\/files, file: index.php\/css\/files\/792abc1ff25ef03a8bac471ecd9f6842-merged.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Ubuntu Chromium\/59.0.3071.109 Chrome\/59.0.3071.109 Safari\/537.36","version":"12.0.1.5"}
{"reqId":"JsFxKMADXgdgMYC0IUEv","level":3,"time":"2017-08-11T19:34:31+00:00","remoteAddr":"192.168.1.1","user":"rnalrd","app":"lib","method":"GET","url":"\/index.php\/apps\/files\/?dir=\/","message":"ResourceLocator can not find a web root (root: \/usr\/share\/webapps\/nextcloud\/apps\/files_sharing, file: index.php\/css\/files_sharing\/792abc1ff25ef03a8bac471ecd9f6842-mergedAdditionalStyles.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Ubuntu Chromium\/59.0.3071.109 Chrome\/59.0.3071.109 Safari\/537.36","version":"12.0.1.5"}
{"reqId":"JsFxKMADXgdgMYC0IUEv","level":3,"time":"2017-08-11T19:34:31+00:00","remoteAddr":"192.168.1.1","user":"rnalrd","app":"lib","method":"GET","url":"\/index.php\/apps\/files\/?dir=\/","message":"ResourceLocator can not find a web root (root: \/usr\/share\/webapps\/nextcloud\/apps\/files_texteditor, file: index.php\/css\/files_texteditor\/792abc1ff25ef03a8bac471ecd9f6842-merged.css, webRoot: , throw: true)","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Ubuntu Chromium\/59.0.3071.109 Chrome\/59.0.3071.109 Safari\/537.36","version":"12.0.1.5"}

apps and config are symlinked outside the installation directory.

@maxcrees
Copy link
Member

@kyrofa logging in as administrator confirms that I'm running 12.0.1 and all integrity checks have passed.

After reading this comment I moved the apps directory from /var/lib/nextcloud/apps to /usr/share/webapps/nextcloud/apps (essentially in the document root), and the issue appears to be resolved. For any fellow Alpine users out there, this is a workaround if you are able and willing to move the apps directory, but this will break future package updates (you'll have to manually merge changes) unless we can get whoever maintains the Alpine package to change this.

@zenny
Copy link

zenny commented Aug 11, 2017

@sroracle, yep moving the entire /var/lib/nextcloud/apps to /usr/share/webapps/nextcloud/apps solved this issue. Maybe others have different mileages! Thanks!

@gramakri
Copy link

We hit this issue on the Cloudron NextCloud package as well (https://git.cloudron.io/cloudron/nextcloud-app/issues/22). We also symlink the apps outside the installation directory. Unfortunately, moving apps inside the installation dir is a no-go because on the Cloudron the installation is read-only. Is there any other workaround?

@rnalrd
Copy link

rnalrd commented Aug 12, 2017 via email

@maxcrees
Copy link
Member

@rnalrd I added edge/community to /etc/apk/repositories and ran apk update then reinstalled nextcloud but there was no change. Can you link to the commit? I can't find it.

@rnalrd
Copy link

rnalrd commented Aug 12, 2017 via email

@maxcrees
Copy link
Member

@rnalrd I could not get the setup proposed in that commit to work. It seems either nginx or nextcloud really dislikes having apps in two separate paths. I managed to get e.g. apps1 (apk) and apps2 (app store) in /usr/share/webapps/nextcloud to work, though.

@nebulade
Copy link

I can also confirm that in the Cloudron case, the issue is related to the symlinked apps/ folder. Could this have to do with some relative includes in one of the core apps, which expect the apps folder to be absolute in the main nextcloud directory?

@ghost
Copy link

ghost commented Aug 16, 2017

Same problem on my Synology DS215j. The problem only appears when using PHP 7.0. If I switch to PHP 5.6, i can see the icons again.

@nebulade
Copy link

nebulade commented Oct 2, 2017

From my previous comment #6028 (comment) is there anyone with deeper understanding on the commit f0753cb and how to fix it for the symlink and snap case? Thanks a lot.

@kyrofa
Copy link
Member

kyrofa commented Nov 3, 2017

I'm happy to test any ideas, here. We still have thousands of people stuck on v11 because of this.

@tux-rampage
Copy link
Contributor

Unfortunately this is not trivial, I had no time for further analyzing this issue, yet.

@kyrofa
Copy link
Member

kyrofa commented Nov 4, 2017

I don't actually know anything, but I'm poking about. Something seems funny here. The mapping is always '/snap/nextcloud/2978/htdocs' => '', so the webroot is always ''. Is that correct?

@kyrofa
Copy link
Member

kyrofa commented Nov 4, 2017

Ah, I'm making some headway here. Here is where the SCSS URL rewrites happen. Relevant snippet:

$path = implode('/', $path);
$webDir = substr($path, strlen($this->serverRoot)+1);

$path in this case is, say, /snap/nextcloud/current/htdocs/apps/files/css. However, $this->serverRoot is /snap/nextcloud/x1/htdocs (or 2978 per the example above, point is, the symlink versus the real path), which means the strlen isn't quite right, the substr doesn't do what we expect, and $webDir ends up with docs/apps/files/css where "docs" is the last bit of "htdocs". If the revision was 2978 instead of x1, we'd get cs/apps/files/css, like @pachulo has been seeing.

Pretty sure a sprinkling of realpath in the right spot here will solve it.

kyrofa added a commit to kyrofa/server that referenced this issue Nov 4, 2017
Otherwise, if the server root includes a symlink, the calculated webDir
will be incorrect and CSS will break.

Fix nextcloud#6028

Signed-off-by: Kyle Fazzari <[email protected]>
@kyrofa
Copy link
Member

kyrofa commented Nov 4, 2017

There we go, that fixes things. I'm not 100% sure it's fixed in the right place, but at least it fixes things.

kyrofa added a commit to kyrofa/server that referenced this issue Nov 4, 2017
Currently, if the app path includes a symlink, the calculated webDir
will be incorrect when generating SCSS and CSS will break.

Use realpath when retrieving app path, and these issues go away.

Fix nextcloud#6028

Signed-off-by: Kyle Fazzari <[email protected]>
@kyrofa
Copy link
Member

kyrofa commented Nov 4, 2017

Okay I'm more certain THAT is in the correct place.

kyrofa added a commit to kyrofa/server that referenced this issue Nov 4, 2017
Currently, if the app path includes a symlink, the calculated webDir
will be incorrect when generating CSS and URLs will be pointing to the
wrong place, breaking CSS.

Use realpath when retrieving app path, and these issues go away.

Fix nextcloud#6028

Signed-off-by: Kyle Fazzari <[email protected]>
kyrofa added a commit to kyrofa/server that referenced this issue Nov 14, 2017
Currently, if the app path includes a symlink, the calculated webDir
will be incorrect when generating CSS and URLs will be pointing to the
wrong place, breaking CSS.

Use realpath when retrieving app path, and these issues go away.

Fix nextcloud#6028

Signed-off-by: Kyle Fazzari <[email protected]>
kyrofa added a commit to kyrofa/server that referenced this issue Nov 14, 2017
Currently, if the app path includes a symlink, the calculated webDir
will be incorrect when generating CSS and URLs will be pointing to the
wrong place, breaking CSS.

Use realpath when retrieving app path, and these issues go away.

Fix nextcloud#6028

Signed-off-by: Kyle Fazzari <[email protected]>
@pipiche38
Copy link

This issue seems to still be in 12.0.4
Here is an extract of my config file and if the app is stored on the /var/lib/nextcloud/apps directory - and not on the /usr/share/nextcloud/apps - I got the issue
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/share/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/lib/nextcloud/apps',
'url' => '/apps-appstore',
'writable' => true,
),
),

@RussianNeuroMancer
Copy link

I have this issue on 12.0.4 too.

@tflidd
Copy link
Contributor

tflidd commented Dec 29, 2017

Can you share a bit more information that the developers can reproduce this problem? Is this on new setups, only on updated, which webserver, ...

@RussianNeuroMancer
Copy link

Is this on new setups, only on updated

Updated from 12.0.3 (and previously from every NextCloud release, and before that migrated from OwnCloud).

which webserver

Apache 2.4.29-1 build with enabled http2 module by deb.sury.org, php-fpm 7.1.11 and PostgreSQL 9.6.6 from Ubuntu Server 17.10 repository. What else could help find root cause of this issue?

@RussianNeuroMancer
Copy link

Issue is gone after update to 12.0.5.

@ladrua
Copy link
Author

ladrua commented Feb 14, 2018

Issue is fixed after update to 13.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet