Django logs errors - django

I'm sorry to ask about this
I'm trying to set up log to be able to test my code; Django pass variable into template
and I was following the example in https://docs.djangoproject.com/en/2.1/topics/logging/
Here the code they use
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': r'C:\Users\Sk\Desktop\project\FrounterWeb\FrounterWeb\logs',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
But i run into this problem, copy and paste and answer i get is this;
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Sk\Desktop\project\FrounterWeb>py runserver_plus
(null): can't open file 'runserver_plus': [Errno 2] No such file or directory
C:\Users\Sk\Desktop\project\FrounterWeb>py manage.py runserver_plus
Traceback (most recent call last):
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 555, in configure
handler = self.configure_handler(handlers[name])
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 728, in configure_handler
result = factory(**kwargs)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\__init__.py", line 1041, in __init__
StreamHandler.__init__(self, self._open())
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\__init__.py", line 1070, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Sk\\Desktop\\project\\FrounterWeb\\FrounterWeb\\logs'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 357, in execute
django.setup()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\log.py", line 76, in configure_logging
logging_config_func(logging_settings)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 792, in dictConfig
dictConfigClass(config).configure()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 563, in configure
'%r' % name) from e
ValueError: Unable to configure handler 'files'
I believe this problem with the dictionary, so I remove the 'File':{} & 'django':{} dictionary and i receive another problems
the new code:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': r'C:\Users\Sk\Desktop\project\FrounterWeb\FrounterWeb\logs',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
and this is problems;
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Sk\Desktop\project\FrounterWeb>py runserver_plus
(null): can't open file 'runserver_plus': [Errno 2] No such file or directory
C:\Users\Sk\Desktop\project\FrounterWeb>py manage.py runserver_plus
Traceback (most recent call last):
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 555, in configure
handler = self.configure_handler(handlers[name])
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 728, in configure_handler
result = factory(**kwargs)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\__init__.py", line 1041, in __init__
StreamHandler.__init__(self, self._open())
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\__init__.py", line 1070, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Sk\\Desktop\\project\\FrounterWeb\\FrounterWeb\\logs'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 357, in execute
django.setup()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\log.py", line 76, in configure_logging
logging_config_func(logging_settings)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 792, in dictConfig
dictConfigClass(config).configure()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 563, in configure
'%r' % name) from e
ValueError: Unable to configure handler 'files'
C:\Users\Sk\Desktop\project\FrounterWeb>py manage.py runserver_plus
Traceback (most recent call last):
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 555, in configure
handler = self.configure_handler(handlers[name])
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 688, in configure_handler
config_copy = dict(config) # for restoring in case of error
ValueError: dictionary update sequence element #0 has length 1; 2 is required
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 357, in execute
django.setup()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\log.py", line 76, in configure_logging
logging_config_func(logging_settings)
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 792, in dictConfig
dictConfigClass(config).configure()
File "C:\Users\Sk\AppData\Local\Programs\Python\Python37\lib\logging\config.py", line 563, in configure
'%r' % name) from e
ValueError: Unable to configure handler 'class'
This problem means it can read it own library
I'm sorry trouble you, but pls help me, i really don't know what to since is Django is tell is having problem with own build in library(i think)

You need to add formatter to your LOGGING:
LOGGING = {
'formatters': {
'verbose': {
'format': '{levelname} {message}',
'style': '{',
},
},
# Rest of the Logging Config
}

The answer was very simple, like Burhan Khalid said the logs path to the site not tied a path for the file to logs to.
All i did was add this to my handler
'filename': 'zigview\logging_files\debug.log',
and is working
I feel so embarrass, to make such a simple mistakes

Related

MongoDB doesn't work locally because of SRV error (no answer)

Situation
We are working on the backend of our project consisting of two services written in Django and FastAPI. Both services use MongoDB as their database system.
In Django we use djongo==1.3.0 for ORM compatibility.
In FastAPI we use odmantic==0.3.4.
Both of these libraries use pymongo==3.11.3 underneath.
This MongoDB SRV error has been an issue for our Django service ever since we created it, but we managed to somehow work around it by not using the latest packages, such as:
Django==2.2.20
djongo==1.3.0
pymongo==3.11.3
Recently due to security risks we had to upgrade:
urllib3 from 1.25.8 to 1.26.5
pydantic from 1.8.1 to 1.8.2
Django from 2.2.20 to 2.2.22
Those were suggested by GitHub's dependabot.
Problem
When we run any of these services locally now they break with the following base exception:
dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: _mongodb._tcp.cluster0.k1eh0.mongodb.net. IN SRV
Full log for Django:
> python manage.py test
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/djongo/database.py", line 10, in connect
return clients[db]
KeyError: 'djongo_test'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 212, in __init__
rrset = response.find_rrset(response.answer, qname,
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/message.py", line 341, in find_rrset
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 220, in __init__
crrset = response.find_rrset(response.answer,
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/message.py", line 341, in find_rrset
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 72, in _resolve_uri
results = resolver.query('_mongodb._tcp.' + self.__fqdn, 'SRV',
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 1100, in query
return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 1003, in query
answer = Answer(_qname, rdtype, rdclass, response,
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 232, in __init__
raise NoAnswer(response=response)
dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: _mongodb._tcp.database-test.avxhw.mongodb.net. IN SRV
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
super().run_from_argv(argv)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/core/management/commands/test.py", line 53, in handle
failures = test_runner.run_tests(test_labels)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/test/runner.py", line 629, in run_tests
old_config = self.setup_databases(aliases=databases)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/test/runner.py", line 552, in setup_databases
return _setup_databases(
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/test/utils.py", line 170, in setup_databases
connection.creation.create_test_db(
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/creation.py", line 58, in create_test_db
self._create_test_db(verbosity, autoclobber, keepdb)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/creation.py", line 168, in _create_test_db
with self._nodb_connection.cursor() as cursor:
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 256, in cursor
return self._cursor()
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 233, in _cursor
self.ensure_connection()
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
self.connect()
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 195, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/djongo/base.py", line 185, in get_new_connection
self.client_connection = Database.connect(db=name, **connection_params)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/djongo/database.py", line 13, in connect
clients[db] = MongoClient(**kwargs, connect=False)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 639, in __init__
res = uri_parser.parse_uri(
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/uri_parser.py", line 500, in parse_uri
nodes = dns_resolver.get_hosts()
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 102, in get_hosts
_, nodes = self._get_srv_response_and_hosts(True)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 83, in _get_srv_response_and_hosts
results = self._resolve_uri(encapsulate_errors)
File "/home/bk/inz/backend/authservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 79, in _resolve_uri
raise ConfigurationError(str(exc))
pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: _mongodb._tcp.database-test.avxhw.mongodb.net. IN SRV
Full log for FastAPI:
> python -m src.main
Traceback (most recent call last):
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 72, in _resolve_uri
results = resolver.query('_mongodb._tcp.' + self.__fqdn, 'SRV',
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 1321, in query
return resolve(qname, rdtype, rdclass, tcp, source,
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 1305, in resolve
return get_default_resolver().resolve(qname, rdtype, rdclass, tcp, source,
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 1202, in resolve
(answer, done) = resolution.query_result(response, None)
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/dns/resolver.py", line 674, in query_result
raise NoAnswer(response=answer.response)
dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: _mongodb._tcp.cluster0.k1eh0.mongodb.net. IN SRV
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/bk/inz/backend/testservice/src/main.py", line 20, in <module>
client = AsyncIOMotorClient(MONGODB_URL)
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/motor/core.py", line 156, in __init__
delegate = self.__delegate_class__(*args, **kwargs)
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 639, in __init__
res = uri_parser.parse_uri(
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/uri_parser.py", line 500, in parse_uri
nodes = dns_resolver.get_hosts()
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 102, in get_hosts
_, nodes = self._get_srv_response_and_hosts(True)
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 83, in _get_srv_response_and_hosts
results = self._resolve_uri(encapsulate_errors)
File "/home/bk/inz/backend/testservice/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 79, in _resolve_uri
raise ConfigurationError(str(exc))
pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: _mongodb._tcp.cluster0.k1eh0.mongodb.net. IN SRV
In our CI setup on GitHub Actions Django service tests are still run successfully. It's clear that the problem lies within the DNS aspect.
Questions
Are there any specific DNS servers which do not support MongoDB? I was using Google's 8.8.8.8 before and after it broke.
Why would the problem be caused by upgrading listed dependencies? Only urllib was upgraded for both services.
Is there any workaround?
Review https://github.com/mongodb/specifications/blob/master/source/initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst for how SRV URIs work, then manually issue the relevant DNS queries using a tool such as dig to verify your environment has working DNS.

ValueError: Unable to configure filter "'request_id'"

I was trying to run the python3.8 manage.py runserver
Im having the request_id defined in INSTALLED_APPS and request_id.middleware.RequestIdMiddleware added in MIDDLEWARE under setting.py
This is the traceback
> Exception ignored in thread started by: <function
> check_errors.<locals>.wrapper at 0x7fe56c1d78b0> Traceback (most
> recent call last): File
> "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 228,
> in wrapper
> fn(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/core/management/commands/runserver.py",
> line 116, in inner_run
> autoreload.raise_last_exception() File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 251,
> in raise_last_exception
> six.reraise(*_exception) File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in
> reraise
> raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 228,
> in wrapper
> fn(*args, **kwargs) File "/usr/lib/python3/dist-packages/django/__init__.py", line 22, in setup
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/usr/lib/python3/dist-packages/django/utils/log.py", line 75, in
> configure_logging
> logging_config_func(logging_settings) File "/usr/lib/python3.8/logging/config.py", line 808, in dictConfig
> dictConfigClass(config).configure() File "/usr/lib/python3.8/logging/config.py", line 553, in configure
> raise ValueError('Unable to configure ' ValueError: Unable to configure filter 'request_id'
Im running this using python3.8 but not sure why python3 is referred in traceback.
Update: Adding the relevant lines from settings.py
LOGGING = {
"filters": {
"request_id": {
"()": "request_id_django_log.filters.RequestIDFilter"
},
},
}
Installing django-log-request-id can fix this issue.
pip install django-log-request-id
I've tested this in django==2.2.2
Similar fix for me as with DilLip_Chowdary, but I think there was some kind of name change
pip install django-request-id
Tested on django==3.2.3

Django Postgres DeserializationError: Problem installing fixture

I am trying to import my developement database fixtures into my production server. The migrations have been made and I tried slimming down the database migration to only two classes. This is the command and error I am receiving:
Error
(env) root#django-01:/home/projects/server/mysite# python3 local.py loaddata db.json
Traceback (most recent call last):
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/serializers/json.py", line 68, in Deserializer
objects = json.loads(stream_or_string)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 19 column 1 (char 229)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "local.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 72, in handle
self.loaddata(fixture_labels)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 113, in loaddata
self.load_label(fixture_label)
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 168, in load_label
for obj in objects:
File "/home/projects/server/env/lib/python3.5/site-packages/django/core/serializers/json.py", line 73, in Deserializer
raise DeserializationError() from exc
django.core.serializers.base.DeserializationError: Problem installing fixture '/home/projects/server/mysite/db.json':
db.json
[
{
"model": "memberships.benefit",
"pk": 1,
"fields": {
"name": "SSL Certificate"
}
},
{
"model": "memberships.benefit",
"pk": 2,
"fields": {
"name": "No cancellation fee"
}
},
]
You need use proper json format, remove last (,) from your json
[
{
"model": "memberships.benefit",
"pk": 1,
"fields": {
"name": "SSL Certificate"
}
},
{
"model": "memberships.benefit",
"pk": 2,
"fields": {
"name": "No cancellation fee"
}
}
]
refer this
hope it helps

error while auto downloading a report through selenium and python

I'm doing automation of a website and auto downloading a report through selenium and python and I get this error:
C:\Windows\system32>
C:\Python27\python.exeC:\Python27\Scripts\MH_Download3.py
Traceback (most recent call last):
File "C:\Python27\Scripts\MH_Download3.py", line 111, in <module>
driver = webdriver.Firefox(firefox_binary=binary)
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 80, in __init__self.binary, timeout)
File`"C:\Python27\lib\sitepackages\selenium\webdriver\firefox\extension_connection.py", line 52, in __init__self.binary.launch_browser(self.profile, timeout=timeout)
File "C:\Python27\lib\sitepackages\selenium\webdriver\firefox\firefox_binary.py", line 67, in launch_browserself._start_from_profile_path(self.profile.path)
File "C:\Python27\lib\sitepackages\selenium\webdriver\firefox\firefox_binary.py", line 90, in _start_from_profile_path env=self._firefox_env)
File "C:\Python27\lib\subprocess.py", line 709, in __init__ errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 957, in _execute_child startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

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.