Unit hooks fail on windows if PATH is uppercase

Bug #1446871 reported by Martin Packman on 2015-04-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
High
Nate Finch
1.24
High
Nate Finch

Bug Description

The uniter hook var population code does not correctly handle the case-insensitive case-preserving nature of environment variables on windows. Any windows machine with casing of the path variable other than 'Path' will fail to find hook tools.

On the CI windows vm unit test run, this manifests as the following test failures:

<http://data.vapour.ws/juju-ci/products/version-2549/run-unit-tests-win2012-amd64/build-276/consoleText>

 FAIL: uniter_test.go:1352: UniterSuite.TestActionEvents
 FAIL: uniter_test.go:1894: UniterSuite.TestLeadership
 FAIL: uniter_test.go:1755: UniterSuite.TestReboot
 FAIL: util_windows_test.go:87: UniterSuite.TestRunCommand
 FAIL: uniter_test.go:1278: UniterSuite.TestUniterCollectMetrics
 FAIL: uniter_test.go:291: UniterSuite.TestUniterConfigChangedHook
 FAIL: uniter_test.go:399: UniterSuite.TestUniterDyingReaction
 FAIL: uniter_test.go:675: UniterSuite.TestUniterErrorStateUpgrade
 FAIL: uniter_test.go:365: UniterSuite.TestUniterHookSynchronisation
 FAIL: uniter_test.go:165: UniterSuite.TestUniterInstallHook
 FAIL: uniter_test.go:1267: UniterSuite.TestUniterMeterStatusChanged
 FAIL: uniter_test.go:1205: UniterSuite.TestUniterRelationErrors
 FAIL: uniter_test.go:1085: UniterSuite.TestUniterRelations
 FAIL: uniter_test.go:208: UniterSuite.TestUniterStartHook
 FAIL: uniter_test.go:448: UniterSuite.TestUniterSteadyStateUpgrade
 FAIL: uniter_test.go:1674: UniterSuite.TestUniterSubordinates
 ...
 [LOG] 0:03.493 INFO unit.u/0.install
 c:\users\...\agents\unit-u-0\charm>juju-log.exe
 deadbeef-0bad-400d-8000-4b1d0d06f00d install
 [LOG] 0:03.493 INFO unit.u/0.install 'juju-log.exe' is not recognized
 as an internal or external command,
 [LOG] 0:03.493 INFO unit.u/0.install operable program or batch file.
 ...
 waiting for hooks: []string{"install", "config-changed", "start"}
 ctx.hooksCompleted: []string{"fail-install"}
 ...
 util_test.go:718:
     c.Fatalf("never got expected hooks")

The mergeEnvironment from juju/utils and copied in juju/juju needs to do case-insensitive variable name matching, similar to the fix already made to juju/testing:

<https://github.com/juju/testing/pull/52>

Nate Finch (natefinch) on 2015-04-23
Changed in juju-core:
assignee: nobody → Nate Finch (natefinch)

A fix is currently under review: http://reviews.vapour.ws/r/1487/

Changed in juju-core:
status: Triaged → In Progress
Curtis Hovey (sinzui) on 2015-04-27
Changed in juju-core:
milestone: 1.24-alpha1 → 1.24.0
Curtis Hovey (sinzui) on 2015-04-27
Changed in juju-core:
milestone: 1.24.0 → 1.25.0
Changed in juju-core:
status: In Progress → Fix Committed
Martin Packman (gz) wrote :

Change as landed is incorrect, the casing logic in mergeEnvironment is wrong (and untested).

Changed in juju-core:
status: Fix Committed → In Progress
Nate Finch (natefinch) wrote :

Can you please explain how the logic is wrong? It definitely is tested, though it's possible the tests are flawed.

Martin Packman (gz) wrote :

Nate, the first merge proposal to fix this was incorrect:

<http://reviews.vapour.ws/r/1487/>

So I commented here, set the bug back to In Progress, and reverted:

<http://reviews.vapour.ws/r/1567/>

You then landed a corrected version:

<http://reviews.vapour.ws/r/1579/>

But apparently only marked this bug as fixed in 1.24, not master.

Changed in juju-core:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers