Jack of all trades

master of none. 多芸は無芸を地で行く、自作自演何でも屋。

Team Foundation ServerでActive Directoryの同期エラーが発生

他所でばっちり当てはまるケースを見かけなかったので、念の為記録として残しておこう、という話。

事の発端としては、ADで追加したドメインユーザーがTFSのWebAccessで参照できなかったところから。 先日までは何の問題もなく参照できてたのにおかしいな…と調べてみたところ、Windowsのイベントログに以下のようなエラーが。


TF53010: Team Foundation のコンポーネントまたは拡張で以下のエラーが発生しました: 日付 (UTC): 2014/09/29 9:00:11 コンピューター: xxxxxx アプリケーション ドメイン: TfsJobAgent.exe アセンブリ: Microsoft.TeamFoundation.Framework.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v4.0.30319 サービス ホスト: プロセスの詳細: プロセス名: TFSJobAgent プロセス ID: 5816 スレッド ID: 4920 アカウント名: xxxxxx\Administrator

詳細メッセージ: TF200035: Team Foundation Server が次の ID と同期しようとして 1 つ以上のエラーが発生しました: xxxxxx。発生したエラーの数: 1。 ++++++++++++++++++++++ ID の同期エラー: xxxxxx ユーザー名またはパスワードが正しくありません。

Domain name: xxxxxx 場所 System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName) 場所 System.DirectoryServices.ActiveDirectory.Domain.GetDomain(DirectoryContext context) 場所 Microsoft.VisualStudio.Services.Identity.DomainEntry.Initialize(DirectoryContext context) 場所 Microsoft.VisualStudio.Services.Identity.DomainEntry..ctor(TeamFoundationRequestContext requestContext, SecurityIdentifier domainSecurityId) 場所 Microsoft.VisualStudio.Services.Identity.DomainProperties.GetProperties(TeamFoundationRequestContext requestContext, SecurityIdentifier domainSecurityId, String& netbiosName, String& fullDomainName, String& domainRootPath) 場所 Microsoft.VisualStudio.Services.Identity.WindowsProvider.SyncADIdentity(Identity identity, Boolean includeMembers, TeamFoundationRequestContext requestContext, SyncErrors syncErrors) 場所 Microsoft.VisualStudio.Services.Identity.WindowsProvider.TrySyncIdentity(IdentityDescriptor descriptor, Boolean includeMembership, String providerInfo, TeamFoundationRequestContext requestContext, SyncErrors syncErrors, Identity& identity) 場所 Microsoft.VisualStudio.Services.Identity.IdentitySynchronizer.ReadIdentityFromSource(TeamFoundationRequestContext requestContext, Identity identity, Boolean includeMemberships) 場所 Microsoft.VisualStudio.Services.Identity.IdentitySynchronizer.SyncOneGroupMembership(TeamFoundationRequestContext requestContext, Identity groupToSync) ユーザー名またはパスワードが正しくありません。

場所 System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) 場所 System.DirectoryServices.DirectoryEntry.Bind() 場所 System.DirectoryServices.DirectoryEntry.get_AdsObject() 場所 System.DirectoryServices.PropertyValueCollection.PopulateList() 場所 System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) 場所 System.DirectoryServices.PropertyCollection.get_Item(String propertyName) 場所 System.DirectoryServices.ActiveDirectory.PropertyManager.GetPropertyValue(DirectoryContext context, DirectoryEntry directoryEntry, String propertyName)


とりあえずTFSのジョブエージェントでADとの同期が失敗している模様。 延々と調べた結果、TFSのサービスアカウントにサーバーのローカルAdministratorを指定していたせいで同期に失敗していたようなので、ADでTFSサービスアカウント用のドメインユーザーを作成してこちらに変更した。この対応でTFSジョブエージェントによるADとの同期が成功した。

そもそも先日まで問題なく同期できていたのがおかしいっぽいが、そのあたりの原因は解明できず。おそらくローカルAdministratorでADサーバーにアクセスしたキャッシュか何かが残っていて、その期間だけ同期できていた、という推測。