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

Bug #1765518 reported by Gabriel Ramirez on 2018-04-19
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Low
Simon Poirier
landscape-client (Ubuntu)
Low
Simon Poirier
Bionic
Low
Simon Poirier
Cosmic
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]

 * 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) on 2018-04-19
Changed in landscape:
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in landscape:
status: New → Confirmed
status: Confirmed → Triaged
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) on 2018-07-13
Changed in landscape:
assignee: nobody → Dave Jones (waveform)
status: Triaged → In Progress
Dave Jones (waveform) on 2018-07-25
information type: Proprietary → Public
affects: landscape → landscape-client
Dave Jones (waveform) on 2018-07-31
Changed in landscape-client:
status: In Progress → Fix Committed
Simon Poirier (simpoir) on 2018-11-01
description: updated
tags: added: lds-squad
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

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".

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".

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
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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers