Hue Install From Tarball Failure Django Error? - django

After running PREFIX=/home/hue make install
Towards the end of my hue install via tarball, I get the following error. I'm not sure what is happening. I have the prerequisites installed as well. Using this guide
Command that is failing: /home/hue/hue/build/env/bin/hue makemigrations --noinput
Error:
Traceback (most recent call last):
File "/home/hue/hue/build/env/bin/hue", line 11, in <module>
load_entry_point('desktop', 'console_scripts', 'hue')()
File "/home/hue/hue/desktop/core/src/desktop/manage_entry.py", line 216, in entry
execute_from_command_line(sys.argv)
File "/home/hue/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/hue/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/core/management/__init__.py", line 307, in execute
settings.INSTALLED_APPS
File "/home/hue/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/home/hue/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/hue/hue/build/env/lib/python2.7/site-packages/Django-1.11-py2.7.egg/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/hue/hue/desktop/core/src/desktop/settings.py", line 271, in <module>
conf.initialize(_desktop_conf_modules, _config_dir)
File "/home/hue/hue/desktop/core/src/desktop/lib/conf.py", line 598, in initialize
conf_data = load_confs(_configs_from_dir(config_dir))
File "/home/hue/hue/desktop/core/src/desktop/lib/conf.py", line 530, in load_confs
for in_conf in conf_source:
File "/home/hue/hue/desktop/core/src/desktop/lib/conf.py", line 511, in _configs_from_dir
conf = ConfigObj(os.path.join(conf_dir, filename))
File "/home/hue/hue/build/env/lib/python2.7/site-packages/configobj-5.0.6-py2.7.egg/configobj.py", line 1229, in __init__
self._load(infile, configspec)
File "/home/hue/hue/build/env/lib/python2.7/site-packages/configobj-5.0.6-py2.7.egg/configobj.py", line 1318, in _load
raise error
configobj.ConfigObjError: Parsing failed with several errors.
First error at line 1046.

In case anyone else runs into this. So the issue stemmed from modifying the hue.ini file before running the install. Rolling back to the original hue.ini resolved the issue. I must have had a typo in the modified version, thus causing the parse error above.
Tarball File location:
hue/desktop/conf/hue.ini

Related

DeserializationError when adding fixture on server (loaddata)

I am trying to add my data to database in my server. I use exactly the same JSON file in my local machine and it works. But when I do the same in server it gives me Deserialization Error.
The JSON file is so big that I can't show it here but I am sure there is no typo.
I did all migrations and database works - I can add object from admin dashboard. How can I solve this error?
The error I get:
Traceback (most recent call last):
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/serializers/json.py", line 69, in Deserializer
objects = json.loads(stream_or_string)
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 72, in handle
self.loaddata(fixture_labels)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 114, in loaddata
self.load_label(fixture_label)
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/management/commands/loaddata.py", line 172, in load_label
for obj in objects:
File "/home/testuser/myprojectt/myvenv/lib/python3.8/site-packages/django/core/serializers/json.py", line 74, in Deserializer
raise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture '/home/testuser/myprojectt/myprojectt/articles/fixtures/article.json':
Checked the JSON again and again but it still working on local but the same error on server.
I am using Ubuntu on the server. And didn't have git-lfs installed. To solve this issue:
Install it with sudo apt-get install git-lfs.
Then run git lfs pull on project directory.
And then I managed to work with the JSON data as I wanted.

Pymongo Error in PyCharm debugger only

I am seeing a very weired error while debugging my code in PyCharm. The offending lines that cause the exception are
a = db.links.list_indexes()
or the following:
db.links.create_index("created", expireAfterSeconds=settings.EXPIRY_PERIOD, background=True)
My code runs normally inside PyCharm if I simply do run tests, while trying to debug it causes the following error:
======================================================================
ERROR: test_detail_view (sharescreening.tests.TestIndex)
----------------------------------------------------------------------
Traceback (most recent call last):
File "sharescreening/tests.py", line 53, in test_detail_view
response = self.client.get('/')
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/test/client.py", line 500, in get
**extra)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/test/client.py", line 303, in get
return self.generic('GET', path, secure=secure, **r)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/test/client.py", line 379, in generic
return self.request(**r)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/test/client.py", line 466, in request
six.reraise(*exc_info)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 119, in get_response
resolver_match = resolver.resolve(request.path_info)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 365, in resolve
for pattern in self.url_patterns:
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 401, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 395, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
result = _import(*args, **kwargs)
File "sharescreening/urls.py", line 17, in <module>
from .views import put_links, index, get_shares, ShowDetails
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
result = _import(*args, **kwargs)
File "sharescreening/views.py", line 22, in <module>
a = db.links.list_indexes()
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/pymongo/collection.py", line 1269, in list_indexes
with self._socket_for_primary_reads() as (sock_info, slave_ok):
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 699, in _socket_for_reads
with self._get_socket(read_preference) as sock_info:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 663, in _get_socket
server = self._get_topology().select_server(selector)
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/pymongo/topology.py", line 121, in select_server
address))
File "/home/oznt/.virtualenvs/screenshares/local/lib/python2.7/site-packages/pymongo/topology.py", line 97, in select_servers
self._error_message(selector))
ServerSelectionTimeoutError: No servers found yet
----------------------------------------------------------------------
Ran 4 tests in 32.173s
FAILED (errors=1)
I have no clue why the tests pass in the command line, and in simple running mode but not in debug mode. Can someone shed some light on this problem here?
It turns out that the issue was really a problem with the combination or using gevent with the debugger.
If you this problem, it is resolved by upgrading your pycharm version to 2006.1.
More details can be found in the issue in PYCharm tracker

Horizon fails to start

I've followed this guide: https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Identity_Management_-KeyRock-_Installation_and_Administration_Guide
When i run the server i get:
Traceback (most recent call last):
File "manage.py", line 23, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 261, in fetch_command
commands = get_commands()
File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 107, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 54, in __getattr__
self._setup(name)
File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 49, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 132, in __init__
% (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named oslo.utils
I've tried using --pythonpath but to no avail. I've also ran ./run_tests.sh and here are the results: http://pastebin.com/6i7Ws5Ej.
System:
CentOS 6.5 x64,
python 2.6.6
Any idea how to solve this? any info i might have forgotten don’t hesitate to ask
Edit:
I've switched to ubuntu 12 to follow the tutorial step by step. I got keystone running but horizon still fails and gives me the same error.
A fix was also committed on KeyRock's Github account.
Here is the issue.
Manually updating pbr to 1.3.0 directly from python and pip solved all issues

showing syntax error when trying to run in pycharm

When i try to run a project it is showing the following message :
"C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\bin\runnerw.exe" C:\Python27\python.exe G:/project/sample3/manage.py runserver 8000
Traceback (most recent call last):
File "G:/project/sample3/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 238, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\core\management\__init__.py", line 41, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django-1.7.1-py2.7.egg\django\contrib\staticfiles\management\commands\runserver.py", line 18
def get_handler(self, *args, use_static_handler=True, insecure_serving=False, **options):
^
SyntaxError: invalid syntax
Process finished with exit code 1
this happens to all the projects . this problem started unexpectedly...
Looks like you may have accidentally modified the Django code in your installation, because this is not what line 18 of this file looks like in the actual Django source code. Please try to uninstall and reinstall Django.

Error in sentry --config=/etc/sentry.conf.py start

Please tell me how solve this
I try install Install and configure a Sentry Service on a CentOS, and when i try start sentry service i get this error:
[root#felipeurrego ~]# source /var/www/sentry/bin/activate
(sentry)[root#felipeurrego ~]# sentry --config=/etc/sentry.conf.py start
Traceback (most recent call last):
File "/var/www/sentry/bin/sentry", line 8, in <module>
load_entry_point('sentry==5.4.5', 'console_scripts', 'sentry')()
File "/var/www/sentry/lib/python2.6/site-packages/sentry-5.4.5-py2.6.egg/sentry/utils/runner.py", line 197, in main
initializer=initialize_app,
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/runner.py", line 155, in run_app
management.execute_from_command_line([runner_name, command] + command_args)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 252, in fetch_command
app_name = get_commands()[subcommand]
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 101, in get_commands
apps = settings.INSTALLED_APPS
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/utils/functional.py", line 184, in inner
self._setup()
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py", line 93, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/importer.py", line 68, in load_module
return self._load_module(fullname)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/importer.py", line 92, in _load_module
load_settings(self.config_path, allow_extras=self.allow_extras, settings=settings_mod)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/settings.py", line 49, in load_settings
execfile(mod_or_filename, conf.__dict__)
django.core.exceptions.ImproperlyConfigured: IndentationError('unexpected indent', ('/etc/sentry.conf.py', 58, 1, " SENTRY_URL_PREFIX = 'http://logs.felipeurrego.com'\n"))
And thats all
It's very clear:
django.core.exceptions.ImproperlyConfigured: IndentationError('unexpected indent', ('/etc/sentry.conf.py', 58, 1, " SENTRY_URL_PREFIX = 'http://logs.felipeurrego.com'\n"))
You have a unwarranted space before the configuration variable SENTRY_URL_PREFIX in your /etc/sentry.conf.py. Python requires that everything is uniformly indented in your source code files.