Reading apparmor policy json fails with ValueError: Expecting value: line 1 column 1 (char 0)

Bug #1375326 reported by Nicholas Skaggs
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
click-reviewers-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Using click-review against a locally built click for the clock app causes the traceback below. I've attached the click to the report. Note the trunk version of the package reads the click properly.

$ click-review com.ubuntu.clock_3.1.126_amd64.click
Traceback (most recent call last):
  File "/usr/bin/click-review", line 137, in <module>
    main()
  File "/usr/bin/click-review", line 131, in main
    results.run_all_checks()
  File "/usr/bin/click-review", line 104, in run_all_checks
    self._run_module_checks(module)
  File "/usr/bin/click-review", line 90, in _run_module_checks
    review = modules.init_main_class(module, self.click_fn)
  File "/usr/lib/python3/dist-packages/clickreviews/modules.py", line 71, in init_main_class
    return init_object(click_file)
  File "/usr/lib/python3/dist-packages/clickreviews/cr_security.py", line 34, in __init__
    p = apparmor_policy.ApparmorPolicy(local_copy)
  File "/usr/lib/python3/dist-packages/clickreviews/apparmor_policy.py", line 38, in __init__
    local_copy_fn)
  File "/usr/lib/python3/dist-packages/clickreviews/remote.py", line 103, in read_cr_file
    j = json.loads(open(fn, 'r').read())
  File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

With trunk (rev 246):

./click-review ../../com.ubuntu.clock_3.1.126_amd64.click
Errors
------
 - lint_manifest_architecture_valid
 not a valid architecture: amd64
 - lint_control_architecture_valid
 not a valid architecture: amd64
 - security_policy_groups_safe_clock (calendar)
 (MANUAL REVIEW) reserved policy group 'calendar': vetted applications only
Warnings
--------
 - lint_click_local_extensions
 found unofficial extensions: x-source, x-test
 - lint_package_filename_arch_valid
 not a valid architecture: amd64
../../com.ubuntu.clock_3.1.126_amd64.click: FAIL

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: click-reviewers-tools 0.10
ProcVersionSignature: Ubuntu 3.16.0-17.23-generic 3.16.3
Uname: Linux 3.16.0-17-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.14.7-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Sep 29 11:39:40 2014
InstallationDate: Installed on 2013-12-19 (283 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20131218)
PackageArchitecture: all
SourcePackage: click-reviewers-tools
UpgradeStatus: Upgraded to utopic on 2014-05-09 (142 days ago)

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I fixed this in r247. We should upload this to Ubuntu.

Changed in click-reviewers-tools (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package click-reviewers-tools - 0.11

---------------
click-reviewers-tools (0.11) utopic; urgency=medium

  [ Jamie Strandboge ]
  * allow 'accounts' policy group with network scopes.
  * fix fetch URL for apparmor json to point to json file, not html page
    (LP: #1375326)
  * check if security policy does not end with .apparmor (LP: #1358317)
  * cleanup all the temp directories on shutdown (LP: #1370577)
  * shouldn't warn when app is coreapp when it uses x-source or x-test
    (LP: #1371180)

  [ Daniel Holbach ]
  * be clearer about unloadable ClickReview classes.
 -- Jamie Strandboge <email address hidden> Mon, 29 Sep 2014 17:01:58 -0500

Changed in click-reviewers-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.