These are chat archives for allegro/ralph

3rd
Jan 2015
djbdjb00djb
@djbdjb00djb
Jan 03 2015 04:04
I have a issue allegro/ralph#1255
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 10:23
@djbdjb00djb welcome
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 10:39
did you try to run ralph migrate cmdb ?
djbdjb00djb
@djbdjb00djb
Jan 03 2015 10:43
no , I will have a try, this is not in document ?
When run this command ralph migrate cmdb ?
(ralph)ralph@it-ralph01:~$ ralph migrate cmdb
Traceback (most recent call last):
File "/home/ralph/bin/ralph", line 9, in <module>
load_entry_point('ralph==2.1.0', 'console_scripts', 'ralph')()
File "/home/ralph/local/lib/python2.7/site-packages/ralph/main.py", line 56, in main
execute_from_command_line(sys.argv)
File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(args, **options.dict)
File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(
args, options)
File "/home/ralph/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 78, in handle
apps = [Migrations(app)]
File "/home/ralph/local/lib/python2.7/site-packages/south/migration/base.py", line 61, in call
self.instances[applabel] = super(MigrationsMetaclass, self)._call(app_label_to_app_module(app_label),
kwds)
File "/home/ralph/local/lib/python2.7/site-packages/south/migration/utils.py", line 41, in app_label_to_app_module
app = models.get_app(app_label)
File "/home/ralph/local/lib/python2.7/site-packages/django/db/models/loading.py", line 152, in get_app
raise ImproperlyConfigured("App with label %s could not be found" % app_label)
django.core.exceptions.ImproperlyConfigured: App with label cmdb could not be found
djbdjb00djb
@djbdjb00djb
Jan 03 2015 10:49
There have some error when I run the command ralph migrate cmdb.
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 10:53
paste it here
djbdjb00djb
@djbdjb00djb
Jan 03 2015 10:53
``
(ralph)ralph@it-ralph01:~$ ralph migrate cmdb Traceback (most recent call last): File "/home/ralph/bin/ralph", line 9, in <module> load_entry_point('ralph==2.1.0', 'console_scripts', 'ralph')() File "/home/ralph/local/lib/python2.7/site-packages/ralph/main.py", line 56, in main execute_from_command_line(sys.argv) File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line utility.execute() File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(args, **options.dict) File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(args, options) File "/home/ralph/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 78, in handle apps = [Migrations(app)] File "/home/ralph/local/lib/python2.7/site-packages/south/migration/base.py", line 61, in call self.instances[applabel] = super(MigrationsMetaclass, self)._call(app_label_to_app_module(app_label), kwds) File "/home/ralph/local/lib/python2.7/site-packages/south/migration/utils.py", line 41, in app_label_to_app_module app = models.get_app(app_label) File "/home/ralph/local/lib/python2.7/site-packages/django/db/models/loading.py", line 152, in get_app raise ImproperlyConfigured("App with label %s could not be found" % app_label) django.core.exceptions.ImproperlyConfigured: App with label cmdb could not be found
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 10:54
oh, i see
change PLUGGABLE_APPS = ['assets’,] for PLUGGABLE_APPS = ['assets’,’cmdb']
INSTALLED_APPS=[
'ralph.cmdb',
...
...
]
OK, set PLUGGABLE_APPS = ['assets’,’cmdb’] can run command ralph migrate cmdb ;
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:01
but there have new error when run command ``

(ralph)ralph@it-ralph01:~$ ralph migrate ralph_assets
Running migrations for ralph_assets:

  • Migrating forwards to 0017_autodel_assethistorychangedel_licencehistorychange__del_supporthis.

    ralph_assets:0001_initial
    ralph_assets:0002_merge_size_and_uheight

  • Migration 'ralph_assets:0002_merge_size_and_uheight' is marked for no-dry-run.

    ralph_assets:0003_autodel_field_deviceinfo_size
    ralph_assets:0004_auto
    add_field_assetcategory_is_blade
    ralph_assets:0005_autoadd_field_asset_force_deprecation
    ralph_assets:0006_auto
    add_field_asset_production_year
    ralph_assets:0007_deprecation_rate_not_null

  • Migration 'ralph_assets:0007_deprecation_rate_not_null' is marked for no-dry-run.

    ralph_assets:0008_autoadd_field_assetmodel_categoryadd_field_assetmodel_power_consum
    ralph_assets:0009_autoadd_field_assetmodel_cores_countchg_field_assetmodel_height_of
    ralph_assets:0010_autoadd_assetowneradd_licenceadd_softwarecategoryadd_licencety
    ralph_assets:0011_autoadd_field_assetcategory_slug
    ralph_assets:0012_auto
    add_transitionshistoryadd_attachmentadd_coaoemosadd_action
    ralph_assets:0013_auto
    del_unique_assetmodel_name
    FATAL ERROR - The following SQL query failed: DROP INDEX ralph_assets_assetmodel_52094d6e ON ralph_assets_assetmodel
    The error was: (1091, "Can't DROP 'ralph_assets_assetmodel_52094d6e'; check that column/key exists")
    ralph_assets:0014_autoadd_field_licence_remarksadd_field_licence_service_namechg_f
    ralph_assets:0015_auto
    add_supporttypeadd_assetlasthostnameadd_unique_assetlasthost
    ralph_assets:0016_autochg_field_transitionshistory_uidchg_field_transitionshistory_a
    ralph_assets:0017_autodel_assethistorychangedel_licencehistorychange__del_supporthis
    ! Error found during real run of migration! Aborting.

    ! Since you have a database that does not support running
    ! schema-altering statements in transactions, we have had
    ! to leave it in an interim state between migrations.

! You might be able to recover with: = DROP TABLE ralph_assets_history CASCADE; []

  • no dry run output for delete_foreign_key() due to dynamic DDL, sorry
    = ALTER TABLE ralph_assets_asset DROP COLUMN service_id CASCADE; []
  • no dry run output for delete_foreign_key() due to dynamic DDL, sorry
    = ALTER TABLE ralph_assets_asset DROP COLUMN device_environment_id CASCADE; []

    ! The South developers regret this has happened, and would
    ! like to gently persuade you to consider a slightly
    ! easier-to-deal-with DBMS (one that supports DDL transactions)
    ! NOTE: The error which caused the migration to fail is further up.
    Error in migration: ralph_assets:0017_autodel_assethistorychangedel_licencehistorychangedel_supporthis
    Traceback (most recent call last):
    File "/home/ralph/bin/ralph", line 9, in <module>
    load_entry_point('ralph==2.1.0', 'console_scripts', 'ralph')()
    File "/home/ralph/local/lib/python2.7/site-packages/ralph/
    main.py", line 56, in main
    execute_from_command_line(sys.argv)
    File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/
    init.py", line 443, in execute_from_command_line
    utility.execute()
    File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/
    init.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(args, *options.
    dict)
    File "/home/ralph/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(args, *options)
    File "/home/ralph/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 108, in handle
    ignore_ghosts = ignore_ghosts,
    File "/home/ralph/local/lib/python2.7/site-packages/south/migration/
    init.py", line 213, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
    File "/home/ralph/local/lib/python2.7/site-packages/south/migration/migrators.py", line

✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 11:08
@quamilek can you check this ?
or @xliiv ?
i assume you already installed ralph some time ago and now updating to the newer version?
or just starting with ?
from scratch
@djbdjb00djb ?
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:11
Thinks, I will retry a frush install too. but is there have a simple docment can install a full components ralph ?
This error is in a fresh install Ralph 2.1.0 in Ubuntu 14.04.1
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 11:13
i’m trying to reproduce this on my installation...
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:34
Thanks @vi4m , I create a issue for this allegro/ralph#1256 ;
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 11:45
oh i see the problem now
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:45

above the error information, in mysql run under command

mysql> DROP TABLE ralph_assets_history CASCADE;
mysql> ALTER TABLE ralph_assets_asset DROP COLUMN service_id CASCADE;
mysql> ALTER TABLE ralph_assets_asset DROP COLUMN device_environment_id CASCADE;

✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 11:45
it’s the sequence of installation
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:46
it’s can fix

(ralph)ralph@it-ralph01:~$ ralph migrate ralph_assets
Running migrations for ralph_assets:

  • Migrating forwards to 0017_autodel_assethistorychangedel_licencehistorychange__del_supporthis.

    ralph_assets:0017_autodel_assethistorychangedel_licencehistorychange__del_supporthis

     Please manually drop or archive above tables.
    
         ralph_assets_supporthistorychange
         ralph_assets_licencehistorychange
         ralph_assets_assethistorychange
  • Loading initial data for ralph_assets.
    Installed 128 object(s) from 1 fixture(s)

✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 11:46
when you add all modules you want to use to the settings, and initialize database with ralph syncdb —all && ralph migrate —fake it works out of the box
if the db is empty, just drop it and start with these two commands
djbdjb00djb
@djbdjb00djb
Jan 03 2015 11:51
I will have a try PLUGGABLE_APPS = ['assets','cmdb','scrooge’]; initialize database with ralph syncdb —all && ralph migrate —fake it works out of the box
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:07
@vi4m ,I’m a fresh install Ralph 2.1.0 in Ubuntu 14.04.1; PLUGGABLE_APPS = ['assets','cmdb','scrooge’]; initialize database with ralph syncdb --all && ralph migrate --fake, the install have no error. but the web access have a http 500 error;
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:08
well, change in settings DEBUG=True and paste the output here ;-)
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:10
ImportError at /ui/search/
No module named menu
Request Method: GET
Request URL: http://192.168.6.187:8000/ui/search/
Django Version: 1.4.15
Exception Type: ImportError
Exception Value:
No module named menu
Exception Location: /home/ralph/local/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /home/ralph/bin/python
Python Version: 2.7.6
Python Path:
['/home/ralph/bin',
'/home/ralph/lib/python2.7',
'/home/ralph/lib/python2.7/plat-x86_64-linux-gnu',
'/home/ralph/lib/python2.7/lib-tk',
'/home/ralph/lib/python2.7/lib-old',
'/home/ralph/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/home/ralph/local/lib/python2.7/site-packages']
Server time: Sat, 3 Jan 2015 20:10:02 +0800

Environment:

Request Method: GET
Request URL: http://192.168.6.187:8000/ui/search/

Django Version: 1.4.15
Python Version: 2.7.6
Installed Applications:
[u'django.contrib.auth',
u'django.contrib.contenttypes',
u'django.contrib.sessions',
u'django.contrib.sites',
u'django.contrib.messages',
u'django.contrib.staticfiles',
u'django.contrib.admin',
u'django_rq',
u'south',
u'lck.django.common',
u'lck.django.activitylog',
u'lck.django.profile',
u'lck.django.score',
u'lck.django.tags',
u'gunicorn',
u'fugue_icons',
u'bob',
u'tastypie',
u'ralph.account',
u'ralph.business',
u'ralph.discovery',
u'ralph.deployment',
u'ralph.integration',
u'ralph.ui',
u'ralph.dnsedit',
u'ralph.util',
u'ralph.deployment',
u'ralph.scan',
u'ralph.notifications',
u'ajax_select',
u'powerdns',
u'ralph_assets',
u'ralph.cmdb',
u'ralph_pricing']
Installed Middleware:
(u'django.middleware.gzip.GZipMiddleware',
u'django.middleware.common.CommonMiddleware',
u'django.contrib.sessions.middleware.SessionMiddleware',
u'lck.django.common.middleware.TimingMiddleware',
u'django.middleware.locale.LocaleMiddleware',
u'django.middleware.csrf.CsrfViewMiddleware',
u'django.contrib.auth.middleware.AuthenticationMiddleware',
u'django.contrib.messages.middleware.MessageMiddleware',
u'lck.django.activitylog.middleware.ActivityMiddleware',
u'lck.django.common.middleware.ForceLanguageCodeMiddleware')

Traceback:
File "/home/ralph/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, callback_args, *callback_kwargs)
    File "/home/ralph/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  2. return view_func(request, args, *kwargs)
    File "/home/ralph/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
  3. return self.dispatch(request, args, *kwargs)
    File "/home/ralph/local/lib/python2.7/site-packages/ralph/ui/views/common.py" in dispatch
  4. '.'.join([app.module_name, 'menu'])
    File "/home/ralph/local/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  5. import(name)

Exception Type: ImportError at /ui/search/
Exception Value: No module named menu

✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:12
i didn’t try it with the scrooge app - clean installation with assets + cmdb worked fine
maybe for sake of tests temporary disable scrooge app in settings, and try to log in again
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:14
Thanks @vi4m , but want you have a test for scrooge app
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:14
ok, let’s see ..
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:15
sake of tests temporary disable scrooge app in settings have the same error, I will try a fresh install Ralph 2.1.0 in Ubuntu 14.04.1
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:34
i would recommend you the docker way if you want to quickly start with the best settings
it is way easier
just install lxc-docker package to the ubuntu
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:37
thinks @vi4m , I will try use docker , but docker just for test env for now in my comany
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:54
it took me 5 minutes to run it completely using docker ;-)
Zrzut ekranu 2015-01-03 o 13.54.27.png
djbdjb00djb
@djbdjb00djb
Jan 03 2015 12:55
by the way, docker has APPS = ['assets','cmdb','scrooge’] ?
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 12:56
yes, all the apps builtin
djbdjb00djb
@djbdjb00djb
Jan 03 2015 13:08
@vi4m ,Is the docker ralph read for production deploy? how to integration redis ?
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 13:19
i would say, it’s good to test if ralph meets your requirements, it has all production features like integrated redis
docker runs supervisord which brings all services up & running(mysqld, redis, rqworkers), but you could point to another mysql or redis instance in settings if you want to go to production
djbdjb00djb
@djbdjb00djb
Jan 03 2015 13:21
Thinks @vi4m , I will test that .
✪ vi4m Marcin Kliks
@vi4m
Jan 03 2015 13:24
our internal test instance is built on docker, so it could be more integrated than manual installation