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

Cannot be signed in to GitHub on both VS2015 and VS2017 #1234

Closed
meaghanlewis opened this Issue Sep 18, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@meaghanlewis
Contributor

meaghanlewis commented Sep 18, 2017

Version

  • GitHub Extension for Visual Studio version: 2.3.3.38 (and earlier)
  • Visual Studio version: 2015 & 2017

What happened
I kept going back and forth between VS2015 and 2017 and notice that I get signed out of GitHub on the version I'm currently using and have to sign back in again.

I see an error like this in my extension.log:

2017-09-18 12:27:54.5061|ERROR|thread: 1|SharedCache|Failed to set the LocalMachine cache.
System.TypeInitializationException: The type initializer for 'NativeMethods' threw an exception. ---> System.Exception: Tried to load sqlite3.dll from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\GitHub\GitHub and failed miserably.
   at SQLitePCL.SQLite3Provider.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at SQLitePCL.SQLite3Provider.NativeMethods.sqlite3_open_v2(Byte[] filename, IntPtr& db, Int32 flags, Byte[] vfs)
   at SQLitePCL.SQLite3Provider.SQLitePCL.ISQLite3Provider.sqlite3_open_v2(String filename, IntPtr& db, Int32 flags, String vfs)
   at SQLitePCL.raw.sqlite3_open_v2(String filename, sqlite3& db, Int32 flags, String vfs)
   at Akavache.Sqlite3.Internal.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\SQLite.cs:line 193
   at Akavache.Sqlite3.SQLitePersistentBlobCache..ctor(String databaseFile, IScheduler scheduler) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\SqlitePersistentBlobCacheNext.cs:line 44
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass0_0.<Register>b__0() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\Registrations.cs:line 28
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass0_0.<Register>b__1() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\Registrations.cs:line 30
   at Splat.ModernDependencyResolver.GetService(Type serviceType, String contract) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\splat\Splat\ServiceLocation.cs:line 270
   at Splat.DependencyResolverMixins.GetService[T](IDependencyResolver This, String contract) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\splat\Splat\ServiceLocation.cs:line 151
   at Akavache.BlobCache.get_LocalMachine() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache\Portable\BlobCache.cs:line 65
   at GitHub.Caches.SharedCache.<>c.<.ctor>b__4_1() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\Caches\SharedCache.cs:line 53
   at GitHub.Caches.SharedCache.GetBlobCacheWithFallback(Func`1 blobCacheFunc, String cacheName) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\Caches\SharedCache.cs:line 103    at SQLitePCL.SQLite3Provider.NativeMethods.sqlite3_open_v2(Byte[] filename, IntPtr& db, Int32 flags, Byte[] vfs)
   at SQLitePCL.SQLite3Provider.SQLitePCL.ISQLite3Provider.sqlite3_open_v2(String filename, IntPtr& db, Int32 flags, String vfs)
   at SQLitePCL.raw.sqlite3_open_v2(String filename, sqlite3& db, Int32 flags, String vfs)
   at Akavache.Sqlite3.Internal.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\SQLite.cs:line 193
   at Akavache.Sqlite3.SQLitePersistentBlobCache..ctor(String databaseFile, IScheduler scheduler) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\SqlitePersistentBlobCacheNext.cs:line 44
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass0_0.<Register>b__0() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\Registrations.cs:line 28
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Akavache.Sqlite3.Registrations.<>c__DisplayClass0_0.<Register>b__1() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache.Sqlite3\Registrations.cs:line 30
   at Splat.ModernDependencyResolver.GetService(Type serviceType, String contract) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\splat\Splat\ServiceLocation.cs:line 270
   at Splat.DependencyResolverMixins.GetService[T](IDependencyResolver This, String contract) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\splat\Splat\ServiceLocation.cs:line 151
   at Akavache.BlobCache.get_LocalMachine() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\submodules\akavache\Akavache\Portable\BlobCache.cs:line 65
   at GitHub.Caches.SharedCache.<>c.<.ctor>b__4_1() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\Caches\SharedCache.cs:line 53
   at GitHub.Caches.SharedCache.GetBlobCacheWithFallback(Func`1 blobCacheFunc, String cacheName) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.App\Caches\SharedCache.cs:line 103

and also see some messages like this:

2017-09-18 15:05:32.4588|INFO|thread: 1|RepositoryHost|Logged off of host 'https://api.github.com/'
2017-09-18 15:05:32.4695|INFO|thread: 1|LoginCache|Erasing the git credential cache for host 'https://github.com/'

@meaghanlewis meaghanlewis added the bug label Sep 19, 2017

@meaghanlewis meaghanlewis added this to Medium Priority in BUGS Dec 2, 2017

@grokys

This comment has been minimized.

Contributor

grokys commented Dec 12, 2017

@meaghanlewis I've tried to repro this and failed. I too go between 2015 and 2017 regularly and I don't see this. Is it still happening for you?

@meaghanlewis

This comment has been minimized.

Contributor

meaghanlewis commented Dec 12, 2017

Hey @grokys yes I just tried and this is still happening for me. One thing to note is that I'm running 2 separate images- 1 with VS2015 and 1 with VS2017.

@sebkirller

This comment has been minimized.

sebkirller commented Dec 13, 2017

I have a somewhat similar issue. Only I can't be logged in to the same Github account on VS2017 on my desktop and VS2017 on my laptop.

Whenever I try to login on my desktop the laptop gets signed out and vise versa.

@grokys

This comment has been minimized.

Contributor

grokys commented Dec 13, 2017

Ok, this makes more sense - it sounds like we're not fingerprinting our tokens correctly.

@grokys

This comment has been minimized.

Contributor

grokys commented Dec 14, 2017

I think the problem is in our logic here: https://github.com/github/VisualStudio/blob/master/src/GitHub.Api/ApiClientConfiguration.cs#L63-L69

This for me returns a fastedValidNetworkInterface (sic) of 00000000000000E0 which is no good as a fingerprint. I think the address.Length > 12 check is supposed to avoid selecting a machine identifier like this, but it's not working as the only address with Length > 12 on my machine is this one, which has a dummy physical address.

@meaghanlewis meaghanlewis moved this from Medium Priority to In Progress in BUGS Dec 14, 2017

@grokys grokys closed this in #1390 Dec 18, 2017

BUGS automation moved this from In Progress to Done Dec 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment