Bug 8026 - Toaster start up directories incorrect
Summary: Toaster start up directories incorrect
Status: VERIFIED OBSOLETE
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ major
Target Milestone: 2.1
Assignee: Michael Wood
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-17 12:51 UTC by Michael Wood
Modified: 2016-02-08 11:55 UTC (History)
6 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 Michael Wood 2015-07-17 12:51:16 UTC
If you try to start toaster from bitbake the directory guessing goes wrong, it looks like it's using a fixed number of directories to traverse up the directory structure, which will be wrong depending on where you have toaster.

(venv)michael@draco:~/dev/yocto/bitbake(1.26 *)$ ./bin/toaster
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_admin_log
Creating table south_migrationhistory

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): no
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.messages
 > django.contrib.sessions
 > django.contrib.admin
 > django.contrib.staticfiles
 > django.contrib.humanize
 > south

Not synced (use migrations):
 - orm
 - bldcontrol
(use ./manage.py migrate to migrate these)
Running migrations for orm:
 - Migrating forwards to 0019_auto__add_buildartifact.
 > orm:0001_initial
 > orm:0002_auto__add_field_build_timespent
 > orm:0003_timespent
 - Migration 'orm:0003_timespent' is marked for no-dry-run.
 > orm:0004_auto__add_field_package_installed_name
 > orm:0005_auto__add_target_image_file__add_target_file__add_field_variablehistor
 > orm:0006_auto__add_field_target_image_size__add_field_target_license_manifest_p
 > orm:0007_auto__add_helptext
 > orm:0008_auto__chg_field_variablehistory_operation__chg_field_recipe_descriptio
 > orm:0009_auto__add_projectvariable__add_projectlayer__add_projecttarget__add_pr
 > orm:0010_auto__add_field_project_branch__add_field_project_short_description__a
 > orm:0011_auto__add_field_projectlayer_dirpath
 > orm:0012_auto__add_field_projectlayer_optional__add_field_projecttarget_task
 > orm:0013_auto__add_release__add_layerversiondependency__add_unique_layerversion
 > orm:0014_auto__chg_field_package_summary__chg_field_layer_summary__chg_field_re
 > orm:0015_auto__add_field_layer_vcs_web_url__add_field_layer_vcs_web_tree_base_u
 > orm:0016_auto__add_field_release_helptext__chg_field_release_branch__add_index_
 > orm:0017_auto__del_toastersettingdefaultlayer__add_releaselayersourcepriority__
 > orm:0018_auto__add_field_layer_version_project
 > orm:0019_auto__add_buildartifact
 - Loading initial data for orm.
Installed 0 object(s) from 0 fixture(s)
Running migrations for bldcontrol:
 - Migrating forwards to 0008_brarchive.
 > bldcontrol:0001_initial
 > bldcontrol:0002_auto__add_field_buildenvironment_sourcedir__add_field_buildenvironment
 > bldcontrol:0003_auto__add_field_brlayer_dirpath
 > bldcontrol:0004_loadinitialdata
 - Migration 'bldcontrol:0004_loadinitialdata' is marked for no-dry-run.
 > bldcontrol:0005_auto__add_brerror
 > bldcontrol:0006_auto__add_brbitbake
 > bldcontrol:0007_auto__add_field_buildrequest_environment__chg_field_buildrequest_build
 > bldcontrol:0008_brarchive
 - Migration 'bldcontrol:0008_brarchive' is marked for no-dry-run.
 - Loading initial data for bldcontrol.
Installed 0 object(s) from 0 fixture(s)
Toaster needs to know in which directory it can download build log files and other artifacts.
 Toaster suggests "/home/michael/dev/yocto/bitbake/toaster_build_artifacts/".
 Press Enter to select "/home/michael/dev/yocto/bitbake/toaster_build_artifacts/" or type the full path to a different directory: 
Verifying the Build Environment. If the local Build Environment is not properly configured, you will be asked to configure it.

 -- Validation: The checkout directory must be set.
Toaster needs to know in which directory it should check out the layers that will be needed for your builds.
 Toaster suggests "/home/michael/dev/yocto". If you select this directory, a layer like "meta-intel" will end up in "/home/michael/dev/yocto/meta-intel".
 Press Enter to select "/home/michael/dev/yocto" or type the full path to a different directory (must be a parent of current checkout directory): 
Verifying the Build Environment. If the local Build Environment is not properly configured, you will be asked to configure it.

 -- Validation: The build directory must be set.
Traceback (most recent call last):
  File "./bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/michael/dev/yocto/bitbake/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/michael/dev/yocto/bitbake/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/michael/dev/yocto/bitbake/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/michael/dev/yocto/bitbake/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 198, in handle
    while (_verify_be()):
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 142, in _verify_be
    is_changed = _update_builddir()
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 131, in _update_builddir
    suggesteddir = self._get_suggested_builddir(be)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 61, in _get_suggested_builddir
    return DN(self._find_first_path_for_file(DN(self.guesspath), "bblayers.conf", 4))
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 32, in _find_first_path_for_file
    ret = self._find_first_path_for_file(j, filename, level - 1)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 32, in _find_first_path_for_file
    ret = self._find_first_path_for_file(j, filename, level - 1)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 32, in _find_first_path_for_file
    ret = self._find_first_path_for_file(j, filename, level - 1)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 32, in _find_first_path_for_file
    ret = self._find_first_path_for_file(j, filename, level - 1)
  File "/home/michael/dev/yocto/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py", line 24, in _find_first_path_for_file
    for i in os.listdir(startdirectory):
OSError: [Errno 13] Permission denied: '/home/michael/dev/project_one/dir/dir/dir'
Failed to start the web server, stopping
Comment 1 Michael Wood 2016-02-05 19:14:32 UTC
We now start toaster in a different way and this setup stage has changed.
Comment 2 Alexandru Roman 2016-02-08 11:55:04 UTC
Verified.