Intermittent "How do you want to open this file?" dialog on Windows 10 test machines
Categories
(Infrastructure & Operations :: RelOps: Windows OS, task)
Tracking
(Not tracked)
People
(Reporter: johannh, Assigned: grenade)
References
Details
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Reporter | ||
Comment 5•7 years ago
|
||
Assignee | ||
Comment 6•7 years ago
|
||
Reporter | ||
Comment 7•7 years ago
|
||
Assignee | ||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Reporter | ||
Comment 11•7 years ago
|
||
Assignee | ||
Comment 12•7 years ago
|
||
Reporter | ||
Comment 13•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
Comment hidden (Intermittent Failures Robot) |
Comment 15•7 years ago
|
||
Reporter | ||
Comment 16•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 18•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment 22•7 years ago
|
||
Assignee | ||
Comment 23•7 years ago
|
||
Assignee | ||
Comment 24•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Updated•7 years ago
|
Comment 26•7 years ago
|
||
Assignee | ||
Comment 27•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 31•7 years ago
|
||
Comment 32•7 years ago
|
||
Comment 33•7 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 36•6 years ago
|
||
the "How do you want to open this file?" dialog has resurfaced on windows 10 arm64 instances. with a little debugging (selecting notepad as the file association), i see that the file in question contains the following text:
#!/bin/sh
# Copyright (C) 2002, Earnie Boyd
# mailto:earnie@users.sf.net
# This file is part of Minimal SYStem.
# http://www.mingw.org/msys.shtml
# File: cmd "$COMSPEC" "$@"
i'm guessing that something in the mozilla-build install (the installer contains msys) is triggering this.
i will do some more debugging and try to find a way to squash this.
Assignee | ||
Comment 37•6 years ago
|
||
after a little more debugging, i determined that:
-
the file-path being opened during the mozilla-build/msys install is
C:\mozilla-build\msys\bin\cmd
which contains:#!/bin/sh # Copyright (C) 2002, Earnie Boyd # mailto:earnie@users.sf.net # This file is part of Minimal SYStem. # http://www.mingw.org/msys.shtml # File: cmd "$COMSPEC" "$@"
-
crucially, the system
PATH
environment variable incorrectly contained an entry forC:\mozilla-build\msys\bin
before the entry forC:\Windows\System32
-
the default value setting of the system
COMSPEC
environment variable isCMD
these settings create an undesired or unexpected condition when the command cmd
is run without a .exe
suffix since the incorrect PATH
setting causes cmd
to be invoked at C:\mozilla-build\msys\bin\cmd
instead of C:\Windows\System32\cmd.exe
.
the invocation of cmd
by some/any process is then not seen as an executable by the operating system since windows does not treat a file as an executable if it does not have an extension that matches one contained in the PATHEXT
environment variable. instead, windows treats invocations of non-executables as a request to open a file with a name matching the invocation.
hence on our infra, whenever something invokes cmd
on a system where the PATH
contains a C:\mozilla-build\msys\bin
entry before its C:\Windows\System32
entry, windows assumes we want to open the text file at C:\mozilla-build\msys\bin\cmd
instead of invoking C:\Windows\System32\cmd.exe
which is normally what the caller expects to happen.
the fix is to simply correct the PATH
environment variable so that the C:\Windows\System32
entry precedes the C:\mozilla-build\msys\bin
entry.
in occ, we use a dsc component to set the PATH
environment variable. until now, this was achieved by prepending any entries in the manifest component to whatever was already in the system PATH
. eg:
{
"ComponentName": "env_PATH",
"ComponentType": "EnvironmentVariableUniquePrepend",
"Name": "PATH",
"Values": [
...,
"C:\\mozilla-build\\msys\\bin",
...
],
"Target": "Machine"
},
would result in a PATH
var containing: C:\mozilla-build\msys\bin;whatever-was-already-in-PATH
swapping EnvironmentVariableUniquePrepend
for EnvironmentVariableUniqueAppend
would have the desired effect on any new system and result in a PATH
var containing: whatever-was-already-in-PATH;C:\mozilla-build\msys\bin
.
however, i wanted a fix that would also correct any running systems that already have C:\mozilla-build\msys\bin
in PATH
in the wrong order (preceding C:\Windows\System32
). so i modified the implementations of EnvironmentVariableUniquePrepend
and EnvironmentVariableUniqueAppend
so that they first remove any entries from PATH
that also exist in the manifest component, before either appending or prepending all the manifest components to the PATH
, resulting in the desired order of PATH
components.
the fix patch is very simple and is implemented in the aarch64 branch here: https://github.com/mozilla-releng/OpenCloudConfig/commit/27e555c. it will be merged to master in due course
Description
•