controlbox2 / siren-of-shame

Automatically exported from code.google.com/p/siren-of-shame
0 stars 0 forks source link

TFS connection fails enumerating registration entries if permission to one is denied #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to tfs server where you don't have access to all [something]
2. Siren will fail 
3.

What is the expected output? What do you see instead?
Should ignore entries you don't have access to

What version of the product are you using? On what operating system?
1.5 Windows 7

Please provide any additional information below.
the tfs url was https://tfs.ext.foo.net

2012-05-12 09:15:18,853 [6] ERROR TfsServices.Configuration.ConfigureTfs 
[(null)] - Failed to connect to server
Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: 
You are not authorized to access https://tfs.ext.foo.net/tfs/training.
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.ThrowIfUnauthorized(HttpWebResponse response)
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationServiceProxyWsdl.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationProxy.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshMemoryCache()
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshCachesIfNeeded(Boolean direct)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.FindServiceLocation(String serviceType, String toolId)
   at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.LocationForCurrentConnection(String serviceType, Guid serviceIdentifier)
   at Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()
   at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.CreateServiceProxy(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetServiceInstance(Type serviceType, Object serviceInstance)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService[T]()
   at TfsServices.Configuration.MyTfsProjectCollection..ctor(CatalogNode teamProjectCollectionNode, TfsConfigurationServer tfsConfigurationServer)
   at TfsServices.Configuration.MyTfsServer.<get_ProjectCollections>b__0(CatalogNode tcpNode)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   at TfsServices.Configuration.ConfigureTfs.DataBind()

Original issue reported on code.google.com by j...@freemansoft.com on 13 May 2012 at 1:33

GoogleCodeExporter commented 9 years ago
Hey Joe,

I've tried numerous ways to reproduce this, but (thankfully) not being a TFS 
admin for my day job I haven't had much luck.  And the Internets haven't helped 
much.  So I took a stab in the dark.  Could you please try getting latest from 
google code or backing up and replacing the following dll and testing for me:

http://sirenofshame.com/setup/TfsServices.dll

I'm a little nervous about the performance implications of the approach I took 
so if it does work please report back on performance in general and how long 
the polling takes in particular.

Thank you,
- Lee

Original comment by lpric...@gmail.com on 14 May 2012 at 3:35

GoogleCodeExporter commented 9 years ago
I can't seem to get that dll recognized by the siren-of-shame software.  I
renamed the existing TfsServices.dll in Program Files (x86) to something
else and then copied this dll in and relaunched the s-o-s.  There is no TFS
entry in the CI dropdown. Everything works fine if  I rename then new dll
and restore the name of the old one.

Is there some type of registration or permission thing I need to do?

Thanks for putting time into this.

Original comment by j...@freemansoft.com on 14 May 2012 at 10:44

GoogleCodeExporter commented 9 years ago
That's odd, you did everything right.  If you're in Win7 try clicking 
properties on the new one and clicking "Unblock".  Otherwise I uploaded a new 
setup program.  Please use add/remove programs to remove of the old version.

http://sirenofshame.com/setup/SirenOfShame-1-5-5.zip

Original comment by lpric...@gmail.com on 14 May 2012 at 12:03

GoogleCodeExporter commented 9 years ago
Oops I meant:

http://sirenofshame.com/setup/SirenOfShame-1-5-5.msi

Original comment by lpric...@gmail.com on 14 May 2012 at 12:04

GoogleCodeExporter commented 9 years ago
My local TFS person told me that we have different collections on the TFS 
server and that I really only need to look at one, /foo/bar  We have 
collections /foo, /training with more stuff under /foo.  The s-o-s code 
probably enumerates the collections. An alternative fix to trying them all is 
to let a user enter a collection in the preferences panel. I'll try 1.5.5

Original comment by j...@freemansoft.com on 14 May 2012 at 12:13

GoogleCodeExporter commented 9 years ago
1.5.4 stops when you don't have permission with an alert panel.  It worked fine 
for my admin because he has permissions to each collection.
1.5.5 detects (in the logs) you don't have permission but then thinks you don't 
have permission to any collection.  You get a stack trace for each collection.  
 This failed for my admin even though he has permissions to each collection.

2012-05-14 08:29:11,521 [7] DEBUG 
TfsServices.Configuration.MyTfsProjectCollection [(null)] - Unauthorized access 
to CatalogNode instance 54177915
  FullPath: 3eYRYkJOok6GHrKam0AcAA==Ql5bRJgaAk68UjR1kazZvQ==JTvKsahQG0uDZe/MdGdIBw==
  IsDefault: False
  ResourceIdentifier: d432cd23-45cb-4991-8c00-8f2b02ea59ca
  ParentPath: 3eYRYkJOok6GHrKam0AcAA==Ql5bRJgaAk68UjR1kazZvQ==
  ChildItem: JTvKsahQG0uDZe/MdGdIBw==
  NodeDependencies: [0]
  NodeDependenciesIncluded: False
  ChangeTypeValue: 0
  MatchedQuery: True

Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: 
You are not authorized to access https://tfs.ext.foo.net/tfs/foo.
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.ThrowIfUnauthorized(HttpWebResponse response)
   at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationServiceProxyWsdl.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationProxy.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshMemoryCache()
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.RefreshCachesIfNeeded(Boolean direct)
   at Microsoft.TeamFoundation.Proxy.BisRegistrationService.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.FindServiceLocation(String serviceType, String toolId)
   at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.LocationForCurrentConnection(String serviceType, Guid serviceIdentifier)
   at Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()
   at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.CreateServiceProxy(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetServiceInstance(Type serviceType, Object serviceInstance)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService[T]()
   at TfsServices.Configuration.MyTfsProjectCollection..ctor(CatalogNode teamProjectCollectionNode, TfsConfigurationServer tfsConfigurationServer)

Original comment by j...@freemansoft.com on 14 May 2012 at 12:43

GoogleCodeExporter commented 9 years ago
Still not having any luck reproducing.  Does your admin have any tips on how 
he/she set up the TFS permissions?  There seem to be a lot of way to do it.

Original comment by lpric...@gmail.com on 16 May 2012 at 5:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'll check.  siren-of shame can see two collections with my id.  When I run 
your 1.5.5 (test) code, the log shows stack traces for the two collections. I'm 
wondering if the 1.5.5 code actually works but doesn't display the collections. 
The code looks good for only using the ones it can connect to.  I'm wondering 
if we've lost the credentials somehow when it goes across the collections.  
I've added logging in my copy to what collections it attempts and they all fail 
0/2.

Our TFS server is actually behind a Forefront firewall where we use single sign 
on through a gateway to get access to the TFS server.  We don't think that 
should affect this though.

I suspect this isn't worth any more troubleshooting until we find out more. 

Original comment by j...@freemansoft.com on 19 May 2012 at 11:32

GoogleCodeExporter commented 9 years ago
I think you nailed it: the credentials need to be passed to more objects than 
just the connection.  I'll have another version for you shortly.

Original comment by lpric...@gmail.com on 23 May 2012 at 2:32

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 96fa8616ed2d.

Original comment by lpric...@gmail.com on 24 May 2012 at 2:50

GoogleCodeExporter commented 9 years ago
Great news Joe: I was able to reproduce and I've got it working!  Please 
uninstall using add/remove programs and try this version: 
http://code.google.com/p/siren-of-shame/downloads/detail?name=SirenOfShame-1-5-5
.msi&can=2&q=#makechanges.

Original comment by lpric...@gmail.com on 24 May 2012 at 2:54

GoogleCodeExporter commented 9 years ago
Yes, it looks like you fixed it.  I was able to get build status of our TFS 
builds this morning from home through our firewall.  It took a couple minutes 
to get the initial build status.  There was a timeout message in the logs. But 
then all our CI builds turned from yellow triangle to green.  I verified the 
statuses were correct with the TFS web interface. 

Awesome.

Original comment by j...@freemansoft.com on 24 May 2012 at 10:28

GoogleCodeExporter commented 9 years ago
Awesome!  If you feel like posting a bug report on the slow startup time and 
include the timeout stack trace that would be cool.  I've noticed on my TFS 
project that the startup times have been getting slower as they've been adding 
more projects and I think I know how to fix it, but it was low priority because 
it was nothing like 2 minutes.  

Incidentally how is the polling speed?  When it says 5 seconds in settings that 
actually means wait 5 seconds between requests, so in our case it's actually 
10-12 seconds because the various requests take 5-7 seconds.  I've been 
wondering what a very large TFS installation would be like.

Original comment by lpric...@gmail.com on 24 May 2012 at 9:57