GET /static returns 404 [ 0.11.0 rc1]

168 views
Skip to first unread message

Anatoliy Dmytriyev

unread,
Mar 6, 2015, 10:19:45 AM3/6/15
to ganeti...@googlegroups.com
Hello,


Something wrong with static files after installation of 0.11.0 rc1. I followed the manual with config.yml file from the example section but

/opt/ganeti_webmgr# django-admin.py runserver
Validating models...

Loading Muddle Shots
0 errors found
Django version 1.4.19, using settings 'ganeti_webmgr.ganeti_web.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[06/Mar/2015 07:11:08] "GET / HTTP/1.1" 302 0
[06/Mar/2015 07:11:10] "GET /accounts/login/?next=/ HTTP/1.1" 200 2914
[06/Mar/2015 07:11:10] "GET /static/css/base.css HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/css/registration.css HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/js/jquery.js HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/js/L18N.js HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/logo.png HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/js/L18N.js HTTP/1.1" 404 2273
[06/Mar/2015 07:11:10] "GET /static/css/registration.css HTTP/1.1" 404 2273
[06/Mar/2015 07:11:11] "GET /static/logo.png HTTP/1.1" 404 2273

And I can't see pictures there and the interface is very ugly :) Do you have any ideas what is wrong?

Below is my config.yml file:
# config.yml

# Django settings for ganeti_webmgr project.

##### Database Configuration #####
DATABASES:
    default:
        ENGINE: django.db.backends.sqlite3
                    # django.db.backends.sqlite3
                    # django.db.backends.postgresql
                    # django.db.backends.mysql
                    # django.db.backends.oracle
                    # django.db.backends.postgresql_psycopg2

        # Or path to database file if using sqlite3.
        NAME: /opt/ganeti_webmgr/ganeti.db
        USER:      # Not used with sqlite3.
        PASSWORD:  # Not used with sqlite3.
        HOST:      # Set to empty string for localhost.
                         # Not used with sqlite3.
        PORT:      # Set to empty string for default.
                         #Not used with sqlite3.
##### End Database Configuration #####

# Site name and domain referenced by some modules to provide links back to
#  the site.
SITE_NAME: Ganeti Web Manager
SITE_DOMAIN: "localhost:8000"

# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
TIME_ZONE: America/Los_Angeles
DATE_FORMAT: d/m/Y
DATETIME_FORMAT: "d/m/Y H:i"
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE: "en-US"
##### End Locale Configuration #####

# Enable i18n (translations) and l10n (locales, currency, times).
# You really have no good reason to disable these unless you are only
# going to be using GWM in English.
USE_I18N: True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N: True

# prefix used for the site.  ie. http://myhost.com/<SITE_ROOT>
# for the django standalone server this should be
# for apache this is the url the site is mapped to, probably /tracker
SITE_ROOT: ""

# Absolute path to the directory that holds media.
# Example: /home/media/media.lawrence.com/
STATIC_ROOT: /opt/ganeti_webmgr/collected_static

# URL that handles the media served from STATIC_ROOT.
# XXX contrary to django docs, do not use a trailing slash.  It makes urls
# using this url easier to read.  ie.  {{STATIC_URL}}/images/foo.png
STATIC_URL: /static

##### Registration Settings #####
ACCOUNT_ACTIVATION_DAYS: 7

# Email settings for registration
# Email settings for registration
EMAIL_HOST: localhost
EMAIL_PORT: 25
DEFAULT_FROM_EMAIL: nor...@example.org

# Whether users should be able to create their own accounts.
# False if accounts can only be created by admins.
ALLOW_OPEN_REGISTRATION: True
##### End Registration Settings #####

####### Haystack Search Index settings #######
HAYSTACK_WHOOSH_PATH: /opt/ganeti_webmgr/whoosh_index
####### End Haystack Search Index settings #######


# GWM Specifics

# The maximum number of items on a single list page
ITEMS_PER_PAGE: 15

# Ganeti Cached Cluster Objects Timeouts
#    LAZY_CACHE_REFRESH (milliseconds) is the fallback cache timer that is
#    checked when the object is instantiated. It defaults to 600000ms, or ten
#    minutes.
LAZY_CACHE_REFRESH: 600000

# VNC Proxy. This will use a proxy to create local ports that are forwarded to
# the virtual machines.  It allows you to control access to the VNC servers.
#
# Expected values:
#   String syntax: HOST:CONTROL_PORT, for example: localhost:8888. If
#   localhost is used then the proxy will only be accessible to clients and
#   browsers on localhost. Production servers should use a publicly accessible
#   hostname or IP
#
# Firewall Rules:
#   Control Port: 8888, must be open between Ganeti Web Manager and Proxy
#   Internal Ports: 12000+ must be open between the Proxy and Ganeti Nodes
#   External Ports: default is 7000-8000, must be open between Proxy and Client
#   Flash Policy Server: 843, must open between Proxy and Clients
VNC_PROXY: "localhost:8888"

# This is how long gwm will wait before timing out when requesting data from the
# ganeti cluster.
RAPI_CONNECT_TIMEOUT: 3



WEB_MGR_API_KEY: xxx
SECRET_KEY: xxx

tsc...@osuosl.org

unread,
Mar 6, 2015, 4:18:29 PM3/6/15
to ganeti...@googlegroups.com
Hi Anatoliy,

Have you run the collectstatic command?

# django-admin.py collectstatic

(http://ganeti-webmgr.readthedocs.org/en/develop/getting_started/configuring.html#site-root-and-static-files)

If you have and it doesn't fix your issue, what's in /opt/ganeti_webmgr/collected_static?

Anatoliy Dmytriyev

unread,
Mar 6, 2015, 4:36:30 PM3/6/15
to ganeti...@googlegroups.com
Hello,

Yes, I have it:
/opt/ganeti_webmgr# ls -l collected_static/
total 32
drwxr-xr-x 4 root root 4096 Mar  6 22:31 css
drwxr-xr-x 3 root root 4096 Mar  6 22:31 django_tables2
-rwxr-xr-x 1 root root 3310 Mar  6 22:31 favicon.ico
drwxr-xr-x 4 root root 4096 Mar  6 22:31 images
drwxr-xr-x 3 root root 4096 Mar  6 22:31 js
-rwxr-xr-x 1 root root 6464 Mar  6 22:31 logo.png
drwxr-xr-x 8 root root 4096 Mar  6 22:31 novnc

and all HTTP404 files are there

Anatoliy Dmytriyev

unread,
Mar 11, 2015, 3:49:14 AM3/11/15
to ganeti...@googlegroups.com
up :)

Any ideas?

Evan Tschuy

unread,
Mar 12, 2015, 2:59:24 PM3/12/15
to ganeti...@googlegroups.com
I've been thinking off on an on about this. Nothing has come to mind
yet, and your config appears to mirror the staging settings here
pretty much exactly. I set up an ssh tunnel to staging and tried
accessing it, and everything worked fine.

What OS are you running this on?
> --
> You received this message because you are subscribed to the Google Groups
> "ganeti-webmgr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ganeti-webmg...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages