Preconditions/Environment ------------------------- Poky branch thud Ubuntu 18.04 LTS command line build with toaster running Triggering Action/Cause ----------------------- git clone https://git.yoctoproject.org/git/poky -b thud --depth 1 cd poky/ source oe-init-build-env # I added my common DL_DIR and SSTATE_DIR to conf/local.conf source toaster start bitbake core-image-minimal Load up localhost:8000/ select the core image minimal from the command line builds select core-image-minimal under images select one of the included packages (For example busybox) select the "Reverse runtime dependencies" tab URL is http://localhost:8000/toastergui/build/3/package_included_reverse_dependencies/3/9196?count=25&page=1&orderby=package__name%3A%2B Expectation ----------- You should be able to see the reverse runtime dependencies Actual Result ------------- FieldError at /toastergui/build/3/package_included_reverse_dependencies/3/9196 Non-relational field given in select_related: 'name'. Choices are: build, recipe, customimagepackage Request Method: GET Request URL: http://localhost:8000/toastergui/build/3/package_included_reverse_dependencies/3/9196?count=25&page=1&orderby=package__name%3A%2B Django Version: 1.11.8 Exception Type: FieldError Exception Value: Non-relational field given in select_related: 'name'. Choices are: build, recipe, customimagepackage Exception Location: /home/user/.local/lib/python3.6/site-packages/django/db/models/sql/compiler.py in get_related_selections, line 730 Python Executable: /usr/bin/python3 Python Version: 3.6.9 Python Path: ['/ws/thud/poky/bitbake/lib', '/ws/thud/poky/bitbake/lib/toaster', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/user/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages'] Server time: Thu, 19 Dec 2019 20:20:56 +0100 #### Log truncated (Tell me if you need the full log) #### /ws/thud/poky/bitbake/lib/toaster/toastergui/views.py in package_included_reverse_dependencies 1216. for o in objects: ▼ Local vars Variable Value build_id '3' filter_string '' mandatory_parameters {'count': '25', 'orderby': 'package__name:+', 'page': 1} objects Error in formatting: FieldError: Non-relational field given in select_related: 'name'. Choices are: build, recipe, customimagepackage orderby 'package__name:+' ordering_string 'package__name:+' package <Package: Package object> package_id '9196' pagesize '25' queryset Error in formatting: FieldError: Non-relational field given in select_related: 'name'. Choices are: build, recipe, customimagepackage request <WSGIRequest: GET '/toastergui/build/3/package_included_reverse_dependencies/3/9196?count=25&page=1&orderby=package__name%3A%2B'> retval None search_term '' target <Target: Target object> target_id '3' template 'package_included_reverse_dependencies.html' #### Log truncated (Tell me if you need the full log) #### Reproducibility --------------- always (5/5) Currently used workaround ------------------------- # This workaround is from 10 minutes of googling with no knowledge about this API # After the workaround is applied the command "source toaster stop" then "source toaster start" need to be executed $ git diff diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index c712b06..5c1ce70 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -1206,7 +1206,7 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_ return _redirect_parameters( 'package_included_reverse_dependencies', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id) (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File) - queryset = Package_Dependency.objects.select_related('depends_on__name', 'depends_on__size').filter(depends_on=package_id, target_id=target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS) + queryset = Package_Dependency.objects.select_related('depends_on').filter(depends_on=package_id, target_id=target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS) objects = _get_queryset(Package_Dependency, queryset, filter_string, search_term, ordering_string, 'package__name') package = Package.objects.get(pk=package_id)
Reproduced on master with the same steps.
Reproduced on Thud with project created from the Toaster GUI
Interesting. You found a bug and provided a potential fix, thank you! I will take a look. I am curious why I have not hit this error path.
(In reply to comment #3) > Interesting. You found a bug and provided a potential fix, thank you! > > I will take a look. I am curious why I have not hit this error path. I know this worked before in a previous release (Krogoth or Rocko) as I used Toaster for "Why is this file/package in my image?" investigations, not really sure when it broke. Feel free to use the workaround/fix but keep in mind I had no idea what I was doing, just trying solutions to the error from stackoverflow until one of them worked, I don't know how removing that parameter and renaming the other "fixed" the issue. Tell me if you need me to run any tests or trials, I will gladly do so.
commit 4f959dff769f37d745daf705dd169704656e0ba3