<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8472</bug_id>
          
          <creation_ts>2015-10-09 13:01:15 +0000</creation_ts>
          <short_desc>[1.8] Downloading artifacts fails with error page</short_desc>
          <delta_ts>2016-01-15 11:47:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>1.8.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.yoctoproject.org/show_bug.cgi?id=8369</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mihail Stanciu">stanciux.mihail</reporter>
          <assigned_to name="Elliot Smith">elliot.smith</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55111</commentid>
    <comment_count>0</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-10-09 13:01:15 +0000</bug_when>
    <thetext>Tested on 1.8.1: b74ea963cefffad9fbd91d4eb9b240f6a8c86cd0
OS: Ubuntu 15.04, Fedora 22

Steps:
1. Open toaster.
2. Create project &amp; build an image (core-image-minimal)
3. Once image finishes, go to build summary page and try to download any artifact resulted from the build, or the build log.

Expected:
Download begins.

Observed:
Toaster throws up an error page.

Error log:
Environment:


Request Method: GET
Request URL: http://localhost:8000/toastergui/build/2/artifact/imagefile/id/5

Django Version: 1.6
Python Version: 2.7.9
Installed Applications:
(&apos;django.contrib.auth&apos;,
 &apos;django.contrib.contenttypes&apos;,
 &apos;django.contrib.messages&apos;,
 &apos;django.contrib.sessions&apos;,
 &apos;django.contrib.admin&apos;,
 &apos;django.contrib.staticfiles&apos;,
 &apos;django.contrib.humanize&apos;,
 &apos;orm&apos;,
 &apos;toastermain&apos;,
 &apos;south&apos;,
 &apos;bldcontrol&apos;,
 &apos;bldviewer&apos;,
 &apos;toastergui&apos;)
Installed Middleware:
(&apos;django.middleware.common.CommonMiddleware&apos;,
 &apos;django.contrib.sessions.middleware.SessionMiddleware&apos;,
 &apos;django.middleware.csrf.CsrfViewMiddleware&apos;,
 &apos;django.contrib.auth.middleware.AuthenticationMiddleware&apos;,
 &apos;django.contrib.messages.middleware.MessageMiddleware&apos;)


Traceback:
File &quot;/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py&quot; in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File &quot;/home/dave/FP_1.8.1/poky/bitbake/lib/toaster/toastergui/views.py&quot; in build_artifact
  3196.             return _get_be_artifact(request, build_id, artifact_type, artifact_id)
File &quot;/home/dave/FP_1.8.1/poky/bitbake/lib/toaster/toastergui/views.py&quot; in _get_be_artifact
  3212.                 content_type = b.buildrequest.environment.get_artifact_type(file_name)
File &quot;/home/dave/FP_1.8.1/poky/bitbake/lib/toaster/bldcontrol/models.py&quot; in get_artifact_type
  59.                     m = magic.Magic(magic.MAGIC_MIME)
File &quot;/usr/local/lib/python2.7/dist-packages/magic/identify.py&quot; in __init__
  66.         pathstr = b&apos;:&apos;.join(iter_encode(paths)) if paths else None
File &quot;/usr/local/lib/python2.7/dist-packages/magic/compatability.py&quot; in iter_encode
  40.     for item in iterable:

Exception Type: TypeError at /toastergui/build/2/artifact/imagefile/id/5
Exception Value: &apos;int&apos; object is not iterable</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55116</commentid>
    <comment_count>1</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-10-09 13:30:32 +0000</bug_when>
    <thetext>Please test on toaster-next, as this bug should be fixed there, but the commits have not yet made it to master (see bug 8369).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55117</commentid>
    <comment_count>2</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-10-09 13:31:43 +0000</bug_when>
    <thetext>This error message is the same as the one in bug 8369 and has the same root cause.

*** This bug has been marked as a duplicate of bug 8369 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55121</commentid>
    <comment_count>3</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-10-09 14:13:57 +0000</bug_when>
    <thetext>Reopening. Waiting for confirmation if fix will be back-ported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55239</commentid>
    <comment_count>4</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-10-13 08:43:10 +0000</bug_when>
    <thetext>The necessary patches are dd957fe0f261db6481882fee0413f459425000c2 and ce9011a9dea4d4f8040170c28031cfbcadfbfd81 on poky master, if we decide to backport them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55339</commentid>
    <comment_count>5</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-10-15 09:35:25 +0000</bug_when>
    <thetext>I&apos;ve had a quick look, and think it should be fairly trivial to backport this to 1.8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56595</commentid>
    <comment_count>6</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2015-11-18 16:44:56 +0000</bug_when>
    <thetext>This has been REOPENED</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56903</commentid>
    <comment_count>7</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-12-01 16:28:35 +0000</bug_when>
    <thetext>My branch is here:

poky-contrib, elliot/toaster/backport_mimetype_fixes-8472

This contains a single commit on top of a checkout of the fido branch.

However, I am unable to get a working version of Toaster 1.8 to test it.

Would someone be willing to test this for me, please? Maybe Mihail?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56932</commentid>
    <comment_count>8</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-12-02 10:29:59 +0000</bug_when>
    <thetext>I&apos;ve now managed to test this, and will submit the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57356</commentid>
    <comment_count>9</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-12-17 17:38:23 +0000</bug_when>
    <thetext>Submitted to Toaster mailing list for review

https://lists.yoctoproject.org/pipermail/toaster/2015-December/003452.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57860</commentid>
    <comment_count>10</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-01-15 11:47:40 +0000</bug_when>
    <thetext>Commit now on fido branch:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=fido&amp;id=6e3eefb997063971801bea933f319bb428b33fa5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>