[UBA][Windows] -unattended時にHorde server URLの取得が失敗する

お世話になっております。

WorldPartitionBuilderCommandletを -unattended 付きで実行した際、

Hordeを用いたShaderCompileの分散実行が開始できず、

Horde server URLの取得に失敗する事象について確認させてください。

■環境

- Windows 11

- UE 5.7 source build

- WorldPartitionBuilderCommandletを -unattended 付きで実行

- Hordeを利用した分散ShaderCompileを有効化

■事象

WorldPartitionBuilderCommandlet実行時に以下のログが出力され、Horde経由の初期化に失敗します。

LogUbaHorde: Warning: Getting Horde server URL failed [Source: ]

LogUbaHorde: Error: Failed to create HttpClient for UbaAgent

その結果、ShaderCompileの分散実行が開始されません。

■期待結果

-unattended 付きのcommandlet実行時でも、

少なくともHorde server URLの取得までは正常に行われること

その上で、もし対話的なユーザー認証が必要であれば、その段階で制約が出ること自体は理解できます。

ただし、事前取得したトークンやサービスアカウント等を利用して非対話で認証を成立させる運用も考えられるため、

-unattendedであることを理由にHorde server URL自体が取得できず、認証以前の段階で処理が進められなくなるのは不自然に感じています。

■実際の結果

-unattended時のみHorde server URLの取得に失敗し、

認証処理に進む前の段階で「Failed to create HttpClient for UbaAgent」となります。

■こちらで確認した内容

コードを確認した限り、Horde server URLの取得は

「Engine/Source/Developer/Horde/Private/Horde.cpp」の「FHorde::GetServerUrl()」から行われており、

内部で「FDesktopPlatformModule::TryGet()」を利用しています。

一方で、このcommandlet実行経路では

-unattended時にDesktopPlatformが利用できず、

結果としてserver URLを取得できないように見えます。

■確認したい点

この挙動は仕様でしょうか。それとも不具合でしょうか。

特に確認したいのは以下です。

1. WorldPartitionBuilderCommandletを -unattended 付きで実行した場合に、

Horde server URL自体が取得できなくなるのは想定された挙動か

2. -unattended 時に対話的な認証が制限されることとは別に、

server URLの取得まで失敗してしまうのは既知の問題か

3. 事前取得トークンやサービスアカウント等による非対話運用を行いたい場合、

推奨される回避策や修正予定があるか

必要であれば、再現手順やこちらで確認したコード経路の詳細も共有できます。

よろしくお願いいたします。

[Attachment Removed]

再現手順
■再現条件

- WorldPartitionBuilderCommandletを -unattended 付きで実行する

- Hordeを利用した分散ShaderCompileを有効にしておく

[Attachment Removed]

詳細な問題報告をありがとうございます。

環境設定に関して、いくつか追加で確認させていただけますでしょうか?

- コマンドレットはローカルで実行していますか、それともリモート(例:ビルドファーム上)で実行していますか?

- CI/CDシステムとしてHordeを使用していますか?

- 実行しているWorldPartitionBuilderCommandletコマンドの全文を教えていただけますか?

- エンジンのUBA設定(プロバイダー設定を含む)を教えていただけますか?

- `-unattended`フラグを指定しない場合、この処理が正しく分散されていることを確認していただけますか?

---

Thank you for the detailed issue write-up.

Could you please confirm a few additional details relating to your setup?

- Are you running the commandlets locally, or remotely (e.g., on your build farm)?

- Are you using Horde for your CI/CD system?

- Could you share the full WorldPartitionBuilderCommandlet command that you’re running?

- Could you share your Engine’s UBA configuration (including Provider settings)?

- Can you confirm that without the `-unattended` flag, this work is distributed correctly?

[Attachment Removed]

ご確認いただきありがとうございます。

以下、現時点で確認できている内容を回答いたします。

>コマンドレットはローカルで実行していますか、それともリモート(例:ビルドファーム上)で実行していますか?

ローカルで実行しているものになります。

>CI/CDシステムとしてHordeを使用していますか?

はい、利用しています。

>エンジンのUBA設定(プロバイダー設定を含む)を教えていただけますか?

DefaultEngine.iniに以下の設定をしております。(ServerUrlは安全のためマスクしております)

[Uba.Provider.Horde]

ServerUrl=“https://***/”

Enabled=True

Pool=win-ue5

ConnectionMode=direct

[Horde]

ServerUrl=“https://***/”

>`-unattended`フラグを指定しない場合、この処理が正しく分散されていることを確認していただけますか?

現在確認中です。

また、他のShaderCompileが発生するコマンドでは、'-unattended’フラグがない場合に正しく分散されていることは確認済みです。

現時点での認識としては、

`-unattended` を付けた場合にのみ Horde server URL の取得に失敗しており、

認証そのものより前の段階で初期化が進められなくなっているように見えています。

よろしくお願いいたします。

[Attachment Removed]

情報をお寄せいただきありがとうございます。実行されている WorldPartitionBuilderCommandlet コマンドの引数についてもご確認いただけますでしょうか?

これにより、お客様が実行されているコードパスを正確に特定し、調査を進めることができます。

---

Thank you for the information. Could you please also confirm the arguments for the WorldPartitionBuilderCommandlet command that you’re running?

With this, we can confirm we’re investigating the correct exact code path that you’re executing.

[Attachment Removed]

ご確認いただきありがとうございます。

実行時の引数は以下になります。

なお、識別情報にあたる箇所のみ一部マスクしておりますが、その他の引数は実際に使用しているものです。

<masked>.uproject ^
/Game/maps/release/game/game_0000/lv_release_game_0000 ^
-run=WorldPartitionBuilderCommandlet ^
-DisablePython ^
-unattended ^
-AllowCommandletRendering ^
-builder=<masked>WorldPartitionNavigationDataBuilder ^
-noshaderddc

よろしくお願いいたします。

[Attachment Removed]

詳細をご提供いただきありがとうございます。調査の結果、このコマンドレットは `-unattended` フラグを指定して実行した場合、Desktop Platform モジュールをロードしないことが判明しました。Horde はこのコンテキストで URL を取得し、その後のログインを実行するために、このモジュールに依存しています。

Horde ビルドマシン上で `-unattended` フラグを使用して実行される当社の World Partition Build ジョブでは、分散コンパイルに UBA が正常に使用されていることを確認しました。

お客様もCI/CDにHordeをご利用されていることを踏まえ、これらの自動化された(非対話型)実行にはHordeを使用し、ローカルで実行する際は`-unattended`フラグを省略することをお勧めします。

事前に取得したトークンやサービスアカウントを使用した非対話型操作に関する当初のご質問についてですが、トークンやサービスアカウントを生成する方法はいくつかあります。

サービスアカウントの生成には `/api/v1/serviceaccounts` エンドポイントを、トークンの生成には `/api/v1/admin/token` エンドポイントを使用できます。

これらのエンドポイントの詳細については、https://<HORDE_URL>/swagger/index.html をご覧ください。

また、サービスアカウントのフローに関する情報については、こちらのフォーラム投稿もご参照ください。Horde system user authentication (ServiceAccounts)

---

Thank you for providing these details. After some investigation, it appears that this commandlet does not load the Desktop Platform module when run with the `-unattended` flag, which Horde relies on to fetch the URL in this context and to perform subsequent login.

I have confirmed that our World Partition Build jobs, which run on Horde build machines and use the `-unattended` flag, are successfully using UBA for distributed compilation.

Given that you are also using Horde for CI/CD, we recommend using Horde for these automated (non-interactive) runs and omit the `-unattended` flag when running locally.

Regarding your original question about performing non-interactive operations with pre-obtained tokens or service accounts, we have several methods for generating tokens and service accounts.

You can use the `/api/v1/serviceaccounts` endpoint to generate service accounts, and the `/api/v1/admin/token` endpoint for tokens.

Please see https://<HORDE_URL>/swagger/index.html for more information on these endpoints.

Please also see this forum post for information on the service account flow. Horde system user authentication (ServiceAccounts)

[Attachment Removed]

ご確認いただきありがとうございます。

>Horde ビルドマシン上で `-unattended` フラグを使用して実行される当社の World Partition Build ジョブでは、分散コンパイルに UBA が正常に使用されていることを確認しました。

Horde の Build Automation で World Partition Build ジョブを実行した場合は、

`-unattended` フラグを使用して実行してもUBAで Horde Agent にコンパイルが分散されるという認識でよろしいでしょうか?

お手数をおかけしますが、ご確認のほどよろしくお願いします。

[Attachment Removed]

どういたしまして。はい、私たちの環境ではそのように動作しています。

Hordeのジョブは`-unattended`フラグを指定して実行され、コンパイル処理はUBAヘルパーに分散されます。

---

You’re welcome. Yes, that is how our setup is operating.

The Horde jobs are executed with the `-unattended` flag, and the compilation is distributed to UBA helpers.

[Attachment Removed]

承知いたしました。

ご対応いただきありがとうございました!

[Attachment Removed]

>このコマンドレットは `-unattended` フラグを指定して実行した場合、Desktop Platform モジュールをロードしないことが判明しました

すみません、追加で確認させて頂きたいのですが、↑のように回答いただきました「モジュールがロードされない挙動」が修正される可能性はございますでしょうか?

ご確認のほどよろしくお願いします。

[Attachment Removed]

直近のワークフローの停滞を解消するため、私は \Engine\Source\Developer\Horde\Private\Horde.cpp にある DelayedAutoRegisterHelper を使用して、この問題を回避することができました。

なお、これは当社の Horde 環境や Horde チームによる検証は受けていないため、これ以上の保証はいたしかねます。

#include "Misc/DelayedAutoRegister.h"
 
static FDelayedAutoRegisterHelper GPreloadDesktopPlatformForHorde(
	EDelayedRegisterRunPhase::EarliestPossiblePluginsLoaded,
	[]()
	{
		FModuleManager::Get().LoadModule(TEXT("DesktopPlatform"));
	});

当方でこの機能を追加することについて、今後のリリースでの実装を検討していただけないか、Hordeチームに問い合わせてみました。

残念ながら、現時点ではこの提案が受け入れられるかどうか、また変更がいつ実装されるかについては、確約できません。

---

To aid in unblocking your immediate workflows, I’ve been able to work around this issue using a DelayedAutoRegisterHelper in \Engine\Source\Developer\Horde\Private\Horde.cpp.

Just so you know, this has not been validated in our Horde environment or with the Horde team, so it is provided without wider guarantees.

#include "Misc/DelayedAutoRegister.h"
 
static FDelayedAutoRegisterHelper GPreloadDesktopPlatformForHorde(
	EDelayedRegisterRunPhase::EarliestPossiblePluginsLoaded,
	[]()
	{
		FModuleManager::Get().LoadModule(TEXT("DesktopPlatform"));
	});

Regarding getting this added on our side, I have reached out to the Horde team to see if they would consider adding it in a future release.

Unfortunately, I can’t provide any guarantees on this being accepted at the moment, or when those changes might land.

[Attachment Removed]

ご回答いただきありがとうございます。

上記、承知いたしました!

参考にさせていただきます。

この度はご対応いただきありがとうございました。

[Attachment Removed]