[launch instance] new launch instance doesn't honor webroot setting

Bug #1451681 reported by Matthias Runge
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Unassigned

Bug Description

I moved my dashboard to /dashboard (webroot setting in local_settings)

With new launch instance: hitting "launch instance", screen stays white,
firebug reports:
"NetworkError: 404 Not Found - http://..../static/angular/wizard/wizard.html"

Note there is "/dashboard" in front of "/static" missing.

Matthias Runge (mrunge)
Changed in horizon:
importance: Undecided → High
milestone: none → liberty-1
Matthias Runge (mrunge)
summary: - new launch instance doesn't honor webroot setting
+ [launch instance] new launch instance doesn't honor webroot setting
description: updated
tags: added: kilo-backport-potential
Revision history for this message
Matthias Runge (mrunge) wrote :

after changing
horizon/static/angular:

basePath constant to:

.constant('basePath', '../../static/angular/');

I'm getting a page with lots(!) of errors "Unable to fetch service catalog"

This is due to get requests are fired up against http://localhost/api/... instead of http://localhost/dashboard/api/...

Revision history for this message
Matt Borland (palecrow) wrote :

Looks like we'd need to properly add the basePath injectable also into the horizon/static/horizon/js/angular/services/hz.api.service.js httpCall() method when it actually makes the GET.

Changed in horizon:
assignee: nobody → Matt Borland (palecrow)
Revision history for this message
Matt Borland (palecrow) wrote :

s/basePath/webroot/ in previous post...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/181095

Changed in horizon:
status: New → In Progress
Revision history for this message
Matt Borland (palecrow) wrote :

Note, openstack_dashboard/static/dashboard/scss/_variables.scss apparently needs individual configuration of a local $webroot variable.

Revision history for this message
Matt Borland (palecrow) wrote :

Additional notes: right now the /api services presented don't seem to change as the WEBROOT changes. I imagine this is part of the problem, but am not sure about the appropriate solution--I think they should change with WEBROOT, but what do others think?

Revision history for this message
Matthias Runge (mrunge) wrote :

Matt, I think api services need to be accessed via /dashboard/api as well.

Changed in horizon:
assignee: Matt Borland (palecrow) → Shaoquan Chen (sean-chen2)
Changed in horizon:
milestone: liberty-1 → liberty-2
Changed in horizon:
assignee: Shaoquan Chen (sean-chen2) → Matt Borland (palecrow)
Changed in horizon:
assignee: Matt Borland (palecrow) → Thai Tran (tqtran)
Changed in horizon:
assignee: Thai Tran (tqtran) → Shaoquan Chen (sean-chen2)
Changed in horizon:
assignee: Shaoquan Chen (sean-chen2) → Thai Tran (tqtran)
Changed in horizon:
assignee: Thai Tran (tqtran) → Shaoquan Chen (sean-chen2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/181095
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=35e47358f0e3567b91da1116120c3c9fd97d8e6c
Submitter: Jenkins
Branch: master

commit 35e47358f0e3567b91da1116120c3c9fd97d8e6c
Author: Thai Tran <email address hidden>
Date: Tue Jul 21 10:45:40 2015 -0700

    Fix bug where WEBROOT is not respected

    The WEB_ROOT setting needs to be respected rather than assuming / as
    the root of the application. Simiarly, we can not assume that STATIC_URL
    is a sub url of the WEB_ROOT. They can be configured as two indepedent url.

    Angular templates are loaded dynamically with Ajax, which requires an
    absolute base path. We define those base paths as angular constants for
    template use and future routing.

    TO TEST, follow directions at:
      http://docs.openstack.org/developer/horizon/topics/settings.html#webroot

    Co-Authored-By: Matt Borland <email address hidden>
    Co-Authored-By: Shaoquan Chen <email address hidden>
    Co-Authored-By: Thai Tran <email address hidden>

    Change-Id: Ifcd459633682edc94b270019ce77e17d64bea22d
    Closes-Bug: #1451681

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
Paul Karikh (pkarikh) wrote :

Are we going to backport it to Kilo? Is there some conclusion about it?

Revision history for this message
Travis Tripp (travis-tripp) wrote :

Paul,

I think it is a good idea to do this for Kilo. We can't directly backport to Kilo, though. It would need to have a patch just for Kilo You could certainly propose a patch for the Kilo branch, but I think we need some advice from David Lyle on the proper process for non-direct (can't just cherry pick) backports.

Revision history for this message
Paul Karikh (pkarikh) wrote :

Yes, I agree that we need to backport it, since we have bugs for kilo about it.
For example:
https://bugs.launchpad.net/horizon/+bug/1476439

Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-2 → 8.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (stable/kilo)

Reviewed: https://review.openstack.org/209108
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a903c420e53ece9bf358ee149f449322709741e0
Submitter: Jenkins
Branch: stable/kilo

commit a903c420e53ece9bf358ee149f449322709741e0
Author: Timur Sufiev <email address hidden>
Date: Mon Aug 31 18:46:05 2015 +0300

    Backport the WEBROOT fixes for JS and CSS into Kilo

    This commit includes changes relevant to commits
    https://review.openstack.org/181095 and
    https://review.openstack.org/#/c/201769/. But rather than precisely
    backporting the above commits (which is impossible due to different
    code structure), a 'symptomatic treatment' approach is used: we fix
    every problem which is related to being ignorant to WEBROOT setting in
    Kilo. Among the places being fixed are:

    * edit metadata widget
    * launch instance NG (both templates and service calls).

    Closes-Bug: #1476439
    Related-Bug: #1451681
    Change-Id: I2f5a6189393977c4a4cfccb5f3c771afab21d92c

tags: added: in-stable-kilo
Changed in horizon:
assignee: Shaoquan Chen (sean-chen2) → nobody
no longer affects: horizon/kilo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.