現在、Apigee と Apigee ハイブリッドのドキュメントを表示しています。
Apigee Edge のドキュメントを表示する
UserNameRequired
エラー メッセージ
Apigee UI または API を使用した API プロキシのデプロイに失敗すると、次のエラー メッセージが表示されます。
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Username element must be present for operation operation.
エラー メッセージの例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Username element must be present for Encode operation.
スクリーン ショットの例

原因
BasicAuthentication ポリシーで <User> 要素が定義されていない場合、API プロキシのデプロイは失敗します。<User> 要素は Encode オペレーションと Decode オペレーションの両方に必須です。
診断
API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。
<User>要素が指定されていないポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーでは、Encode オペレーションまたは Decode オペレーションに<User>要素は必須です。以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、
<User>要素が定義されていません。<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Password ref="BasicAuth.credentials.password"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>デプロイが失敗して次のエラーが表示されます。
BasicAuthenticationPolicy: Username element must be present for Encode operation.
解決策
BasicAuthentication ポリシー内で、Encode オペレーションまたは Decode オペレーションに <User> 要素が定義されていることを確認します。
上記の例を修正するには、次のようにポリシー内に <User> 要素を含めます。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
PasswordRequired
エラー メッセージ
Apigee UI または API を使用した API プロキシのデプロイに失敗すると、次のエラー メッセージが表示されます。
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Password element must be present for operation operation.
エラー メッセージの例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Password element must be present for Encode operation.
スクリーン ショットの例

原因
BasicAuthentication ポリシーで <Password> 要素が定義されていない場合、API プロキシのデプロイは失敗します。Encode オペレーションと Decode オペレーションの両方に <Password> 要素は必須です。
診断
API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。
<Password>要素が定義されていないポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーでは、Encode オペレーションまたは Decode オペレーションに<Password>要素は必須です。以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、
<Password>要素が定義されていません。<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>デプロイが失敗して次のエラーが表示されます。
BasicAuthenticationPolicy: Password element must be present for Encode operation.
解決策
BasicAuthentication ポリシー内で、Encode オペレーションまたは Decode オペレーションに <Password> 要素が定義されていることを確認します。
上記の例を修正するには、次のようにポリシー内に <Password> 要素を含めます。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
AssignToRequired
エラー メッセージ
Apigee UI または API を使用した API プロキシのデプロイに失敗すると、次のエラー メッセージが表示されます。
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: AssignTo element must be present for operation operation.
エラー メッセージの例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: AssignTo element must be present for Encode operation.
スクリーン ショットの例

原因
BasicAuthentication ポリシーで <AssignTo> 要素が定義されていない場合、API プロキシのデプロイは失敗します。Encode オペレーションと Decode オペレーションの両方に <AssignTo> 要素は必須です。
診断
API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。
<AssignTo>要素が定義されていないポリシーがある場合、それがエラーの原因です。<AssignTo>要素は、BasicAuthentication ポリシーの Encode オペレーションと Decode オペレーションの両方で定義する必要があります。以下に示す BasicAuthentication ポリシーのサンプルは Encode オペレーションに使用されるものですが、
<AssignTo>要素が定義されていません。<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Encode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <Password ref="BasicAuth.credentials.password"/> </BasicAuthentication>デプロイが失敗して次のエラーが表示されます。
BasicAuthenticationPolicy: AssignTo element must be present for Encode operation.
解決策
BasicAuthentication ポリシー内で、Encode オペレーションまたは Decode オペレーションに <AssignTo> 要素が定義されていることを確認します。
上記の例を修正するには、次のようにポリシー内に <AssignTo> 要素を含めます。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
</BasicAuthentication>
SourceRequired
エラー メッセージ
Apigee UI または API を使用した API プロキシのデプロイに失敗すると、次のエラー メッセージが表示されます。
Error Deploying Revision revision_number to env_name BasicAuthenticationPolicy: Source element must be present for Decode operation.
エラー メッセージの例
Error Deploying Revision 2 to test
BasicAuthenticationPolicy: Source element must be present for Decode operation.
スクリーン ショットの例

原因
Decode オペレーションに使用される <Source> 要素が BasicAuthentication ポリシーで定義されていない場合、API プロキシのデプロイは失敗します。BasicAuthentication ポリシーで <Operation> が Decode として指定されている場合、<Source> 要素は必須です。
診断
API プロキシで使用されているすべての BasicAuthentication ポリシーを確認します。
<Source>要素が定義されていないのに<Operation>要素がDecodeとして定義されているポリシーがある場合、それがエラーの原因です。BasicAuthentication ポリシーで<Operation>がDecodeとして指定されている場合、<Source>要素は必須です。以下に示す BasicAuthentication ポリシーのサンプルは
Decodeオペレーションに使用されるものですが、<Source>要素が定義されていません。<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <BasicAuthentication name="ApplyBasicAuthHeader"> <DisplayName>ApplyBasicAuthHeader</DisplayName> <Operation>Decode</Operation> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <User ref="BasicAuth.credentials.username"/> <Password ref="BasicAuth.credentials.password"/> <AssignTo createNew="false">request.header.Authorization</AssignTo> </BasicAuthentication>デプロイが失敗して次のエラーが表示されます。
BasicAuthenticationPolicy: Source element must be present for Decode operation.
解決策
Decode オペレーションで使用する場合、BasicAuthentication ポリシーで <Source> 要素が定義されていることを確認します。
上記の例を修正するには、次のようにポリシー内に <Source> 要素を含めます。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BasicAuthentication name="ApplyBasicAuthHeader">
<DisplayName>ApplyBasicAuthHeader</DisplayName>
<Operation>Decode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="BasicAuth.credentials.username"/>
<Password ref="BasicAuth.credentials.password"/>
<AssignTo createNew="false">request.header.Authorization</AssignTo>
<Source>request.header.Authorization</Source>
</BasicAuthentication>