Public bug reported:

Hi community,

(fix proposed in the attachment)
When running Horizon in the Django dev. server, Django complains that fonts 
awesome are not found:

$ python manage.py runserver 0.0.0.0:8888
Performing system checks...

System check identified no issues (0 silenced).
January 30, 2016 - 07:39:54
Django version 1.8.8, using settings 'openstack_dashboard.settings'
Starting development server at http://0.0.0.0:8888/
Quit the server with CONTROL-C.
[30/Jan/2016 07:40:06] "GET / HTTP/1.1" 302 0
[30/Jan/2016 07:40:22] "GET /auth/login/?next=/ HTTP/1.1" 200 7332
[30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 200 
2372
[30/Jan/2016 07:40:22] "GET /static/dashboard/js/7fd3f7d69c71.js HTTP/1.1" 200 
503331
[30/Jan/2016 07:40:22] "GET /static/dashboard/css/3b4554bd78f3.css HTTP/1.1" 
200 19167
[30/Jan/2016 07:40:22] "GET /static/dashboard/css/54ae9d01741d.css HTTP/1.1" 
200 966770
[30/Jan/2016 07:40:22] "GET /static/dashboard/js/563ea7fdfcde.js HTTP/1.1" 200 
1144991
[30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 200 
2372
Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2
[30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2?v=4.3.0
 HTTP/1.1" 404 4558
Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
[30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff?v=4.3.0
 HTTP/1.1" 404 4555
Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
[30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf?v=4.3.0
 HTTP/1.1" 404 4552
...

Horizon is installed via devstack.
I don't define WEBROOT, STATIC_URL in local_settings.py, and STATIC_URL default 
to '/static/' in settings.py.

======================
My analysis and guesses
======================

>From 
>https://github.com/openstack/horizon/blob/master/openstack_dashboard/themes/webroot/_variables.scss
> :
/* This variable changes the web root of horizon to /dashboard rather
than the default '/' */
$static_url: "/dashboard/static/";
Here $static_url is hard-coded to "/dashboard/static/", which is OK for Apache 
wsgi server. Yet it shall be "/static/" for Django dev. server.

And path for fonts awesome is thus determined (incorrectly for Django dev. 
server) in
https://github.com/openstack/horizon/blob/master/openstack_dashboard/static/dashboard/scss/_variables.scss#L62
 :

$fa-font-path: $static_url + "horizon/lib/font-awesome/fonts";

========
Solution
========
Removing the hard-coding solves the problem in my environment:

diff --git a/openstack_dashboard/themes/webroot/_variables.scss 
b/openstack_dashboard/themes/webroot/_variables.scss
index e4edb91..04353b3 100644
--- a/openstack_dashboard/themes/webroot/_variables.scss
+++ b/openstack_dashboard/themes/webroot/_variables.scss
@@ -1,5 +1 @@
-/* This variable changes the web root of horizon to /dashboard rather
-than the default '/' */
-$static_url: "/dashboard/static/";
-
-@import "../themes/default/variables";
\ No newline at end of file
+@import "../themes/default/variables";

The idea is that, now that we have $static_url determined from
settings.py (see
https://github.com/openstack/horizon/blob/master/horizon/utils/scss_filter.py#L33
), we shall not hard-code the path any more.

If my guess is correct, I'd like to propose the patch above. Correct me
if I'm missing something. :)

Thanks for your time.

** Affects: horizon
     Importance: Undecided
         Status: New


** Tags: 404 awesome fonts

** Patch added: "proposed fix"
   
https://bugs.launchpad.net/bugs/1539871/+attachment/4559715/+files/remove-hard-encode-for-static_url.patch

** Description changed:

  Hi community,
  
  (fix proposed in the attachment)
  When running Horizon in the Django dev. server, Django complains that fonts 
awesome are not found:
  
  $ python manage.py runserver 0.0.0.0:8888
  Performing system checks...
  
  System check identified no issues (0 silenced).
  January 30, 2016 - 07:39:54
  Django version 1.8.8, using settings 'openstack_dashboard.settings'
  Starting development server at http://0.0.0.0:8888/
  Quit the server with CONTROL-C.
  [30/Jan/2016 07:40:06] "GET / HTTP/1.1" 302 0
  [30/Jan/2016 07:40:22] "GET /auth/login/?next=/ HTTP/1.1" 200 7332
  [30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 
200 2372
  [30/Jan/2016 07:40:22] "GET /static/dashboard/js/7fd3f7d69c71.js HTTP/1.1" 
200 503331
  [30/Jan/2016 07:40:22] "GET /static/dashboard/css/3b4554bd78f3.css HTTP/1.1" 
200 19167
  [30/Jan/2016 07:40:22] "GET /static/dashboard/css/54ae9d01741d.css HTTP/1.1" 
200 966770
  [30/Jan/2016 07:40:22] "GET /static/dashboard/js/563ea7fdfcde.js HTTP/1.1" 
200 1144991
  [30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 
200 2372
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2?v=4.3.0
 HTTP/1.1" 404 4558
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff?v=4.3.0
 HTTP/1.1" 404 4555
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf?v=4.3.0
 HTTP/1.1" 404 4552
  ...
  
  Horizon is installed via devstack.
- I don't define WEBROOT, STATIC_ROOT in local_settings.py, and STATIC_ROOT 
default to '/static/' in settings.py.
+ I don't define WEBROOT, STATIC_URL in local_settings.py, and STATIC_URL 
default to '/static/' in settings.py.
  
  ======================
  My analysis and guesses
  ======================
  
  From 
https://github.com/openstack/horizon/blob/master/openstack_dashboard/themes/webroot/_variables.scss
 :
  /* This variable changes the web root of horizon to /dashboard rather
  than the default '/' */
  $static_url: "/dashboard/static/";
  Here $static_url is hard-coded to "/dashboard/static/", which is OK for 
Apache wsgi server. Yet it shall be "/static/" for Django dev. server.
  
  And path for fonts awesome is thus determined (incorrectly for Django dev. 
server) in
  
https://github.com/openstack/horizon/blob/master/openstack_dashboard/static/dashboard/scss/_variables.scss#L62
 :
  
  $fa-font-path: $static_url + "horizon/lib/font-awesome/fonts";
  
  ========
  Solution
  ========
  Removing the hard-coding solves the problem in my environment:
  
  diff --git a/openstack_dashboard/themes/webroot/_variables.scss 
b/openstack_dashboard/themes/webroot/_variables.scss
  index e4edb91..04353b3 100644
  --- a/openstack_dashboard/themes/webroot/_variables.scss
  +++ b/openstack_dashboard/themes/webroot/_variables.scss
  @@ -1,5 +1 @@
  -/* This variable changes the web root of horizon to /dashboard rather
  -than the default '/' */
  -$static_url: "/dashboard/static/";
  -
  -@import "../themes/default/variables";
  \ No newline at end of file
  +@import "../themes/default/variables";
  
  The idea is that, now that we have $static_url determined from
  settings.py (see
  
https://github.com/openstack/horizon/blob/master/horizon/utils/scss_filter.py#L33
  ), we shall not hard-code the path any more.
  
  If my guess is correct, I'd like to propose the patch above. Correct me
  if I'm missing something. :)
  
  Thanks for your time.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1539871

Title:
  awesome fonts not found while in Django dev. server

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Hi community,

  (fix proposed in the attachment)
  When running Horizon in the Django dev. server, Django complains that fonts 
awesome are not found:

  $ python manage.py runserver 0.0.0.0:8888
  Performing system checks...

  System check identified no issues (0 silenced).
  January 30, 2016 - 07:39:54
  Django version 1.8.8, using settings 'openstack_dashboard.settings'
  Starting development server at http://0.0.0.0:8888/
  Quit the server with CONTROL-C.
  [30/Jan/2016 07:40:06] "GET / HTTP/1.1" 302 0
  [30/Jan/2016 07:40:22] "GET /auth/login/?next=/ HTTP/1.1" 200 7332
  [30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 
200 2372
  [30/Jan/2016 07:40:22] "GET /static/dashboard/js/7fd3f7d69c71.js HTTP/1.1" 
200 503331
  [30/Jan/2016 07:40:22] "GET /static/dashboard/css/3b4554bd78f3.css HTTP/1.1" 
200 19167
  [30/Jan/2016 07:40:22] "GET /static/dashboard/css/54ae9d01741d.css HTTP/1.1" 
200 966770
  [30/Jan/2016 07:40:22] "GET /static/dashboard/js/563ea7fdfcde.js HTTP/1.1" 
200 1144991
  [30/Jan/2016 07:40:22] "GET /i18n/js/horizon+openstack_dashboard/ HTTP/1.1" 
200 2372
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff2?v=4.3.0
 HTTP/1.1" 404 4558
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.woff?v=4.3.0
 HTTP/1.1" 404 4555
  Not Found: 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf
  [30/Jan/2016 07:40:23] "GET 
/dashboard/static/horizon/lib/font-awesome/fonts/fontawesome-webfont.ttf?v=4.3.0
 HTTP/1.1" 404 4552
  ...

  Horizon is installed via devstack.
  I don't define WEBROOT, STATIC_URL in local_settings.py, and STATIC_URL 
default to '/static/' in settings.py.

  ======================
  My analysis and guesses
  ======================

  From 
https://github.com/openstack/horizon/blob/master/openstack_dashboard/themes/webroot/_variables.scss
 :
  /* This variable changes the web root of horizon to /dashboard rather
  than the default '/' */
  $static_url: "/dashboard/static/";
  Here $static_url is hard-coded to "/dashboard/static/", which is OK for 
Apache wsgi server. Yet it shall be "/static/" for Django dev. server.

  And path for fonts awesome is thus determined (incorrectly for Django dev. 
server) in
  
https://github.com/openstack/horizon/blob/master/openstack_dashboard/static/dashboard/scss/_variables.scss#L62
 :

  $fa-font-path: $static_url + "horizon/lib/font-awesome/fonts";

  ========
  Solution
  ========
  Removing the hard-coding solves the problem in my environment:

  diff --git a/openstack_dashboard/themes/webroot/_variables.scss 
b/openstack_dashboard/themes/webroot/_variables.scss
  index e4edb91..04353b3 100644
  --- a/openstack_dashboard/themes/webroot/_variables.scss
  +++ b/openstack_dashboard/themes/webroot/_variables.scss
  @@ -1,5 +1 @@
  -/* This variable changes the web root of horizon to /dashboard rather
  -than the default '/' */
  -$static_url: "/dashboard/static/";
  -
  -@import "../themes/default/variables";
  \ No newline at end of file
  +@import "../themes/default/variables";

  The idea is that, now that we have $static_url determined from
  settings.py (see
  
https://github.com/openstack/horizon/blob/master/horizon/utils/scss_filter.py#L33
  ), we shall not hard-code the path any more.

  If my guess is correct, I'd like to propose the patch above. Correct
  me if I'm missing something. :)

  Thanks for your time.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1539871/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to