These are chat archives for allegro/ralph

29th
Apr 2015
Linux-Dream
@Linux-Dream
Apr 29 2015 08:56
how to add asset on page assets/dc/add/device/ , when i enter this page , i don't know what exact "Model" field is? i try to use model name which is added in django admin mode, but the page return and said "This field is required."
so, i am really need help, than u to help me.
damian1976
@damian1976
Apr 29 2015 09:03
Hi, this is Damian (other ralph user). If a model was added using admin/ralph_assets/assetmodel/ it must be accessible in the Model field when adding an asset
Linux-Dream
@Linux-Dream
Apr 29 2015 09:09
i know, if i add asset in django admin mode, which i can choose 'model' under select control..
and then i can edit this asset.
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 09:12
@Linux-Dream refresh page after adding model, and select from list
maybe after adding it was not refreshed
Linux-Dream
@Linux-Dream
Apr 29 2015 09:13
in short, i can use 'model' when i add asset in django admin mode, but can't add in user mode. the 'Model' input control doesn't have any prompt
damian1976
@damian1976
Apr 29 2015 09:15
Hmm. When you type a(ny) letter, the list with available models should appear
Linux-Dream
@Linux-Dream
Apr 29 2015 09:15
i have already refreshed the page “assets/dc/add/device/” many times。
the ‘Region‘ and ‘Server Room’ and others i can choose
but can‘t choose ‘Model’ ‘WareHouse’
i compile the ralph project from source code..
damian1976
@damian1976
Apr 29 2015 09:18
ok. could you provide a screenshot from adding a model in admin?
Mateusz Kurek
@mkurek
Apr 29 2015 09:18
first of all what type does your model have (in admin)? It has to be 'data center' for dc assets. Second of all: do you have any JavaScript errors in browser console?
Linux-Dream
@Linux-Dream
Apr 29 2015 09:18
ralph ralph_assets ralph_pricing and other source code from github,i clone it on my machine and compile it
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
Uncaught TypeError: $text.autocomplete is not a function
i find these messages on chrome console.
Linux-Dream
@Linux-Dream
Apr 29 2015 09:24
both "data center " and "back office " i add in django admin mode.
damian1976
@damian1976
Apr 29 2015 09:26
When do you get the first error (Failed to execute ...) When adding a model in admin?
Mateusz Kurek
@mkurek
Apr 29 2015 09:39
@Linux-Dream what branch do you use?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:00
i use the latest version 2.3.1
Mateusz Kurek
@mkurek
Apr 29 2015 10:01
ok - could you run ralph collectstatic?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:01
i get the error when i enter the page "assets/dc/add/device/"
i have run it.
git clone https://github.com/allegro/ralph.git
cd ralph
python2.7 setup.py build
python2.7 setup.py install
git clone https://github.com/allegro/django-bob
cd django-bob
python2.7 setup.py build
python2.7 setup.py install
git clone https://github.com/allegro/ralph_pricing
cd ralph_pricing
python2.7 setup.py build
python2.7 setup.py install
then do command init.
ralph makeconf
ralph syncdb –all
ralph migrate –fake
ralph collectstatic
ralph run_gunicorn localhost:8000 –debug
Mateusz Kurek
@mkurek
Apr 29 2015 10:03
ok - could you provide some traceback for this error?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:05
no error found in runtime.log
Mateusz Kurek
@mkurek
Apr 29 2015 10:06
i mean javascript error in browser console (Failed to execute 'write'...)
Linux-Dream
@Linux-Dream
Apr 29 2015 10:06
my error is than 'Model' field i cant use in page "localhost:8000/assets/dc/add/device/" which i add in admin mode
Mateusz Kurek
@mkurek
Apr 29 2015 10:07
i know - it's caused by some weird javascript error (autocomplete fields are not working) - but we need more details to reproduce and fix it - javascript traceback from this error will be great
Linux-Dream
@Linux-Dream
Apr 29 2015 10:07
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
ajax_select.js:10 Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
ajax_select.js:86 Uncaught TypeError: $text.autocomplete is not a function
Mateusz Kurek
@mkurek
Apr 29 2015 10:07
thanks
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 10:08
@mkurek the order of installation from develop is right?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:09
my installation has problem on ajax_select, when i logined, return 500 error, i find error in runtime.log
the ajax_select .css can not found. i fixed this problem by do this action:
pip2.7 uninstall bob-ajax-selects
pip2.7 install bob-ajax-selects
ralph collectstatic
and this js error is in js file: ajax_select.js:9
flashput
@flashput
Apr 29 2015 10:12
you should run ralph in python-virtual-environment
Linux-Dream
@Linux-Dream
Apr 29 2015 10:12
maybe some ralationship between my installation and the 'Model' not prompt error
before do ralph collectstatic , i delete all static files in ~/.ralph/shared/statics
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 10:14
@Linux-Dream these are build scripts https://github.com/allegro/ralph-docker just take a look how we build everything from scratch
Linux-Dream
@Linux-Dream
Apr 29 2015 10:17
i want to build from docker, but my boss want be to build from source file.
Mateusz Kurek
@mkurek
Apr 29 2015 10:17
@Linux-Dream and please send ouput from pip freeze | grep 'bob\|ralph'
Linux-Dream
@Linux-Dream
Apr 29 2015 10:17
and want me to learn ralph well and make contribute to this open project
[root@centos7 ~]# pip2.7 freeze | grep 'bob|ralph'
bob-ajax-selects==1.6
django-bob==1.11.0
ralph==2.3.0
ralph-assets==2.5.0
ralph-scrooge==3.0.0
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 10:20
@Linux-Dream we have also vagrant development environment if you like, we're using it for development
Linux-Dream
@Linux-Dream
Apr 29 2015 10:23
the error details is "asynchronously-loaded external script"
flashput
@flashput
Apr 29 2015 10:23
@Linux-Dream , install and run ralph in python-virtual-env. follow the advanced installation manual. It’s quite important to do so.
Linux-Dream
@Linux-Dream
Apr 29 2015 10:24
maybe safety reasions.
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 10:25
gunicorn --debug what does?
what url do you point to?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:26
$text.autocomplete(options);
debug has no output
Mateusz Kurek
@mkurek
Apr 29 2015 10:26
@Linux-Dream when did you install it? we've released new version few days ago (ralph 2.3.1, assets 2.5.1, django-bob 1.11.0 and bob-ajax-selects 1.6.1) and this bug may be fixed in this versions
Linux-Dream
@Linux-Dream
Apr 29 2015 10:26
bob-ajax-selects==1.6
django-bob==1.11.0
ralph==2.3.0
ralph-assets==2.5.0
ralph-scrooge==3.0.0
"$text.autocomplete(options);" this function does'not exist
Mateusz Kurek
@mkurek
Apr 29 2015 10:27
*django-bob 1.12.0
Linux-Dream
@Linux-Dream
Apr 29 2015 10:28
if(typeof jQuery == 'undefined' || (typeof jQuery.ui == 'undefined')) {
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"><\/script>');
document.write('<link type="text/css" rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css" />');
}
Mateusz Kurek
@mkurek
Apr 29 2015 10:29
and where do you find this js (file and line number)?
Linux-Dream
@Linux-Dream
Apr 29 2015 10:30
i can add supports, but i can't add asset and licences beacause of ajax complete function.
ajax_select.js:9
ajax_select.js:10
ajax_select.js:86
error in line 9 is "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."
error in line 10 is "Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."
error in line 86 is: "Uncaught TypeError: $text.autocomplete is not a function"
Mateusz Kurek
@mkurek
Apr 29 2015 10:39
you have some old version of bob-ajax-select - as i said last week we've released new version of all ralph packages (including django-bob and bob-ajax-select). For packages installed from git pull new changes and install it again, for packages installed from pip (maybe not-directly) run pip install -U <package-name>
(installing new version from git should fix pip packages as well)
at the end run ralph migrate and ralph collectstatic
when you finish please send again output from pip freeze | grep 'bob\|ralph'
Linux-Dream
@Linux-Dream
Apr 29 2015 10:48
i updated the django-bob and bob-selects
but django version also changed.
execute command ,throw error: Requirement.parse('django==1.4.17')
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 10:49
downgrade django then. pip install -U is fucking broken sometimes.
pip install django==1.4.17
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 11:17
@Linux-Dream did it work?
Linux-Dream
@Linux-Dream
Apr 29 2015 11:35
sorry, dinner time, i try it now.
Linux-Dream
@Linux-Dream
Apr 29 2015 12:15
ip update the ralph from source file, do ralph migrate, generate error: Error in migration: ralph_scrooge:0021_warehouses_to_datacenters

ralph_scrooge:0021_warehouses_to_datacenters

  • Migration 'ralph_scrooge:0021_warehouses_to_datacenters' is marked for no-dry-run.
    ! 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: (migration cannot be dry-run; cannot discover commands)
! 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_scrooge:0021_warehouses_to_datacenters
Traceback (most recent call last):
File "/usr/bin/ralph", line 9, in <module>
load_entry_point('ralph==2.3.1', 'console_scripts', 'ralph')()
File "/usr/lib/python2.7/site-packages/ralph-2.3.1-py2.7.egg/ralph/main.py", line 56, in main
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(args, **options.dict)
File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(
args, options)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/management/commands/migrate.py";, line 108, in handle
ignore_ghosts = ignore_ghosts,
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/init.py", line 213, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 235, in migrate_many
result = migrator.class.migrate_many(migrator, target, migrations, database)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 310, in migrate_many
result = self.migrate(migration, database)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 133, in migrate
result = self.run(migration)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 107, in run
return self.run_migration(migration)
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 81, in run_migration
migration_function()
File "/usr/lib/python2.7/site-packages/South-0.7.6-py2.7.egg/south/migration/migrators.py";, line 57, in <lambda>
return (lambda: direction(orm))
File "/usr/lib/python2.7/site-packages/ralph_scrooge-3.0.1-py2.7.egg/ralph_scrooge/migrations/0021_warehouses_to_datacenters.py", line 59, in forwards
name__exact='Default',
File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args,
kwargs)
File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 366, in get
% self.model._meta.object_name)

ralph_scrooge.models.DoesNotExist: Warehouse matching query does not exist.
Mateusz Kurek
@mkurek
Apr 29 2015 12:19
thats weird - it looks like you didn't install scrooge fixtures before (Warehouse 'Default' should be added automatically)
Linux-Dream
@Linux-Dream
Apr 29 2015 12:23
i just git clone all the code..and i found that you just update these projects
i git clone these code from github: django-bob ralph ralph_assets ralph_pricing
may be version problem? when you updating projects, i download them.
Mateusz Kurek
@mkurek
Apr 29 2015 12:31
consider cloning from git bob-ajax-selects too (https://github.com/quamilek/bob-ajax-selects) - and then install all of these packages from current develop
Linux-Dream
@Linux-Dream
Apr 29 2015 12:31
thank u , i am trying!
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 12:32
@mkurek i think subrepos should help here
in ralph core make directory dependencies/ with git subrepositories
and then just git pull --recursive will do the job
Mateusz Kurek
@mkurek
Apr 29 2015 12:33
@ar4s proposed new repo with all these dependencies
Linux-Dream
@Linux-Dream
Apr 29 2015 12:50
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;
why do u fixed this problem in source code...
every time i need do it in mysql command.
Mateusz Kurek
@mkurek
Apr 29 2015 12:54
@Linux-Dream could you provide more info about this problem? we never had to execute such mysql commands
Linux-Dream
@Linux-Dream
Apr 29 2015 12:55
allegro/ralph#1256
i found the anwser in this issue.
i update all the code, and install them, error again..
Mateusz Kurek
@mkurek
Apr 29 2015 12:57
first time you run migrations did you run it with --fake flag?
Linux-Dream
@Linux-Dream
Apr 29 2015 12:57
Error in migration: ralph_scrooge:0021_warehouses_to_datacenters
ralph_scrooge.models.DoesNotExist: Warehouse matching query does not exist.
no
shoudl run with --fake first? i try it.
Mateusz Kurek
@mkurek
Apr 29 2015 12:58
yes
on clean database
Linux-Dream
@Linux-Dream
Apr 29 2015 13:00
oh, i drop database 'ralph' every time and do ralph syncdb and ralph migrate
so, i do not need to clean database
i use --fake first and do migrate ,then output error:
DatabaseError: Could not load ralph_assets.AssetCategory(pk=1-back-office): (1146, "Table 'ralph.ralph_assets_assetcategory' doesn't exist")
Problem installing fixture '/usr/lib/python2.7/site-packages/ralph_assets-2.5.1-py2.7.egg/ralph_assets/fixtures/initial_data.json': Traceback (most recent call last):
Problem installing fixture '/usr/lib/python2.7/site-packages/ralph_scrooge-3.0.1-py2.7.egg/ralph_scrooge/fixtures/initial_data.yaml': Traceback (most recent call last):
DatabaseError: Could not load ralph_scrooge.Warehouse(pk=1): (1146, "Table 'ralph.ralph_scrooge_warehouse' doesn't exist")
Mateusz Kurek
@mkurek
Apr 29 2015 13:03
so after dropping whole database you need to do:
ralph syncdb --all
ralph migrate --fake
Linux-Dream
@Linux-Dream
Apr 29 2015 13:09
thank u, now it worked!
but when i logined in, it return 500 error. but no error message in console and runtime.log
ValueError: The file 'css/ajax_select.css' could not be found with <django.contrib.staticfiles.storage.CachedStaticFilesStorage object at 0x68f73d0>.
i find the error message..
Mateusz Kurek
@mkurek
Apr 29 2015 13:11
after pulling newest versions did you run ralph collectstatic?
Linux-Dream
@Linux-Dream
Apr 29 2015 13:12
i run it ..
now i have two version selects
bob-ajax-selects (1.6.1)
django-ajax-selects (1.3.6)
do i need to uninstall django-ajax-selects?
after i do ralph collectstatic,but i cant't find css file ajax_select.css in directory /root/.ralph/shared/static
Mateusz Kurek
@mkurek
Apr 29 2015 13:15
bob-ajax-selects is fork of django-ajax-selects
and ajax_select.css should be in ~/.ralph/shared/static/css
Linux-Dream
@Linux-Dream
Apr 29 2015 13:18
but i do ralph collectstatic, then no ajax_select.css file found in that path
Mateusz Kurek
@mkurek
Apr 29 2015 13:19
is this the only one missing static file?
Linux-Dream
@Linux-Dream
Apr 29 2015 13:21
yeah
i can find other css and js files
404.d41d8cd98f00.html fugue-icons.97be5db94524.css js
404.html fugue-icons.css lckd
500.d41d8cd98f00.html fugue-icons.e65680648ffd.png menu.57eab02af5d7.js
500.html fugue-icons-important.b551e3c92376.css menu.js
admin fugue-icons-important.css moment.bfe6440987aa.js
assets fugue-icons.json moment.js
bob.ff8129539142.js fugue-icons.png mustache.b885e3b33cfc.js
bob.js images mustache.js
bootbox.438a9b5b524e.js img partials
bootbox.js jit plugins
bootstrap jquery-1.7.2.min.b8d64d0bc142.js reports.d755d1dcf875.js
bootstrap-datepicker.02a319a36bc3.js jquery-1.7.2.min.js reports.js
bootstrap-datepicker.js jquery.32015dd42e95.js require.8daafb4058c5.js
cmdb jquery.flot.51bba0d5333d.js require.js
css jquery.flot.js scan.c7766513b894.js
deparam.d83e2126b764.js jquery.flot.selection.df6b3e3f0d0f.js scan.js
deparam.js jquery.flot.selection.js scrooge
filtered_widget jquery.js ui
fugue-icons.4982e3a80534.json jquery-ui
i use command: find /root/.ralph/ -name "ajax_select.css" and no output
Mateusz Kurek
@mkurek
Apr 29 2015 13:28
do you have bob-ajax-selects installed from git or using pip (from pypi)?
Linux-Dream
@Linux-Dream
Apr 29 2015 13:31
from git
bob-ajax-selects
now the problem is , i use django-ajax-selects, get error...
i use bob-ajax-selects, return 500
use bob-ajax-selects, the file "css/ajax_select.css" will not copy to ~/.ralph/shared/static/
Mateusz Kurek
@mkurek
Apr 29 2015 13:49
maybe you have some errors during collectstatic?
Linux-Dream
@Linux-Dream
Apr 29 2015 13:53
TemplateDoesNotExist: autocomplete_DCAssetModelLookup.html, autocomplete.html
no error in collectstatic
i think i have some problem in install bob-ajax-selects
beacuse python setup.py install and then i can't find .py file in directory site-packages/ajax-select/
Mateusz Kurek
@mkurek
Apr 29 2015 13:57
for every our repo you could run make install to install it
Linux-Dream
@Linux-Dream
Apr 29 2015 13:59
ok, i try it.
i use make install
and no file found in ajax_select directory in site-packages
Linux-Dream
@Linux-Dream
Apr 29 2015 14:06
no match make install or python setup.py install, just generate two file in site-packages directory
bob_ajax_selects-1.6.1-py2.7.egg bob-ajax-selects.egg-link
Mateusz Kurek
@mkurek
Apr 29 2015 14:10
ok - so run (twice) pip uninstall bob-ajax-selects and then run again make install in source code directory. after all run ralph collectstatic again
Linux-Dream
@Linux-Dream
Apr 29 2015 14:11
ok, i try it.
the second time run: Cannot uninstall requirement bob-ajax-selects, not installed
it's the same result
Mateusz Kurek
@mkurek
Apr 29 2015 14:13
maybe underscore instead of hyphen?
Linux-Dream
@Linux-Dream
Apr 29 2015 14:15
no, the hyphen is right..
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 14:25
@Linux-Dream are you familar with Vagrant?
Linux-Dream
@Linux-Dream
Apr 29 2015 14:27
no, but i will learn it soon. i am really want to join the ralph open source team.
Linux-Dream
@Linux-Dream
Apr 29 2015 14:34
thank god
i fixed the problem...
and now i can use asset model now ..
i use this script to update all the projects:

!/bin/sh

projects=(
allegro:ralph
allegro:ralph_assets
allegro:ralph_pricing
allegro:django-bob
)

for project in ${projects[@]}
do
group=echo $project | cut -d ':' -f 1
name=echo $project | cut -d ':' -f 2
rm -rf $name
/usr/bin/git clone https://github.com/${group}/${name}.git
cd $name
/usr/bin/python2.7 setup.py build
/usr/bin/python2.7 setup.py install
cd ..
done

then i drop database ralph
1 ralph syncdb --all
2 ralph migrate --fake
3 pip install bob-ajax-selects
4 ralph collectstatic
4 ralph makeconf -f
5 ralph collectstatic
6 ralph run_gunicorn ip:8000 --debug
it worked, thank all of u.. it's almost 11:00 pm, i need to go home now.
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 14:39
What country ? :)
Linux-Dream
@Linux-Dream
Apr 29 2015 14:39
china =.=
my company is meituan.com
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 14:39
Nice
Linux-Dream
@Linux-Dream
Apr 29 2015 14:40
ok, good bye = =
✪ vi4m Marcin Kliks
@vi4m
Apr 29 2015 14:40
Bye