Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device unauthorized errors during Android device CI runs #47185

Closed
steveisok opened this issue Jan 19, 2021 · 10 comments
Closed

Device unauthorized errors during Android device CI runs #47185

steveisok opened this issue Jan 19, 2021 · 10 comments

Comments

@steveisok
Copy link
Member

Example build: https://dev.azure.com/dnceng/public/_build/results?buildId=956492&view=results

Example log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47057-merge-86b88422cf374fa882/Microsoft.Extensions.Configuration.Json.Tests/console.d1b0ae97.log?sv=2019-07-07&se=2021-02-08T18%3A02%3A12Z&sr=c&sp=rl&sig=DtoVG0NJIQ9Th%2BgD5IONKr3jkRUFCMvsp6U61UZ9QtE%3D

Adb seems to be claiming that the device is unauthorized, which causes a bunch of tests to not run and fail. I'm not sure if this is machine specific or device specific. I'm seeing numerous BadExit's on DNCENGWIN-036 and 30.

[10:02:24] fail: Error trying to get device architecture: error: device unauthorized.
                 This adb server's $ADB_VENDOR_KEYS is not set
                 Try 'adb kill-server' if that seems wrong.
                 Otherwise check for a confirmation dialog on your device.
                 
[10:02:24] crit: Failure to run test package: Object reference not set to an instance of an object.
                 System.NullReferenceException: Object reference not set to an instance of an object.
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.<>c__DisplayClass17_0.<GetDeviceToUse>b__0(KeyValuePair`2 kvp) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 259
                    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.GetDeviceToUse(ILogger logger, AdbRunner runner, String apkRequiredArchitecture) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 259
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 99
XHarness exit code: 71

C:\h\w\A9ED09B0\w\B03109F7\e>set _commandExitCode=71 
@ghost
Copy link

ghost commented Jan 19, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Example build: https://dev.azure.com/dnceng/public/_build/results?buildId=956492&view=results

Example log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47057-merge-86b88422cf374fa882/Microsoft.Extensions.Configuration.Json.Tests/console.d1b0ae97.log?sv=2019-07-07&se=2021-02-08T18%3A02%3A12Z&sr=c&sp=rl&sig=DtoVG0NJIQ9Th%2BgD5IONKr3jkRUFCMvsp6U61UZ9QtE%3D

Adb seems to be claiming that the device is unauthorized, which causes a bunch of tests to not run and fail. I'm not sure if this is machine specific or device specific. I'm seeing numerous BadExit's on DNCENGWIN-036 and 30.

[10:02:24] fail: Error trying to get device architecture: error: device unauthorized.
                 This adb server's $ADB_VENDOR_KEYS is not set
                 Try 'adb kill-server' if that seems wrong.
                 Otherwise check for a confirmation dialog on your device.
                 
[10:02:24] crit: Failure to run test package: Object reference not set to an instance of an object.
                 System.NullReferenceException: Object reference not set to an instance of an object.
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.<>c__DisplayClass17_0.<GetDeviceToUse>b__0(KeyValuePair`2 kvp) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 259
                    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.GetDeviceToUse(ILogger logger, AdbRunner runner, String apkRequiredArchitecture) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 259
                    at Microsoft.DotNet.XHarness.CLI.Commands.Android.AndroidTestCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidTestCommand.cs:line 99
XHarness exit code: 71

C:\h\w\A9ED09B0\w\B03109F7\e>set _commandExitCode=71 
Author: steveisok
Assignees: -
Labels:

area-Infrastructure-mono, os-android

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jan 19, 2021
@steveisok
Copy link
Member Author

/cc @MattGal

@MattGal
Copy link
Member

MattGal commented Jan 19, 2021

Sure seems device-specific ... @akoeplinger any suggestions? We can just teach it to try the suggested workaround of kill-server in this case too.

@akoeplinger
Copy link
Member

akoeplinger commented Jan 21, 2021

Hm we should try if killing the adb server works, but it's possible that the device lost authentication and someone needs to re-auth it on the phone.

@ViktorHofer
Copy link
Member

Most likely mitigated with fixes mentioned in https://github.com/dotnet/core-eng/issues/11891.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 31, 2021
@mdh1418
Copy link
Member

mdh1418 commented Apr 21, 2021

I'm seeing this happening for the following test suites

System.ComponentModel.Primitives.Tests.csproj
System.Diagnostics.StackTrace.Tests.csproj
System.Linq.Parallel.Tests.csproj
System.Linq.Queryable.Tests.csproj
System.Linq.Tests.csproj
System.Memory.Data.Tests.csproj
System.Memory.Tests.csproj
System.Net.Connections.Tests.csproj
System.Private.Uri.ExtendedFunctional.Tests.csproj
System.Resources.Extensions.Tests.csproj
System.Runtime.Serialization.Json.ReflectionOnly.Tests.csproj
System.Runtime.Serialization.Xml.ReflectionOnly.Tests.csproj
System.Security.Claims.Tests.csproj
System.Security.Cryptography.Encoding.Tests.csproj
System.Security.Cryptography.X509Certificates.Tests.csproj
System.Security.Cryptography.Xml.Tests.csproj
System.Xml.Linq.SDMSample.Tests.csproj
System.Xml.RW.SubtreeReader.Tests.csproj

based on https://dev.azure.com/dnceng/public/_build/results?buildId=1093022&view=logs&j=c693b1a1-52cc-5241-304f-e4b4c2d5f73e&t=ca6cd8a5-c31d-5a98-8419-f200a8c4128d from test runs in #50095

@mdh1418 mdh1418 reopened this Apr 21, 2021
@MattGal
Copy link
Member

MattGal commented Apr 21, 2021

@mdh1418 it's more likely related to specific devices versus the tests but we'll take a look and get an issue created if so.

@akoeplinger
Copy link
Member

@MattGal this ended up being the devices right: https://github.com/dotnet/core-eng/issues/12841 ?

@MattGal
Copy link
Member

MattGal commented Apr 22, 2021

@MattGal this ended up being the devices right: dotnet/core-eng#12841 ?

I think so... but they seem to be going bad more often. Is it possible that a sufficiently weird APK could cause the problem? (@parose1 would be interested in the answer)

@akoeplinger
Copy link
Member

Hard to say, we'd need to know in what state the device is then we could maybe track down how it got there by correlating which workitems ran around the time it went bad.

@marek-safar marek-safar removed the untriaged New issue has not been triaged by the area owner label Jun 1, 2021
@marek-safar marek-safar added this to the Future milestone Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants