Open lcx opened 11 years ago
Settings
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
should fix that, you sure almir has access to those variables?
Verify that works by doing:
$ python
>>> import locale
>>> locale.getdefaultlocale()
tried the export LC_ALL and LANG settings and any other pytho/django tip I found on google. All don't work :(
python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale;
>>> locale.getdefaultlocale()
('en_US', 'UTF8')
I really can't remember what I did last time to get it started. Something really strange.
Strike that, now I remember. Starting it manually seems to work
/usr/bin/python2.6 -S /opt/almir/bin/pserve /opt/almir/production.ini
Ah, maybe supervisor is not letting those through. You are using the automatic deployment?
Could you try to run snippet at the bottom of blog post to figure out if supervisor has locales set? http://albertoconnor.ca/blog/2012/Jul/21/unicodeencodeerror-when-uploading-files-django-usi
Sorry it took me so long. This is what I have got
cat var/log/locale-stdout---supervisor-vqDkOn.log ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968 ANSI_X3.4-1968
This is on a fresh install from yesterday.
After a reboot however it looks like this:
UTF-8 UTF-8 UTF-8 UTF-8
This however gives me a new error:
Internal Server Error
The server encountered an unexpected internal server error
(generated by waitress)
and this is the logfile
2014-01-01 13:02:01,268 ERROR [exc_logger][Dummy-1] http://10.10.10.8:2500/
Traceback (most recent call last):
File "/opt/almir/eggs/pyramid_exclog-0.5-py2.7.egg/pyramid_exclog/__init__.py", line 40, in exclog_tween
return handler(request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/router.py", line 164, in handle_request
response = view_callable(context, request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/config/views.py", line 333, in rendered_view
result = view(context, request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/config/views.py", line 471, in _requestonly_view
response = view(request)
File "/opt/almir/almir/views.py", line 29, in dashboard
upcoming_jobs = Job.get_upcoming()
File "/opt/almir/almir/models.py", line 287, in get_upcoming
return BConsole().get_upcoming_jobs()
File "/opt/almir/almir/lib/bconsole.py", line 127, in get_upcoming_jobs
p = self.start_process()
File "/opt/almir/almir/lib/bconsole.py", line 69, in start_process
return Popen(shlex.split(self.bconsole_command), stdout=PIPE, stdin=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
2014-01-01 13:02:01,271 ERROR [waitress][Dummy-1] Exception when serving /
Traceback (most recent call last):
File "/opt/almir/eggs/waitress-0.8.1-py2.7.egg/waitress/channel.py", line 329, in service
task.service()
File "/opt/almir/eggs/waitress-0.8.1-py2.7.egg/waitress/task.py", line 173, in service
self.execute()
File "/opt/almir/eggs/waitress-0.8.1-py2.7.egg/waitress/task.py", line 380, in execute
app_iter = self.channel.server.application(env, start_response)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/router.py", line 187, in __call__
response = self.handle_request(request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/tweens.py", line 20, in excview_tween
response = handler(request)
File "/opt/almir/eggs/pyramid_tm-0.3-py2.7.egg/pyramid_tm/__init__.py", line 61, in tm_tween
response = handler(request)
File "/opt/almir/eggs/pyramid_exclog-0.5-py2.7.egg/pyramid_exclog/__init__.py", line 40, in exclog_tween
return handler(request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/router.py", line 164, in handle_request
response = view_callable(context, request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/config/views.py", line 333, in rendered_view
result = view(context, request)
File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/config/views.py", line 471, in _requestonly_view
response = view(request)
File "/opt/almir/almir/views.py", line 29, in dashboard
upcoming_jobs = Job.get_upcoming()
File "/opt/almir/almir/models.py", line 287, in get_upcoming
return BConsole().get_upcoming_jobs()
File "/opt/almir/almir/lib/bconsole.py", line 127, in get_upcoming_jobs
p = self.start_process()
File "/opt/almir/almirlib/bconsole.py", line 69, in start_process
return Popen(shlex.split(self.bconsole_command), stdout=PIPE, stdin=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
If I kill supervisord and restart it manually I get the UTF8 error agains. Killing it again and starting it with LC_ALL=C solves all the problems:
LC_ALL=C /usr/bin/python2.7 /opt/almir/bin/supervisord
The odd thing is, no matter what I do, after a reboot I get the "No such file or directory" I have to kill supervisord and restart it manually.
This means bconsole
command is missing on your system
not quite, bconsole is installed. and if I kill supervisord and restart it manually, everything works. Without any "No such file or directory" error.
So the problem goes deeper, your shell environment is not passed in supervisor. What version are you using?
I have this issue on every almir installation. I did solve it once, of course didn't write the solution down and I have no idea how to get almir starting again.
Logfile:
my locale settings
OS: Debian Squeeze (6.x)