Skip to main content
Topic: CSS Problem (Read 2691 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

CSS Problem

I get this error on server side error.log. The site is live site converted from 1.0.9 to 1.1 beta 4.
Quote2017/02/04 21:29:18 [error] 15655#15655: *4639 open() "/var/www/elkarte11.sch.my/web/themes/default/themes/default/images/icons/quick_sticky.png" failed (2: No such file or directory), client: 192.168.0.108, server: elkarte11.sch.my, request: "GET /themes/default/themes/default/images/icons/quick_sticky.png HTTP/1.1", host: "elkarte11.sch.my", referrer: "https://elkarte11.sch.my/themes/default/cache/hive-f299cc933e24b4579f3ac143fc7b3c39d58743e1.css?c7335198"

2017/02/04 21:29:21 [error] 15655#15655: *4639 open() "/var/www/elkarte11.sch.my/web/themes/default/themes/default/images/admin/admin_sprite.png" failed (2: No such file or directory), client: 192.168.0.108, server: elkarte11.sch.my, request: "GET /themes/default/themes/default/images/admin/admin_sprite.png HTTP/1.1", host: "elkarte11.sch.my", referrer: "https://elkarte11.sch.my/themes/default/cache/hive-f299cc933e24b4579f3ac143fc7b3c39d58743e1.css?c7335198"

2017/02/04 21:29:21 [error] 15655#15655: *4639 open() "/var/www/elkarte11.sch.my/web/themes/default/themes/default/images/icons/header.png" failed (2: No such file or directory), client: 192.168.0.108, server: elkarte11.sch.my, request: "GET /themes/default/themes/default/images/icons/header.png HTTP/1.1", host: "elkarte11.sch.my", referrer: "https://elkarte11.sch.my/themes/default/cache/hive-f299cc933e24b4579f3ac143fc7b3c39d58743e1.css?c7335198"

The referring css file correctly states that all images are at ../themes/default/images/icons/ and ../themes/default/images/admin/ respectively but note the additional "/themes/default/themes/default" in the log.

I was wondering what may cause these as no other images are reported as errors. Any help is appreciated.

Re: CSS Problem

Reply #1

I'm going to guess that it works fine if you don't have CSS/JS minify enabled? 

As the hives are located in a different directory then the original CSS files, it needs to change the relative directory pointers in the CSS files, and it looks like its doing that wrong for some reason?

Re: CSS Problem

Reply #2

You are right. It works fine in non-minified css/js.

And yes, I think so too and I will check for this too.

Edited: Found and deleted cache folder in the default theme folder (where it should be in /cache in the root instead). Disabled cookies, database session settings and caching. Deleted cookies in the browsers. Now it is back to normal. Minified css is in its place and working good.

Problem solved, for now. :D
Last Edit: February 04, 2017, 11:15:32 am by ahrasis

Re: CSS Problem

Reply #3

Sorry. I thought that was resolved yesterday but it's re-occurring again, with strange behavior i.e. I haven't seen it before. Cache folder on root is full of files which I do not know.

The pictures of cache folder on root:
css1.png
css2.png

The list of files with size and date of /cache from terminal listings:
Quote# ls -lt /var/www/clients/client2/web14/web/cache
total 2028
-rw-r--r-- 1 web14 client2    317 Feb  5 02:15 index.php
-rw-r--r-- 1 web14 client2 168556 Feb  5 00:28 hive-c12a8ba62ee3704039ed4eb9a0ed0aea897e68fb.css
-rw-r--r-- 1 web14 client2 142411 Feb  5 00:20 hive-cbbbf02e54c30a20fee8e8a16a058738ea19e7f6.css
-rw-r--r-- 1 web14 client2  23025 Feb  5 00:19 hive-59058a99f16d84a9ffa095d705598237c93e967a.js
-rw-r--r-- 1 web14 client2  76897 Feb  5 00:19 hive-795c67f6ba7d21fe86d971bb181e9c7c4f8912f7.js
-rw-r--r-- 1 web14 client2  74134 Feb  5 00:14 hive-b2f9772db3859ffb066491cf27c2e0ac2c4e96be.js
-rw-r--r-- 1 web14 client2  65254 Feb  5 00:12 hive-f9e55afe2308e18dc3f2243dc9602726f5dbfca0.js
-rw-r--r-- 1 web14 client2  22609 Feb  5 00:10 hive-1a2c34fdc8a4ebff456ecb57cc33159cf0e9cc52.js
-rw-r--r-- 1 web14 client2 180061 Feb  5 00:10 hive-ec677ad3c2e5e62052c0f5fd2a95825cb4d33186.js
-rw-r--r-- 1 web14 client2 166947 Feb  5 00:10 hive-c0cf47a1bba6dc8fb965a853f603042ae9b527e2.css
-rw-r--r-- 1 web14 client2  79683 Feb  5 00:10 hive-59aadcd4765633eb992aec16c3fed7b5787a656c.js
-rw-r--r-- 1 web14 client2  34091 Feb  5 00:09 hive-481ca83740a1df71fcf7e23d0bd322e0ad15bbbc.js
-rw-r--r-- 1 web14 client2 217873 Feb  5 00:09 hive-894db9c7f1841cbfb9613ed221915c87f69fe8eb.js
-rw-r--r-- 1 web14 client2 168398 Feb  5 00:09 hive-7e39728c9bb7fe4a2386887650719e40feaf4c44.css
-rw-r--r-- 1 web14 client2     57 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-log_online-update.php
-rw-r--r-- 1 web14 client2    522 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_css_92d651d5b6eebb730047e859ba4c2111.php
-rw-r--r-- 1 web14 client2    362 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-num_menu_errors.php
-rw-r--r-- 1 web14 client2   1020 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_css_1d1b043bba1df85cd10baf585446ef17.php
-rw-r--r-- 1 web14 client2    534 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_js_295bae65d9e9363d759e07d90eb4b6fd.php
-rw-r--r-- 1 web14 client2    528 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_css_9a72f3b1de2c10227fe85c45f01558ce.php
-rw-r--r-- 1 web14 client2    582 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_js_52e99d0bda96b6378d6b3dcecfde9ea9.php
-rw-r--r-- 1 web14 client2   2027 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_js_55180482892a2bed98964ce24dd48d15.php
-rw-r--r-- 1 web14 client2    570 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_js_c49e6aea3818e78e686acc191a9de152.php
-rw-r--r-- 1 web14 client2    553 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_css_cfe539b86b9dee509e986995eca2a091.php
-rw-r--r-- 1 web14 client2    517 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-load_css_1dc2dc7bfab1162b48711603a4729822.php
-rw-r--r-- 1 web14 client2   2247 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-theme_settings-1.php
-rw-r--r-- 1 web14 client2     48 Feb  5 00:08 data__e3001ce9c14401d70aace685e169055b-ELK-loadavg.php
-rw-r--r-- 1 web14 client2  85591 Feb  5 00:06 hive-5b4ebe198091cd525e2d746f735e25821b473677.js
-rw-r--r-- 1 web14 client2  60787 Feb  5 00:00 hive-93423bc224b47f65e9cd31afd6967f08608c56ed.js
-rw-r--r-- 1 web14 client2 143216 Feb  5 00:00 hive-a7658782468ade0fa38672d6f965666286268d38.css
-rw-r--r-- 1 web14 client2  18209 Feb  5 00:00 hive-719f9f9e8ce9176b005d4cbe0b6ae6f0eb6acf17.js
-rw-r--r-- 1 web14 client2  92961 Feb  5 00:00 hive-ec2f5f0c9ef28f8bd4f2b081dfe3112568742759.js
-rw-r--r-- 1 web14 client2 164797 Feb  5 00:00 hive-a5dbaf1d3013f7ba2c45d32a5b9fd74784b6db6d.css

While that is happening in root cache foder, another cache folder is  recreated by itself in default theme folder, which look is as follows:
css3.png

The list of files with size and date of this /themes/default/cache from terminal listings:
Quote# ls -lt /var/www/clients/client2/web14/web/themes/default/cache
total 1468
-rw-r--r-- 1 web14 client2  29191 Feb  5 09:08 hive-174b66aac514cb3a46e90d969d2bd7ee3dd231b6.js
-rw-r--r-- 1 web14 client2  62215 Feb  5 09:08 hive-297003dd56d2bcdacb83d60c94b785c083445169.js
-rw-r--r-- 1 web14 client2 144645 Feb  5 05:24 hive-2bbb4c0533f30286fa227918767de37d4a3d7893.css
-rw-r--r-- 1 web14 client2  66829 Feb  5 05:03 hive-0c7b115874135ca73497e25a62d4a89e13aec152.js
-rw-r--r-- 1 web14 client2  65883 Feb  5 04:37 hive-e96dc1a932a886740725f21c1db780a3d249f99c.js
-rw-r--r-- 1 web14 client2  29857 Feb  5 04:03 hive-731275a7f5412cd96c97bc59ed241abadee4c5b8.js
-rw-r--r-- 1 web14 client2 113919 Feb  5 04:03 hive-6511f7988a87d2b8d922eb3979c4dbf51dba3b36.js
-rw-r--r-- 1 web14 client2 144825 Feb  5 04:03 hive-3fa751abba49602acd0e17d6f962b5a9d9cb2273.css
-rw-r--r-- 1 web14 client2  74134 Feb  5 03:22 hive-795c67f6ba7d21fe86d971bb181e9c7c4f8912f7.js
-rw-r--r-- 1 web14 client2  74134 Feb  5 02:52 hive-b2f9772db3859ffb066491cf27c2e0ac2c4e96be.js
-rw-r--r-- 1 web14 client2  65254 Feb  5 02:44 hive-f9e55afe2308e18dc3f2243dc9602726f5dbfca0.js
-rw-r--r-- 1 web14 client2  85591 Feb  5 02:42 hive-5b4ebe198091cd525e2d746f735e25821b473677.js
-rw-r--r-- 1 web14 client2  23025 Feb  5 02:16 hive-59058a99f16d84a9ffa095d705598237c93e967a.js
-rw-r--r-- 1 web14 client2  60787 Feb  5 02:15 hive-93423bc224b47f65e9cd31afd6967f08608c56ed.js
-rw-r--r-- 1 web14 client2  18209 Feb  5 02:15 hive-719f9f9e8ce9176b005d4cbe0b6ae6f0eb6acf17.js
-rw-r--r-- 1 web14 client2  92961 Feb  5 02:15 hive-ec2f5f0c9ef28f8bd4f2b081dfe3112568742759.js
-rw-r--r-- 1 web14 client2 143216 Feb  5 02:15 hive-a7658782468ade0fa38672d6f965666286268d38.css
-rw-r--r-- 1 web14 client2 164797 Feb  5 02:15 hive-a5dbaf1d3013f7ba2c45d32a5b9fd74784b6db6d.css
-rw-r--r-- 1 web14 client2    213 Feb  5 02:15 index.php

The forum now referring its css to this default theme cache folder and due to this the earlier problematic behaviors reported, occurred again.

This is a 1.1 RC 1 (development package) run live on https://elkarte11.sch.my. I know this site is testing 1.1 RC 1 but without any minified js and css but if any of you did test this, do share your experience and how to solve this if any.

I have check most the site dispatcher and related sources files but cannot come to any clue on how to fix this. The most I'll do will be re trying the steps I did mention before and cross my fingers again.
Last Edit: February 05, 2017, 02:46:54 am by ahrasis

Re: CSS Problem

Reply #4

I just realized that those are files for file based caching. Silly me.

But I am still wondering how the cache file went to the default theme folder. Will try to resolve this soon.

Re: CSS Problem

Reply #5

Quote from: ahrasis – But I am still wondering how the cache file went to the default theme folder. Will try to resolve this soon.
In 1.1, the hives cache (i.e. the cache of the theme assets) has been moved to the theme's own directory[1], to it's perfectly correct.

The real question is: why do you have hives in the "root" cache directory? Two wild guesses are: 1) because the cache didn't clean up after itself after the upgrade, 2) because the multi-forum addon is still adding something there.

the main reason for separate the two caches is that the "root" cache directory may potentially leak info, for that reason it should stay in a non-web-accessible position, while the themes cache shall stay in a web-accessible location, of course this cannot be achieved if the two type of caches are in the same directory.
The separation, brings also some other advantages, like: 1) be able to invalidate the "php-cache" or a  single theme cache instead of being forced to invalidate the whole lot of php-cache, and all the themes all at once, 2) less files in a single directory, 3) if you are using an accelerator you don't need the "root" cache dire at all, etc.
Bugs creator.
Features destroyer.
Template killer.

Re: CSS Problem

Reply #6

I failed to see how that can cause the css problems after the upgrade as I emptied all the js and css in the cache directory and uninstalled all addons before the upgrade. I could misunderstand the situation though with the new approach 1.1 is using for caching now.

I have deleted my cache in default theme and so far nothing is there. The folder or its content is not recreated until now.

Until it is fixed, I'd prefer it this way (i.e. in root cache folder) because the minified css in default theme is also using ../themes/default resulting errors due to reading /themes/default/themes/default rather than just /themes/default.

Re: CSS Problem

Reply #7

Code: [Select]
	/**
*
* We don't want any fixed url in the combined css
* file(s), we return it back to default i.e. ".."
*
**/

public static function ChangeUrlInHive()
{
global $context, $settings;
$parse = parse_url($settings['default_theme_url']);
foreach ($context['css_files'] as $key => $file) {
$context['css_files'][$key]['options']['url'] = '..' . $parse['path'];
}
}
Maybe?
From http://www.elkarte.net/community/index.php?topic=2162.msg29467#msg29467
Bugs creator.
Features destroyer.
Template killer.

Re: CSS Problem

Reply #8

How can that work when it is already uninstalled, not reinstalled and not even exist as an integration hook?

Re: CSS Problem

Reply #9

So:
https://www.sch.my/ <= works fine and is using the theme-specific directory for hives https://elkarte11.sch.my/themes/default/cache/hive-37f832931b2828a39ae6563e8aca3d11f2a03e51.css?915e3876
https://elkarte11.sch.my/ <= doesn't work as expected, but uses the "root" cache directory for he hives https://elkarte11.sch.my/cache/hive-37f832931b2828a39ae6563e8aca3d11f2a03e51.css?3e5bda8b

The obvious question is: what's the difference between the two installs?
Bugs creator.
Features destroyer.
Template killer.

Re: CSS Problem

Reply #10

For 1.1, https://www.sch.my and https://all.sch.my are the alias domains pointed to https://elkarte11.sch.my. Technically, they both are not working and only shows what https://elkarte11.sch.my is showing in its index page as multi forum addon is not installed. All links will be redirected back to https://elkarte11.sch.my at this stage as $boardurl is https://elkarte11.sch.my. I haven't tested the addon on version 1.1 as I want to make proper backups if all are working correctly before I proceed further with it.

Re: CSS Problem

Reply #11

Now also https://elkarte11.sch.my/ points to the theme cache dir https://elkarte11.sch.my/themes/default/cache/hive-a7658782468ade0fa38672d6f965666286268d38.css?801a911c.
Bugs creator.
Features destroyer.
Template killer.

Re: CSS Problem

Reply #12

That is correct but I am not sure what is its impact now. One thing I am sure is that it is started 2.16am i.e. about 1 1/2 hour ago. Error log is clear so far.

 I guess I just leave these two cache folders as they are?

Re: CSS Problem

Reply #13

Funny.
I was thinking maybe the theme settings cached and not (yet) refreshed, but I don't think any cache hit lasts for so long... oh well, as long as it works, that's all good. :D

Since they are supposed to be there, I would encourage you to leave them where they are. :P
Bugs creator.
Features destroyer.
Template killer.