Intermittent "How do you want to open this file?" dialog on Windows 10 test machines

RESOLVED FIXED

Status

Infrastructure & Operations
RelOps
RESOLVED FIXED
7 months ago
2 months ago

People

(Reporter: johannh, Assigned: grenade)

Tracking

(Depends on: 1 bug, Blocks: 3 bugs)

Details

(Reporter)

Description

7 months ago
We recently enabled screenshot comparison testing on Windows 10, but unfortunately there's this dialog intermittently showing up in the middle of our screenshots:

https://public-artifacts.taskcluster.net/e64PfNZtTK-Btd5LkkAGhg/0/public/test_info/20170614013944-permissionPrompts_04_noLWT_shareScreen.png

This leads to a lot of falsely reported differences such as:

https://screenshots.mattn.ca/comparisons/mozilla-central/b266a8d8fd595b84a7d6218d7b8c6b7af0b5027c/mozilla-central/ad3f1138ce6f199408ad58d65c7476636e924909/windows10-64-vm/permissionPrompts_04_noLWT_shareScreen.png

You can find the whole gallery if you uncheck "known inconsistencies" on https://screenshots.mattn.ca/compare/?oldProject=mozilla-central&oldRev=b266a8d8fd595b84a7d6218d7b8c6b7af0b5027c&newProject=mozilla-central&newRev=ad3f1138ce6f199408ad58d65c7476636e924909&filter=windows10

This effectively prevents us from enabling automatic reporting on Windows 10.

Since it's intermittent (and mozscreenshots is not opening a .txt file to my knowledge), I suspect it's not the test's fault.

It would be interesting to know which file it's trying to open.

The screenshots are from this job: https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=b266a8d8fd595b84a7d6218d7b8c6b7af0b5027c&filter-tier=1&filter-tier=2&filter-tier=3&filter-searchStr=ss&selectedJob=106884521
Assignee: relops → rthijssen
:ahal, could you help figure out what might be causing this?  Possibly this is something outside of the tests and has nothing to do, but I suspect this is related to tests running or something in the land of the firefox browser session
Flags: needinfo?(ahalberstadt)
Hm, this isn't ringing any bells and I can't think of anytime Firefox would randomly try to open a text file unsolicited. To be clear, the tests aren't trying to open anything? You could check mimeTypes.rdf in the profile for any suspicious handling of .txt.. Maybe it could be set to always save to disk or something.

Or maybe setting browser.download.loglevel=info might provide some useful info in the Gecko logs?
Flags: needinfo?(ahalberstadt)
(Reporter)

Comment 3

7 months ago
I haven't spent a lot of time looking into this yet, my idea that this is not coming from our tests is because:

- There's no txt in mozscreenshots: https://searchfox.org/mozilla-central/search?q=txt&path=mozscreenshots
- The download icon isn't blue, which it would be if we downloaded anything in this session.
- Shouldn't it show the Firefox "Open With" dialog instead if it was opened with Firefox?
- As I mentioned, it's intermittent.
It's intermittent, and cross-suite (see also bug 1373567, I'd be astonished if a jsreftest tries to open a text file). Much more likely to be one of "something in the pre-run setup intermittently fails in a way that tries to open a text file" or "something that only runs on the first pre-run setup of a new instance always tries to open a text file."
(Reporter)

Updated

7 months ago
Blocks: 1332945
(Reporter)

Comment 5

6 months ago
FWIW I think this is also failing my browser_contextmenu_touch.js test https://treeherder.mozilla.org/#/jobs?repo=try&revision=5f78950e60fe0c0b6570a9be6a3f2178f863371d&selectedJob=113820104

Rob, can you let us know how this is progressing? Having a consistent Windows 10 test environment is getting more and more important for Photon development as we progress.
Flags: needinfo?(rthijssen)
(Assignee)

Comment 6

6 months ago
apologies for the delay on sorting this. i'm hoping that explicitly setting notepad as the default text editor will prevent this dialogue from popping up. https://github.com/mozilla-releng/OpenCloudConfig/commit/efad455766c55d8166b984591adbf901b39f30ec
Flags: needinfo?(rthijssen)
(Reporter)

Comment 7

6 months ago
Ah, cool, thanks! Can we expect this to trickle into the normal build architecture now (i.e. are you looking for feedback on whether this works in the mentioned test cases) or is that an additional step? :)
(Assignee)

Comment 8

6 months ago
yes, i'm hoping to see that we don't get further occurrences of the popup mentioned in comment 0. the change in OpenCloudConfic is propagated to the win 10 testers
I want to make sure we're on the same page here... :johannh are you testing on buildbot hardware testers or are you using on taskcluster testers? The changes rob is making will only show up on taskcluster. Rob, can you please make sure this also gets ported to the w10 buildbot testers since that's what people are currently using for production talos tests?
Flags: needinfo?(jhofmann)
(Reporter)

Comment 10

6 months ago
I'm on taskcluster AFAUI :)
Flags: needinfo?(jhofmann)
(Assignee)

Comment 12

6 months ago
tried and failed to reproduce:
- created a loaner (https://tools.taskcluster.net/groups/Gwx3p81ET7SCGswa0fjD8g/tasks/Gwx3p81ET7SCGswa0fjD8g/details)
- rdp'd to loaner and created a new user account without admin privs, closed connection
- rdp'd to loaner as unprivileged user and ran following commands (derived from failed task in comment 11):
z:
mkdir task_grenade && cd task_grenade
wget https://queue.taskcluster.net/v1/task/SNsrvZ91SA21R-FN1-Td9A/runs/0/artifacts/public/build/mozharness.zip
7z x mozharness.zip
c:\mozilla-build\python\python.exe -u mozharness\scripts\desktop_unittest.py --cfg mozharness\configs\unittests\win_taskcluster_unittest.py --mochitest-suite=browser-chrome-screenshots --no-read-buildbot-config --installer-url https://queue.taskcluster.net/v1/task/SNsrvZ91SA21R-FN1-Td9A/artifacts/public/build/target.zip --test-packages-url https://queue.taskcluster.net/v1/task/SNsrvZ91SA21R-FN1-Td9A/artifacts/public/build/target.test_packages.json --download-symbols ondemand --mochitest-suite=browser-chrome-screenshots
- tests ran and failed but for other reasons. there were no screenshots containing the popup for txt file association and checking file associations by double clicking on an .txt file in explorer resulted in the file being opened by notepad.exe without a prompt.

not sure where to go at this point as the problem appears to be intermittent. if we knew what process was attempting to open a text file and what text file, that would be useful too. generic-worker on this worker type (gecko-t-win10-64) is an older version (8.3.0) which runs under the GenericWorker user account. so i'll also attempt to set file associations for that user (https://github.com/mozilla-releng/OpenCloudConfig/commit/fe1f4bb718d00c10e57574af02460b55943738f8). i guess we'll see in the coming days if the problem persists.
(Reporter)

Updated

6 months ago
Blocks: 1326419
(Reporter)

Updated

6 months ago
See Also: → bug 1382988

Comment 14

5 months ago
14 failures in 888 pushes (0.016 failures/push) were associated with this bug in the last 7 days.   

Repository breakdown:
* mozilla-central: 9
* autoland: 3
* mozilla-inbound: 2

Platform breakdown:
* windows10-64: 14

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-07-31&endday=2017-08-06&tree=all
:grenade, can you look into this again, it seems as though we are still getting many instances of this (screenshots and marionette  historically, now in jsreftests)- what looks to be when we start up the browser.
Flags: needinfo?(rthijssen)

Comment 17

5 months ago
22 failures in 901 pushes (0.024 failures/push) were associated with this bug in the last 7 days.   

Repository breakdown:
* autoland: 12
* mozilla-inbound: 7
* mozilla-central: 3

Platform breakdown:
* windows10-64: 22

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-08-07&endday=2017-08-13&tree=all
(Assignee)

Comment 18

5 months ago
apologies for the delay, i will look into this again on monday
Duplicate of this bug: 1298796

Comment 21

5 months ago
14 failures in 949 pushes (0.015 failures/push) were associated with this bug in the last 7 days.   

Repository breakdown:
* autoland: 7
* mozilla-inbound: 5
* mozilla-central: 2

Platform breakdown:
* windows10-64: 13
* windows10-64-stylo: 1

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-08-14&endday=2017-08-20&tree=all
Blocks: 1386590
:grenade, how is this investigation coming along?  we continue to find more tests that are failing and suspect this is the root cause based on the screenshots.
Blocks: 1357082
(Assignee)

Comment 23

5 months ago
still scratching my head on this one.

i created a task [1] on windows 10 which just runs the commands `assoc` and `ftype` which show us (assoc) what filetype an extension is associated to and (ftype) what program is configured to open each filetype.

the task log shows that:
- .txt extensions are correctly associated with file type txtfile (.txt=txtfile)
- txtfile file types are configured to be opened with notepad (txtfile="C:\Windows\System32\Notepad.exe" "%1").

the screenshot suggests that windows doesn't know what to open .txt files with, but the only mechanism i know of for setting or checking the file associations confirms that the file association is correctly set.

[1]: https://tools.taskcluster.net/groups/N9RKmbmqROmVWKSbU9GZ0Q/tasks/N9RKmbmqROmVWKSbU9GZ0Q/runs/0
Flags: needinfo?(rthijssen)
(Assignee)

Comment 24

5 months ago
found a comment on the web suggesting that if windows detects a new program installed that has capability to open the filetype, it causes the popup. the registry setting below is supposed to prevent this

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
"NoNewAppAlert"=dword:00000001

testing now:
https://github.com/mozilla-releng/OpenCloudConfig/commit/9df98cb867b1e47da36c390c7dcb32b75d7603ee

Comment 25

5 months ago
2 failures in 908 pushes (0.002 failures/push) were associated with this bug in the last 7 days.   

Repository breakdown:
* mozilla-inbound: 2

Platform breakdown:
* windows10-64-stylo: 1
* windows10-64: 1

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-08-21&endday=2017-08-27&tree=all
(Assignee)

Updated

4 months ago
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → FIXED
(In reply to Rob Thijssen (:grenade - UTC+3) from comment #24)
> found a comment on the web suggesting that if windows detects a new program
> installed that has capability to open the filetype, it causes the popup. the
> registry setting below is supposed to prevent this

Interesting... but why is there a new program installed during testing?
(Assignee)

Comment 27

4 months ago
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #26)
> Interesting... but why is there a new program installed during testing?

there isn't. it happens during the instance setup. it's just recognising a change from default (notepad only) setup at any point. not specifically during the test run.

Comment 28

3 months ago
5 failures in 864 pushes (0.006 failures/push) were associated with this bug in the last 7 days.    

Repository breakdown:
* autoland: 3
* mozilla-inbound: 2

Platform breakdown:
* windows10-64: 5

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-10-16&endday=2017-10-22&tree=all

Comment 29

3 months ago
18 failures in 912 pushes (0.02 failures/push) were associated with this bug in the last 7 days.    

Repository breakdown:
* autoland: 13
* mozilla-inbound: 3
* mozilla-central: 2

Platform breakdown:
* windows10-64: 18

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-10-23&endday=2017-10-29&tree=all

Comment 30

2 months ago
6 failures in 857 pushes (0.007 failures/push) were associated with this bug in the last 7 days.    

Repository breakdown:
* autoland: 4
* mozilla-central: 2

Platform breakdown:
* windows10-64: 6

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-10-30&endday=2017-11-05&tree=all
(Assignee)

Comment 31

2 months ago
pmoore: some of the failures being associated with this bug actually look like this:
https://public-artifacts.taskcluster.net/RajWsgBMRuab7kL4wxTGXw/0/public/test_info/mozilla-test-fail-screenshot_dc4jdj.png

as you can see, it's a different dialog to the "how do you want to open this file" popup. the screen obscuring the browser test is actually the cmd screen that launches generic worker.

the output shown on the screen is from this command:
https://github.com/mozilla-releng/OpenCloudConfig/blob/aaee6a1b/userdata/Configuration/GenericWorker/run-generic-worker-format-and-reboot.bat#L3

i'm confused as to why the script which launches generic worker is visible while generic worker is running. it seems like this is an intermittent issue rather than a persistent one. i'm guessing that its not the same instance of the script as the one actually running gw (eg: it's a subsequent run). perhaps we need some logic in this script that allows only a single running instance?

any ideas?
Flags: needinfo?(pmoore)
No ideas - although this should go away with bug 1399401.
Depends on: 1399401
Flags: needinfo?(pmoore)
The reason I say this, is that generic-worker 10 runs as a windows service, rather than a login script triggered by a scheduled task.

I'm guessing this worker type runs as current user too, I think not running as current user would also solve this, but I'm guessing there are reasons we can't do this.

There may be other ways to fix this rather than the solution in bug 1399401 but I think getting that bug out is the best way forward as it simplifies (and standardises) our setup in so many ways. However, if that bug takes too long to roll out, there may be other approaches.

I'm at a rust training this week in Paris, so won't get a chance to look at this properly until at least next week.

Comment 34

2 months ago
5 failures in 849 pushes (0.006 failures/push) were associated with this bug in the last 7 days.    

Repository breakdown:
* mozilla-inbound: 4
* autoland: 1

Platform breakdown:
* windows10-64: 5

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-11-06&endday=2017-11-12&tree=all

Comment 35

2 months ago
1 failures in 762 pushes (0.001 failures/push) were associated with this bug in the last 7 days.    

Repository breakdown:
* mozilla-inbound: 1

Platform breakdown:
* windows10-64: 1

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1373551&startday=2017-11-13&endday=2017-11-19&tree=all
You need to log in before you can comment on or make changes to this bug.