Bug 5499 - "source toaster start" fail
Summary: "source toaster start" fail
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ critical
Target Milestone: 1.6
Assignee: Alexandru Damian
QA Contact: Ionut Chisanovici
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-11-06 19:44 UTC by Diego Sueiro
Modified: 2015-08-07 13:45 UTC (History)
11 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Sueiro 2013-11-06 19:44:29 UTC
Following this instructions:
https://wiki.yoctoproject.org/wiki/Toaster#To_get_it_up_and_running:

After launching "source toaster start", I've gotten the following error:

The system will start.
Traceback (most recent call last):
  File "/<...>/yocto/toaster-src/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 252, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 101, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 93, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/<...>/toaster-src/bitbake/lib/toaster/toastermain/settings.py", line 183, in <module>
    from django.db.backends.signals import connection_created
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 118, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: BRT
Failed db sync, stopping system start
Comment 1 Diego Sueiro 2013-11-06 20:00:00 UTC
I'm using Ubuntu 12.10.
Comment 2 Alexandru Damian 2013-11-11 13:39:29 UTC
In review on toaster/master.
Comment 4 Razvan Ionescu 2013-12-23 12:04:59 UTC
Verified on both:

master:af32d95f3beeb678fb59436445237efe53a36726

dora:a6b357a9af161f7dae598a9477dd84cc431362f8
Comment 5 Jessica 2014-02-26 17:58:53 UTC
It happened on my Ubuntu 12.10 system with the following error:

jzhang@jzhang-desktop:~/poky-toaster/build$ source toaster start The system will start.
Traceback (most recent call last):
  File "/home/jzhang/poky-toaster/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 130, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/jzhang/poky-toaster/bitbake/lib/toaster/toastermain/settings.py", line 197, in <module>
    from django.db.backends.signals import connection_created
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 158, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: PST Traceback (most recent call last):
  File "/home/jzhang/poky-toaster/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 130, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/jzhang/poky-toaster/bitbake/lib/toaster/toastermain/settings.py", line 197, in <module>
    from django.db.backends.signals import connection_created
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 158, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: PST

Error on migration, trying to recover... 

Traceback (most recent call last):
  File "/home/jzhang/poky-toaster/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 130, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/jzhang/poky-toaster/bitbake/lib/toaster/toastermain/settings.py", line 197, in <module>
    from django.db.backends.signals import connection_created
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 158, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: PST Traceback (most recent call last):
  File "/home/jzhang/poky-toaster/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 130, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/jzhang/poky-toaster/bitbake/lib/toaster/toastermain/settings.py", line 197, in <module>
    from django.db.backends.signals import connection_created
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 158, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: PST Failed start.
Comment 6 Jessica 2014-02-26 18:04:04 UTC
This might be of interest:

http://stackoverflow.com/questions/5750150/invalid-django-time-zone

It could be that we need to have some more intelligent code setting this value.

On Wednesday 26 February 2014 17:41:04 Lerner, Dave wrote:
> 1) pytz doesn't seem to fix the problem.
> I did not have pytz installed, import pytz failed.  Then I used 
> easy_install to add pytz and import pytz didn't fail.  However, I get 
> the error message
> 
>    ValueError: Incorrect timezone setting: CST
> 
> which is the correct timezone setting, I'm in Central Standard Time, 
> Chicago.
> 
> 2) Changing toaster/toastermain/settings.py from
> 	- TIME_ZONE = time.tzname[0]
> 	+ TIME_ZONE = None
> let's toaster boot, with a change only to our code.
> 
> 
> Also,
> 
> In a python shell the following does NOT raise an error:
> >>> import time
> >>> TIME_ZONE=time.tzname[0]
> 
> or even
> 
> >>> import time
> >>> import pytz
> >>> TIME_ZONE=time.tzname[0]
> 
> Does anyone have a system where toaster boots without raising the error?
> 
> Dave
> 
> > -----Original Message-----
> > From: Paul Eggleton [mailto:paul.eggleton@linux.intel.com]
> > Sent: Wednesday, February 26, 2014 11:23 AM
> > To: Barros Pena, Belen
> > Cc: Reyna, David; Lerner, Dave; Ravi Chintakunta; Zhang, Jessica; 
> > Damian, Alexandru Subject: Re: time zone Bugzilla issue
> > 
> > On Wednesday 26 February 2014 17:16:32 Barros Pena, Belen wrote:
> > > Well, this is the issue I remembered:
> > > 
> > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=5499
> > > 
> > > But it is set to verified fixed. I can either reopen it or file a 
> > > new
> > > one:
> > > let me know what you think is best.
> > 
> > The key is - is the error in the traceback the same as bug 5499 or a 
> > different one?
> > 
> > Also, for the people experiencing the bug - do you have pytz 
> > installed or not?
> > 
> > Cheers,
> > Paul
> > 
> > --
> > 
> > Paul Eggleton
> > Intel Open Source Technology Centre
Comment 7 Dave Lerner 2014-02-26 21:44:10 UTC
TIME_ZONE is supposed to be like the default for Django 'America/Chicago', but the time.tzname(0) or (1) returns 'CST' or 'CDT', clearly not correct.

I found the following to get a timezone string like above. 

@@ -51,8 +51,9 @@ ALLOWED_HOSTS = []
 # In a Windows environment this must be set to your system time zone.

 # Always use local computer's time zone
-import time
-TIME_ZONE = time.tzname[0]
+import pytz # $pip install pytz
+from tzlocal import get_localzone # $ pip install tzlocal
+TIME_ZONE = str(get_localzone())

Testing it now with a build so I can examine the build time.
-dave
Comment 8 Dave Lerner 2014-02-27 13:46:24 UTC
The fix in my last comment works on ubuntu 12.04 based on examination of a new build's completion time on the All Builds screen.
Comment 9 Alexandru Damian 2014-03-12 13:42:30 UTC
Patch available on bitbake-devel mailing list, due to the High/Critical importance of this bug.
Comment 10 Belen Barros Pena 2014-03-26 17:55:46 UTC
From the bitbake-devel mailing list:


On 13/03/2014 11:24, "Damian, Alexandru" <alexandru.damian@intel.com> wrote:

I hear you, thanks for the input on various configurations.

Please do not submit this patch, I'll come back with a v2.


Ross, I tried time.tzname (as it currently stands) and it doesn't provide a /usr/share/zoneinfo/ compatible name :(.


Alex


On Thu, Mar 13, 2014 at 10:11 AM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:

On Wednesday 12 March 2014 18:49:02 Damian, Alexandru wrote:
This is a Debian-ism :(


You say that, but the Fedora 20 install I have here (a) doesn't have TZ and
(b) has /etc/localtime -> ../usr/share/zoneinfo/Europe/London. On my CentOS
6.5 machine (possibly irrelevant for Toaster, but...) TZ is also unset but
/etc/localtime is just a plain copy of some timezone file rather than a
symlink. Older RH-style systems such as CentOS 6 have a ZONE value in
/etc/sysconfig/clock but Fedora appears to have eliminated this file.

Given that, I don't think this is a complete fix.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre
Comment 11 Alexandru Damian 2014-03-27 13:10:35 UTC
New patch sent to bitbake-devel and toaster mailing lists.

We reverse-match /etc/localtime into /usr/share/zoneinfo/ if the TZ is not set.
Comment 12 Alexandru Georgescu 2014-04-02 06:44:26 UTC
Demoting this from High since the critical issue was resolved.
Comment 13 Ionut Chisanovici 2014-04-04 06:50:26 UTC
This is verified.

Cheers,
Ionut C