Can't execute scripts on a landscape-client that has non-ascii character in its tag

Bug #1765518 reported by Gabriel Ramirez
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Committed
Low
Simon Poirier
landscape-client (Ubuntu)
Fix Released
Low
Simon Poirier
Bionic
Fix Released
Low
Simon Poirier
Cosmic
Fix Released
Low
Simon Poirier

Bug Description

[Impact]

 * Script execution fails on computers with non-ascii tags

 * This is a fairly simple bugfix which is easy to trigger

[Test Case]

 * Unset locale (/etc/default/locale)

 * Tagging a client with accented characters and running a simple
   "echo script" should be enough to validate the encoding correction.

[Regression Potential]

 * The tag encoding change for scripts is trivial for recent clients.
   It affects only code related to running shell script and, assuming bad
   system encoding, should still work the same for ASCII tags.

 * However, the nature of python2.7 handling of encoding for trusty
   and xenial is different enough for this patch not to be included
   for them, thus avoiding regressions on those clients.

[Original Description]

Steps to reproduce:

1) Add tag to a landscape-client, ex assgn tag 'täg
2) Go to scripts in the GUI page and attempt to execute script on that client
3) Script will attempt to run on client and will fail, GUI will show below error:

[Failure instance: Traceback: <type 'exceptions.TypeError'>: Environment contains a non-string value
/usr/lib/python2.7/dist-packages/landscape/manager/scriptexecution.py:176:_handle_execute_script
/usr/lib/python2.7/dist-packages/landscape/manager/scriptexecution.py:292:run_script
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:306:addCallback
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:295:addCallbacks
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:577:_runCallbacks
/usr/lib/python2.7/dist-packages/landscape/manager/scriptexecution.py:290:prepare_script
/usr/lib/python2.7/dist-packages/landscape/manager/scriptexecution.py:129:_run_script
/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py:336:spawnProcess
/usr/lib/python2.7/dist-packages/twisted/internet/base.py:923:_checkProcessArgs
]

Above exception is generated by the client w/ LANDSCAPE_COMPUTER_TAGS value being None

Related branches

description: updated
Simon Poirier (simpoir)
Changed in landscape:
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in landscape:
status: New → Confirmed
status: Confirmed → Triaged
Revision history for this message
Simon Poirier (simpoir) wrote :

Easily reproduced by setting accented tags (e.g. éàµ) on a fresh computer. This also appears to affect xenial.

Dave Jones (waveform)
Changed in landscape:
assignee: nobody → Dave Jones (waveform)
status: Triaged → In Progress
Revision history for this message
Dave Jones (waveform) wrote :
Dave Jones (waveform)
information type: Proprietary → Public
affects: landscape → landscape-client
Dave Jones (waveform)
Changed in landscape-client:
status: In Progress → Fix Committed
Simon Poirier (simpoir)
description: updated
tags: added: lds-squad
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Fix released in disco.

Changed in landscape-client:
assignee: Dave Jones (waveform) → Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu):
status: New → Fix Released
Changed in landscape-client (Ubuntu Cosmic):
status: New → In Progress
assignee: nobody → Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu):
assignee: nobody → Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu):
importance: Undecided → Low
Changed in landscape-client (Ubuntu Bionic):
importance: Undecided → Low
Changed in landscape-client (Ubuntu Cosmic):
importance: Undecided → Low
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Proposed package upload rejected

An upload of landscape-client to cosmic-proposed has been rejected from the upload queue for the following reason: "Includes a change without an SRU bug attached to it".

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

An upload of landscape-client to bionic-proposed has been rejected from the upload queue for the following reason: "Includes a change without an SRU bug attached to it".

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Gabriel, or anyone else affected,

Accepted landscape-client into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/18.01-0ubuntu4.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in landscape-client (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Changed in landscape-client (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Gabriel, or anyone else affected,

Accepted landscape-client into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/18.01-0ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Simon Poirier (simpoir)
description: updated
tags: added: verification-done-bionic verification-done-cosmic
removed: verification-needed verification-needed-bionic verification-needed-cosmic
Revision history for this message
Simon Poirier (simpoir) wrote :

I tested landscape-client and landscape-common for both bionic-proposed and cosmic-proposed.
Then I reset the locale config, enabled script execution, set some fancy unicode tags and ran a script successfully.

The script ran successfully on both bionic and cosmic, as can be seen here https://screenshots.firefox.com/oiRDpc3KehjKjG3g/landscape.canonical.com

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 18.01-0ubuntu4.1

---------------
landscape-client (18.01-0ubuntu4.1) cosmic; urgency=medium

  * debian/patches/nutanix-kvm.patch: Update vm_info.py to include Nutanix
    hypervisor. (LP: #1788219)
  * Fixes for release-upgrade:
    - debian/patches/release-upgrade-success.patch: Enable landscape-client to
      survive trusty upgrade. (LP: #1670291)
    - debian/patches/post-upgrade-reboot.patch: Force reboot operation in
      case systemd fails. (LP: #1670291)
  * debian/patches/unicode-tags-script.patch: Permit environments
    containing unicode chars for script execution. (LP: #1765518)
  * debian/patches/1616116-resync-loop.patch:
    Clear hash id database on package resync. (LP: #1616116)

 -- Simon Poirier <email address hidden> Tue, 27 Nov 2018 09:24:22 -0500

Changed in landscape-client (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for landscape-client has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 18.01-0ubuntu3.2

---------------
landscape-client (18.01-0ubuntu3.2) bionic; urgency=medium

  * debian/patches/nutanix-kvm.patch: Update vm_info.py to include Nutanix
    hypervisor. (LP: #1788219)
  * Fixes for release-upgrade:
    - debian/patches/release-upgrade-success.patch: Enable landscape-client to
      survive trusty upgrade. (LP: #1670291)
    - debian/patches/post-upgrade-reboot.patch: Force reboot operation in
      case systemd fails. (LP: #1670291)
  * debian/patches/unicode-tags-script.patch: Permit environments
    containing unicode chars for script execution. (LP: #1765518)
  * debian/patches/1616116-resync-loop.patch:
    Clear hash id database on package resync. (LP: #1616116)

 -- Simon Poirier <email address hidden> Tue, 27 Nov 2018 09:24:22 -0500

Changed in landscape-client (Ubuntu Bionic):
status: Fix Committed → Fix Released
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.