Landscape client package-reporter crashes if permission denied

Bug #1719415 reported by Kellen Renshaw
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Landscape Client
Confirmed
Undecided
Unassigned

Bug Description

Landscape package-reporter fails with the following error:
2017-09-25 19:16:23,520 WARNING [MainThread] Package reporter output:
Traceback (most recent call last):
  File "/usr/bin/landscape-package-reporter", line 10, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/landscape/package/reporter.py", line 726, in main
    return run_task_handler(PackageReporter, args)
  File "/usr/lib/python2.7/dist-packages/landscape/package/taskhandler.py", line 287, in run_task_handler
    from landscape.package.facade import AptFacade
  File "/usr/lib/python2.7/dist-packages/landscape/package/facade.py", line 17, in <module>
    import apt
  File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 34, in <module>
    apt_pkg.init_config()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/test - ifstream::ifstream (13: Permission denied)

Reproducible by:
1) Have Landscape server
2) Install landscape-client (used 16.03-0ubuntu2.16.04.1) and configure/register.
3) sudo touch /etc/apt/apt.conf.d/test
4) sudo chmod a-rwx /etc/apt/apt.conf.d/test
5) Package reporter now crashes with the above error.

Tags: lds-squad
tags: added: lds-squad
Revision history for this message
Fabio B (illobo) wrote :

Can confirm, been able to reproduce

2018-02-08 14:07:56,977 WARNING [MainThread] Package reporter output:
Traceback (most recent call last):
  File "/usr/bin/landscape-package-reporter", line 10, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/landscape/package/reporter.py", line 762, in main
    return run_task_handler(PackageReporter, args)
  File "/usr/lib/python2.7/dist-packages/landscape/package/taskhandler.py", line 287, in run_task_handler
    from landscape.package.facade import AptFacade
  File "/usr/lib/python2.7/dist-packages/landscape/package/facade.py", line 17, in <module>
    import apt
  File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 34, in <module>
    apt_pkg.init_config()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/20auto-upgrades - ifstream::ifstream (13: Permission denied)

This happened with /etc/apt/apt.conf.d/20auto-upgrades permissions set to 600.

To note also, this error gets flagged as "WARNING" so not directly evident, but prevents package-reporter to work properly.

Changed in landscape-client:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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