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

error 404 for bootstrap.min.css as it is read-only by an owner #660

Closed
sbamin opened this issue Apr 16, 2022 · 8 comments
Closed

error 404 for bootstrap.min.css as it is read-only by an owner #660

sbamin opened this issue Apr 16, 2022 · 8 comments
Assignees

Comments

@sbamin
Copy link

sbamin commented Apr 16, 2022

Started using quarto and love it!

I use custom server to host intranet website. While deploying website using quarto render followed rsync to server:/var/www/html/, website returns error 404 for files, bootstrap.min.css and bootstrap-dark.min.css and thus, fails to render website theme.

I have local umask set to 0022 and for most files under _site/, I get a valid file permissions (read-only by others) but bootstrap.min.css and bootstrap-dark.min.css are set to read-only by the owner only. This is typically not an issue if on remote server, the same user, foo or root is running nginx server but in my case, it runs using nginx user and it fails to read css files. Manually fixing permissions of these css files render website correctly on a remote server, however I need to do this every-time I use quarto render.

ls -alh _site/site_libs/bootstrap/
drwxr-xr-x foo xxxx 224 B  Sat Apr 16 12:07:25 2022 ./
drwxr-xr-x foo xxxx 256 B  Sat Apr 16 12:07:25 2022 ../
.rw------- foo xxxx 280 KB Sat Apr 16 12:07:26 2022 bootstrap-dark.min.css
.rw-r--r-- foo xxxx  78 KB Fri Apr 15 09:37:40 2022 bootstrap-icons.css
.rw-r--r-- foo xxxx 134 KB Fri Apr 15 09:37:40 2022 bootstrap-icons.woff
.rw------- foo xxxx 280 KB Sat Apr 16 12:07:26 2022 bootstrap.min.css
.rw-r--r-- foo xxxx  76 KB Fri Apr 15 09:37:40 2022 bootstrap.min.js
@dragonstyle
Copy link
Collaborator

Sorry you've run into this!

I wonder if the issue has to do with our SCSS compilation pipeline and caching. For example, if at one time you had the local unmask set to a restrictive permission, we could've generated these files with invalid permissions, and since no content inside of them is changing, we're always using the cached version with incorrect file permissions. (If this is true, I'll still need to figure a better way to deal with this).

You could test this theory by clearing the files out of our scss cache directory at:

$XGD_CACHE_DIR/quarto/sass/
$HOME/.cache/quarto/sass/

Once you've cleared the cache, render the site again and we will regenerate the files (hopefully with the correct permissions). If this doesn't solve the issue (or you know you haven't changed the unmask setting). I can keep digging into why these files are getting created with incorrect permissions...

@dragonstyle dragonstyle self-assigned this Apr 17, 2022
@sbamin
Copy link
Author

sbamin commented Apr 17, 2022

Thanks! I am using mac OS 10.15 (catalina) and quarto v 0.9.254. umask is set of 0022. I checked sass cache dir for quarto if any at ~/.cache, ~/Library/Application Support/ but there is none. I removed _site directory and reran quarto render. I am getting .rw------- for bootstrap.min.css and bootstrap-dark.min.css files.

This is not a major issue for me though. For now, I simply change to chmod 644 for those files before I push those to server.

@dragonstyle
Copy link
Collaborator

Thanks for checking (I gave you linux paths). Any chance you could check one other location for me?

/Users/<user>/Library/Caches/quarto/sass/

is the correct path on Mac.

@sbamin
Copy link
Author

sbamin commented Apr 17, 2022

Sure and forgot to check that one. Here is output.

.rw-r--r-- foo xxxx 234 KB Fri Apr 15 10:32:47 2022 397ef2e52d54cf686e4908b90039e9db.css
.rw-r--r-- foo xxxx  64 KB Fri Apr 15 10:32:47 2022 397ef2e52d54cf686e4908b90039e9db.css.map
.rw-r--r-- foo xxxx 2.5 KB Sat Apr 16 11:46:59 2022 935a306eefa94366c21e1a970dddb765.css
.rw-r--r-- foo xxxx 816 B  Sat Apr 16 11:46:59 2022 935a306eefa94366c21e1a970dddb765.css.map
.rw-r--r-- foo xxxx 280 KB Sun Apr 17 16:54:48 2022 a186085d7076beb122af05341f010370.css
.rw-r--r-- foo xxxx  73 KB Sun Apr 17 16:54:48 2022 a186085d7076beb122af05341f010370.css.map
.rw-r--r-- foo xxxx 2.3 KB Sat Apr 16 11:47:12 2022 debc5d5d77c3f9108843748ff7464032.css
.rw-r--r-- foo xxxx 765 B  Sat Apr 16 11:47:12 2022 debc5d5d77c3f9108843748ff7464032.css.map
.rw-r--r-- foo xxxx 280 KB Sun Apr 17 16:54:48 2022 e846a079faa73a0d79bb75c6ca367f4c.css
.rw-r--r-- foo xxxx  73 KB Sun Apr 17 16:54:48 2022 e846a079faa73a0d79bb75c6ca367f4c.css.map
.rw-r--r-- foo xxxx 1.1 KB Sun Apr 17 16:54:48 2022 index.json

I then did following:

rm -rf /Users/<user>/Library/Caches/quarto/sass/
cd <quarto website>
rm -rf _site
umask 0022
touch testme
ls -alh testm # shows 644 permission
quarto render

No change and _site/site_libs/bootstrap/bootstrap*.min.css files have 600 permission.

@dragonstyle
Copy link
Collaborator

Ok thanks so much checking - that definitely shoots down that theory! I'll do more digging...

@sbamin
Copy link
Author

sbamin commented Apr 17, 2022

Since git does not track read-write permission, once I set valid 644 permissions on local and push these changes to github, subsequent reversion to 600 on local (with quarto render) command does nothing on github because any new push to github ignores read-write perms for these files as a valid change.

I use git pull over rsync to update remote server, and so that way, I do not need to worry about changing file perm on server each time I update website.

@dragonstyle
Copy link
Collaborator

Thanks for you help, I do believe that I found the issue and fixed it here:
a84fe78

There is a fresh release on the way with this change.

@sbamin
Copy link
Author

sbamin commented Apr 18, 2022

great and happy to help. Thanks again for this making this great product.

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

No branches or pull requests

2 participants