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

NC12 Symlink and "ResourceLocator can not find a web root" #5057

Closed
ldapomni opened this issue May 23, 2017 · 24 comments
Closed

NC12 Symlink and "ResourceLocator can not find a web root" #5057

ldapomni opened this issue May 23, 2017 · 24 comments

Comments

@ldapomni
Copy link

ldapomni commented May 23, 2017

Steps to reproduce

  1. symlink to NC12 root
    Write symlink path in config.php

( i have symlink - /www/nextcloud to /srv/www/htdocs/nextcloud)

Error in log
Debug files_texteditor Could not find resource file "/css/files_texteditor/merged.css" 2017-05-23 11:45:07

Error lib ResourceLocator can not find a web root (root: /www/nextcloud/apps/files_texteditor, file: css/files_texteditor/merged.css, webRoot: , throw: true) 2017-05-23 11:45:07

Debug files_sharing Could not find resource file "/css/files_sharing/mergedAdditionalStyles.css" 2017-05-23 11:45:07

Error lib ResourceLocator can not find a web root (root: /www/nextcloud/apps/files_sharing, file: css/files_sharing/mergedAdditionalStyles.css, webRoot: , throw: true) 2017-05-23 11:45:07

Debug files Could not find resource file "/css/files/merged.css" 2017-05-23 11:45:07

Error lib ResourceLocator can not find a web root (root: /www/nextcloud/apps/files, file: css/files/merged.css, webRoot: , throw: true)

CSSResourceLocator.php
append function get param
put to file $root,$file

...

/srv/www/htdocs/nextcloud css/core/server.css

/srv/www/htdocs/nextcloud css/core/share.css

/www/nextcloud/apps/files css/files/merged.css

/www/nextcloud/apps/files_sharing css/files_sharing/mergedAdditionalStyles.css

/www/nextcloud/apps/files_texteditor css/files_texteditor/merged.css

/srv/www/htdocs/nextcloud css/core/systemtags.css

/srv/www/htdocs/nextcloud css/core/server.css

/srv/www/htdocs/nextcloud css/core/share.css

...

@ldapomni ldapomni changed the title NC12 "ResourceLocator can not find a web root" NC12 Symlink and "ResourceLocator can not find a web root" May 23, 2017
@jakobsack
Copy link
Member

I can confirm this issue.

@kyrofa
Copy link
Member

kyrofa commented May 23, 2017

This seems to be biting the Nextcloud snap, as well.

@oparoz oparoz added this to the Nextcloud 13 milestone May 23, 2017
@kyrofa
Copy link
Member

kyrofa commented May 23, 2017

@oparoz can we get this sooner than 13? Otherwise there's no way to update snap users (since they'll need to jump from 11->13, right?).

@jospoortvliet
Copy link
Member

Ok I shouldn't be changing the labels here but yeah, it'd be nice to have this fixed before Nextcloud 12 so the users of the Box and other Snap users can use Nextcloud 12. May I ask why this was set to enhancement instead of a regression and bug and why only for 13, @oparoz

@derkostka
Copy link
Contributor

The same issue was found here: #4857. I closed it as this one is accepted as bug already 💯

@oparoz
Copy link
Member

oparoz commented May 23, 2017

I set it as an enhancement, thinking that this was not an officially supported way of using config.php, but let's try to fix the new CSS compiler.

@callmemagnus
Copy link
Contributor

Adding my 2 cents, I have only one symlink at the root of the installation:

root@server:/home/webs/example/cloud# ls -la
total 64
drwxr-x--- 13 www-data www-data 4096 mai 23 22:24 .
drwxr-xr-x 14 www-data www-data 4096 mai  3  2016 ..
drwxr-x---  5 root     root     4096 mai 23 21:36 apps2
drwxr-x--- 14 root     root     4096 mai 23 19:06 backups
drwxr-x---  6 www-data www-data 4096 jan 17 20:07 data
lrwxrwxrwx  1 root     root       25 mai 23 19:26 nextcloud -> nextcloud.20170523.12.0.0
drwxr-x--- 14 www-data www-data 4096 jan 17 18:28 nextcloud.20161210.10.0.2
drwxr-x--- 14 www-data www-data 4096 fév  1 23:10 nextcloud.20170117.10.0.3
drwxr-x--- 14 www-data www-data 4096 fév  1 23:48 nextcloud.20170201.11.0.1
drwxr-x--- 15 www-data www-data 4096 mar  7 00:01 nextcloud.20170228.11.0.2
drwxr-x--- 15 www-data www-data 4096 mai  6 12:00 nextcloud.20170424.11.0.3
drwxr-x--- 14 www-data www-data 4096 mai 23 21:07 nextcloud.20170523.12.0.0
drwxr-x--- 11 www-data www-data 4096 fév  1 23:49 nextcloud-data
drwxr-x---  3 root     root     4096 mai 23 18:51 tmp
-rw-r-----  1 root     root     1748 mai 23 22:24 update.sh
root@server:/home/webs/example/cloud# 

And I have the bad layout on Files and these errors in the logs

...
ResourceLocator can not find a web root (root: /home/webs/example/cloud/nextcloud/apps/files, file: css/files/merged.css, webRoot: , throw: true)
ResourceLocator can not find a web root (root: /home/webs/example/cloud/nextcloud/apps/files_texteditor, file: css/files_texteditor/merged.css, webRoot: , throw: true)
...

@pongraczi
Copy link

In my case, I have no symlinks......

@derkostka
Copy link
Contributor

Another use case is the following: let /var/www/nextcloud be a symlink to some external folder. In that case the config.php and apache/ngnix config is "default", but the underlying type is not a folder, but a link. This is what I did and leads to exact the same issue.

@Glandos
Copy link
Contributor

Glandos commented May 24, 2017

In the meantime, is there any workaround, like generate CSS files manually?
I am in the same configuration as @callmemagnus (a symlink to the versionned named folder), and when I tried to mv nextcloud-12.0.0 nextcloud, everything definitely stopped working, because a lot of cache expects to find files in nextcloud-12.0.0.
So this is annoying.

@elpraga
Copy link

elpraga commented May 24, 2017

In my case, I have no symlinks, and I also experience this issue, and I would be very grateful for some kind of (even manual) fix, as this bug renders the files app almost unusable, or at least, limits its usability very much. (apart from looking highly unprofessional, file details are missing, sharing options are not accessible, etc..)

I am also finding this in my log:

Debug	files_texteditor	Could not find resource file "/css/files_texteditor/merged.css"	a few seconds ago
Error	lib	ResourceLocator can not find a web root (root: /var/www/cloud.net/apps/files_texteditor, file: css/files_texteditor/merged.css, webRoot: , throw: true)	a few seconds ago
Debug	files_sharing	Could not find resource file "/css/files_sharing/mergedAdditionalStyles.css"	a few seconds ago
Error	lib	ResourceLocator can not find a web root (root: /var/www/cloud.net/apps/files_sharing, file: css/files_sharing/mergedAdditionalStyles.css, webRoot: , throw: true)

screenshot from 2017-05-24 23-23-38

I forgot to mention that I am using the 12.0.0 stable version that is being announces on the official webpage as the version to use. So I would think that such a visible bug should get a swift attention..

@elpraga
Copy link

elpraga commented May 24, 2017

Please, let me know what information can I provide to help to fix this problem.

@elpraga
Copy link

elpraga commented May 25, 2017

I apologize, I forgot that I had the entire /var/www/ linked to another disk, so when I listed the /var/www/ directory, I didn't see any linked folders. So my case was also caused by using a linked folder in the root directory of the Nextcloud instalation.

Fortunately, getting rid of the link fixed the issue for me.

@derkostka
Copy link
Contributor

In case you want to help, I think the change was introduced with #3619.

@elpraga
Copy link

elpraga commented May 25, 2017

Thank you for the link @derkostka ! And I apologize again for the misinformation.

@sileht
Copy link

sileht commented May 28, 2017

I have the same issue, that's my current workaround: https://gist.github.com/sileht/5753118ee048352778c2a0c5b23ea47d

@mossholderm
Copy link

The solution posted by sileht seems to be correct. Could someone merge it?

@derkostka
Copy link
Contributor

Done: #5252. Please consider for 12.0.1. Thanks @sileht again !

@jospoortvliet
Copy link
Member

@sileht I can't judge the code but if it works, pls consider creating a PR ;-)

@sileht
Copy link

sileht commented Jun 5, 2017

I just write a workaround, I don't known if that the "good" solution and I have no time a babysit a PR for this.
But if that the good solution, someone have created a PR here: #5252

@MorrisJobke
Copy link
Member

Fixed in 12.0.1 and 13.

@jospoortvliet
Copy link
Member

@sileht @derkostka thanks a lot for making this happen ;-)

It might be a small patch but we have over 1500 people with a Nextcloud Box at home who can now get 12.0.1 and that's ignoring the many thousands who use the Snap on a normal Ubuntu or other Linux system!

@Temtaime
Copy link
Contributor

Temtaime commented May 9, 2018

Happens for me for 13.0.2
ResourceLocator can not find a web root (root: /var/lib/nextcloud/apps/tasks, file: css/tasks/3bd5-a778-style.css, webRoot: , throw: true)

@skjnldsv
Copy link
Member

skjnldsv commented May 9, 2018

@Temtaime it is supposed to be fix, could you open a new issue? :)

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

No branches or pull requests