คุณกำลังดูเอกสารประกอบ Apigee Edge
ไปที่
เอกสารประกอบเกี่ยวกับ Apigee X. ข้อมูล
InvalidRegularExpression
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Deploying Revision revision_number to environment RegularExpressionProtection policy_name: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากนิพจน์ทั่วไปในองค์ประกอบ <Pattern>
ของนโยบาย regularExpressionProtection ไม่ถูกต้อง การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุชื่อนโยบาย regularExpressionProtection จากข้อความแสดงข้อผิดพลาด ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อ regularExpressionProtection ของคุณจะเป็น
Regular-Expression-Protection-1:
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Invalid Regular Expression com.apigee.steps.regexprotection.RegularExpressionProtectionBean$RegexPattern@f4ecb23, Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ตรวจสอบองค์ประกอบ
<Pattern>
ทั้งหมดใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ตรวจสอบว่าองค์ประกอบ<Pattern>
มีนิพจน์ทั่วไปที่ไม่ถูกต้องหรือไม่ หากองค์ประกอบ<Pattern>
มีนิพจน์ทั่วไปที่ไม่ถูกต้อง นั่นก็คือสาเหตุของข้อผิดพลาดตัวอย่างเช่น นโยบายต่อไปนี้ระบุค่า
Pattern>
ของfoo){2}
ซึ่งถือว่าเป็นนิพจน์ทั่วไปที่ไม่ถูกต้อง<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <URIPath> <Pattern>foo){2}</Pattern> </URIPath> <Source>request</Source> </RegularExpressionProtection>
ในตัวอย่างข้างต้น นิพจน์ทั่วไปที่ระบุใน
<Pattern>
ไม่มีวงเล็บเปิด ดังนั้นจึงถือเป็นนิพจน์ทั่วไปที่ไม่ถูกต้อง การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่าเอลิเมนต์ <Pattern>
แต่ละรายการในนโยบาย regularExpressionProtection มีนิพจน์ทั่วไปที่ถูกต้อง คุณสามารถค้นหาเครื่องมือนิพจน์ทั่วไปต่างๆ แบบออนไลน์หรือออฟไลน์เพื่อแก้ไขข้อบกพร่องของนิพจน์ทั่วไปได้
หากต้องการแก้ไขตัวอย่างนโยบายการปกป้องนิพจน์ทั่วไปที่แสดงอยู่ด้านบน ให้เพิ่มวงเล็บที่ขาดหายไป ดังนี้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <URIPath> <Pattern>(foo){2}</Pattern> </URIPath> <Source>request</Source> </RegularExpressionProtection>
XPathCompilationFailed
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Deploying Revision revision_number to environment RegularExpressionProtection policy_name: Failed to compile xpath xpath_expression. Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile xpath /notapigee:foo/notapigee:bar. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากคำนำหน้าหรือค่าที่ใช้ในองค์ประกอบ <XPath>
ไม่ได้เป็นส่วนหนึ่งของเนมสเปซที่ประกาศในนโยบาย regularExpressionProtection การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
คุณสามารถดูข้อมูลเพิ่มเติมเกี่ยวกับเนมสเปซ, XPath และคำนำหน้าในเนมสเปซ XML และผลกระทบที่ส่งผลต่อ XPath และ MRSS
การวินิจฉัย
ระบุชื่อนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและ XPath Expression ที่ใช้ ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาด
ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ
Regular-Expression-Protection-1
และ XPath Expression คือ/notapigee:foo/notapigee:bar:
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile xpath /notapigee:foo/notapigee:bar. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่า XPath ที่ตั้งค่าไว้ในองค์ประกอบ
Expression
ตรงกับ XPath ที่ระบุในข้อความแสดงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้ระบุ XPath เป็น
/notapigee:foo/notapigee:bar
ซึ่งตรงกับข้อความแสดงข้อผิดพลาด<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/notapigee:foo/notapigee:bar</Expression> <Type>nodeset</Type> <Pattern>pattern</Pattern> <Pattern>pattern2</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
- ตรวจสอบองค์ประกอบ
<Namespaces>
และ<Expression>
ในนโยบาย regularExpressionProtection หาก<Expression>
ที่เจาะจงซึ่งระบุไว้ในข้อความแสดงข้อผิดพลาดใช้คำนำหน้าหรือค่าที่ไม่ได้เป็นส่วนหนึ่งของเนมสเปซที่ประกาศในนโยบาย regularExpressionProtection นั่นจึงเป็นสาเหตุของข้อผิดพลาดโปรดสังเกตว่า
<XPath>
ที่เจาะจงจะใช้คำนำหน้าnotapigee
ในตัวอย่าง REGExpressionProtection ดังตัวอย่างต่อไปนี้<Expression>/notapigee:foo/notapigee:bar</Expression>
แต่ไม่ได้กำหนดคำนำหน้า
notapigee
ในองค์ประกอบ<Namespace>
ใดๆ ดังนั้น การคอมไพล์<XPath>
ล้มเหลวจนทำให้การทำให้ใช้งานได้ล้มเหลว
ความละเอียด
ตรวจสอบว่าได้ประกาศเนมสเปซทั้งหมดที่ใช้ในองค์ประกอบ <Expression>
ภายใต้องค์ประกอบ <XPath>
ในนโยบาย regularExpressionProtection ในการแก้ปัญหาตัวอย่างด้านบน คุณสามารถแทนที่คำนำหน้า notapigee
เป็น apigee
ซึ่งประกาศในเนมสเปซดังนี้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:foo/apigee:bar</Expression> <Type>nodeset</Type> <Pattern>pattern</Pattern> <Pattern>pattern2</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
CannotBeConvertedToNodeset
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Deploying Revision revision_number to environment RegularExpressionProtection policy_name: Result of xpath xpath_expression cannot be converted to nodeset. Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Result of xpath count(//apigee:foo) cannot be converted to nodeset. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากนโยบายนิพจน์ทั่วไปมีนิพจน์ <XPath>
ที่กำหนดเอลิเมนต์ <Type>
เป็น nodeset แต่แปลงนิพจน์เป็น Nodeset ไม่ได้ การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและ XPath Expression ที่แปลงเป็น Nodeset ไม่ได้ ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาด
ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ
Regular-Expression-Protection-1
และ XPath Expression คือcount(//apigee:foo):
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Result of xpath count(//apigee:foo) cannot be converted to nodeset. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่า XPath ที่ตั้งค่าไว้ในองค์ประกอบ
<Expression>
ขององค์ประกอบ<XPath>
ตรงกับ XPath ที่ระบุในข้อความแสดงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้ระบุเป็น
count(//apigee:foo)
ซึ่งตรงกับข้อความแสดงข้อผิดพลาด<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>count(//apigee:foo)</Expression> <Type>nodeset</Type> <Pattern>pattern</Pattern> <Pattern>pattern2</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
ตรวจสอบค่าที่ตั้งไว้ในองค์ประกอบ
<Type>
ใต้องค์ประกอบ<XPath>
หากองค์ประกอบ<Type>
คือnodeset
แสดงว่านี่คือสาเหตุของข้อผิดพลาดในตัวอย่างนี้ นิพจน์ XPath คือ count() ซึ่งจะไม่แสดงโหนดอย่างน้อย 1 โหนด ดังนั้นการทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
หากตั้งค่าองค์ประกอบ <Type>
เป็น Nodeset ให้ตรวจสอบว่าผลลัพธ์ขององค์ประกอบ <Expression>
ที่ตั้งค่าไว้ใน <XPath>
คือโหนดอย่างน้อย 1 โหนด หรือเปลี่ยนองค์ประกอบ <Type>
เป็นค่าที่เหมาะสมมากขึ้นตามกรณีการใช้งานของคุณ
ในการแก้ไขตัวอย่างด้านบน คุณอาจเปลี่ยนองค์ประกอบ <Expression>
เป็นค่าอื่นที่ส่งคืนโหนดได้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:foo/apigee:bar</Expression> <Type>nodeset</Type> <Pattern>pattern</Pattern> <Pattern>pattern2</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
JSONPathCompilationFailed
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Deploying Revision revision_number to environment RegularExpressionProtection policy_name: Failed to compile jsonpath jsonpath_expression Context Revision:revision_number;APIProxy:RegexThreat;Organization:organization;Environment:environment.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile jsonpath $.store.book[*.author. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากองค์ประกอบ <Expression>
ภายใต้องค์ประกอบ <JSONPath>
ของนโยบายการป้องกันนิพจน์ทั่วไปได้รับการตั้งค่าเป็นนิพจน์ JSONPath ที่ไม่ถูกต้อง การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุชื่อนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและใช้นิพจน์ JSONPath ที่ไม่ถูกต้อง ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาด
ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ
Regular-Expression-Protection-1
และ JSONPath Expression คือ$.store.book[*.author:
Error Deploying Revision 1 to test RegularExpressionProtection Regular-Expression-Protection-1: Failed to compile jsonpath $.store.book[*.author. Context Revision:1;APIProxy:RegexThreat;Organization:myorg;Environment:test.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่าชุด JSONPath ในองค์ประกอบ
Expression
ตรงกับ JSONPath ที่ระบุในข้อความแสดงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้ระบุองค์ประกอบ
Expression
ภายใต้องค์ประกอบ<JSONPath>
เป็น$.store.book[*.author
ซึ่งตรงกับสิ่งที่อยู่ในข้อความแสดงข้อผิดพลาด<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <JSONPayload> <JSONPath> <Expression>$.store.book[*.author</Expression> <Pattern>REGEX PATTERN</Pattern> <Pattern>REGEX PATTERN</Pattern> </JSONPath> </JSONPayload> </RegularExpressionProtection>
ตรวจสอบองค์ประกอบ
<Expression>
ใต้องค์ประกอบ<JSONPath>
ในนโยบาย หากไม่ตรงกับไวยากรณ์ JSONPath นี่อาจเป็นสาเหตุของข้อผิดพลาด ในตัวอย่างข้างต้น ไม่มีวงเล็บเหลี่ยมปิด ซึ่งทำให้นิพจน์ไม่ถูกต้องเนื่องจากนิพจน์เส้นทาง JSON ไม่ถูกต้อง การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่าค่าสำหรับองค์ประกอบ <Expression>
ภายในองค์ประกอบ <JSONPath>
ในนโยบายการป้องกันนิพจน์ทั่วไปเป็นนิพจน์ JSONPath ที่ถูกต้อง
หากต้องการแก้ไขตัวอย่างที่แสดงด้านบน คุณสามารถเพิ่มวงเล็บเหลี่ยมปิดลงในค่าขององค์ประกอบ <Expression>
ได้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <JSONPayload> <JSONPath> <Expression>$.store.book[*].author</Expression> <Pattern>REGEX PATTERN</Pattern> <Pattern>REGEX PATTERN</Pattern> </JSONPath> </JSONPayload> </RegularExpressionProtection>
NothingToEnforce
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากนโยบาย regularExpressionProtection ไม่มีองค์ประกอบ <URIPath>
, <QueryParam>
, <Header>
, <FormParam>
, <XMLPayload>
หรือ <JSONPayload>
การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
ตามที่ระบุไว้ในข้อความแสดงข้อผิดพลาด นโยบาย regularExpressionProtection ต้องมีองค์ประกอบต่อไปนี้อย่างน้อย 1 รายการที่รวมอยู่ในนโยบาย ได้แก่ <URIPath>
, <QueryParam>
, <Header>
, <FormParam>
, <XMLPayload>
หรือ <JSONPayload>
การวินิจฉัย
ระบุชื่อนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาด ซึ่งคุณสามารถดูได้ในข้อความแสดงข้อผิดพลาด ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ
Regular-Expression-Protection-1:
RegularExpressionProtection Regular-Expression-Protection-1: at least one of URIPath, QueryParam, Header, FormParam, XMLPayload, JSONPayload is mandatory.
ตรวจสอบนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว (ระบุในขั้นตอนที่ 1 ด้านบน) หากนโยบายไม่มีองค์ประกอบต่อไปนี้เลย:
<URIPath>
,<QueryParam>
,<Header>
,<FormParam>
,<XMLPayload>
หรือ<JSONPayload>
นั่นก็คือสาเหตุของข้อผิดพลาดตัวอย่างเช่น นโยบายการป้องกันนิพจน์ทั่วไปต่อไปนี้ไม่มีองค์ประกอบที่ระบุไว้ข้างต้น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> </RegularExpressionProtection>
เนื่องจากไม่มีองค์ประกอบที่จำเป็นใดๆ ในนโยบายการดึงข้อมูลตัวแปร การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่านโยบาย regularExpressionProtection มีองค์ประกอบที่จำเป็นอย่างน้อย 1 รายการ ได้แก่ <URIPath>
, <QueryParam>
, <Header>
, <FormParam>
, <XMLPayload>
หรือ <JSONPayload>
เช่น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <JSONPayload> <JSONPath> <Expression>$.store.book[*].author</Expression> <Pattern>REGEX PATTERN</Pattern> <Pattern>REGEX PATTERN</Pattern> </JSONPath> </JSONPayload> </RegularExpressionProtection>
NoPatternsToEnforce
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: No patterns to enforce in payload_name.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: No patterns to enforce in XPath.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากองค์ประกอบระดับบนสุด (<URIPath>
, <QueryParam>
, <Header>
, <FormParam>
, <XMLPayload>
หรือ <JSONPayload>
) ไม่มีองค์ประกอบ <Pattern>
ที่กำหนดไว้ในนโยบาย regularExpressionProtection การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุชื่อนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและองค์ประกอบย่อยที่ไม่มีองค์ประกอบ
<Pattern>
ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาดตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ
Regular-Expression-Protection-1
และองค์ประกอบย่อยคือXPath:
RegularExpressionProtection Regular-Expression-Protection-1: No patterns to enforce in XPath.
- ตรวจสอบนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลวและตรวจสอบว่าองค์ประกอบย่อยที่ระบุในขั้นตอนที่ 1 ไม่มีองค์ประกอบ
<Pattern>
หรือไม่ หากไม่มีองค์ประกอบ<Pattern>
อยู่ นั่นคือสาเหตุของข้อผิดพลาดตัวอย่างเช่น นโยบายต่อไปนี้ไม่มีองค์ประกอบ
<Pattern>
ภายใน<XPath>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> </XPath> </XMLPayload> </RegularExpressionProtection>
เนื่องจากองค์ประกอบ
<XPath>
ไม่มีองค์ประกอบ<Pattern>
การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่าองค์ประกอบ <URIPath>
, <QueryParam>
, <Header>
, <FormParam>
, <XMLPayload>
หรือ <JSONPayload>
มีการระบุ <Pattern>
อย่างน้อย 1 รายการ ดูข้อมูลเกี่ยวกับวิธีระบุองค์ประกอบอย่างถูกต้องได้ที่นโยบาย regularExpressionProtection
ในการแก้ไขตัวอย่างด้านบน เราสามารถเพิ่มองค์ประกอบ <Pattern>
ไปยังองค์ประกอบ <XPath>
ภายใต้ <XMLPayload>
ดังนี้
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
NONEmptyPrefixMappedToEmptyURI
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: Non-empty prefix prefix_name cannot be mapped to empty uri.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: Non-empty prefix apigee cannot be mapped to empty uri.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
ข้อผิดพลาดนี้เกิดขึ้นหากนโยบาย regularExpressionProtection มีคำนำหน้าที่กำหนดไว้ในองค์ประกอบ <Namespace>
ภายใต้องค์ประกอบ <XMLPayload>
แต่ไม่ได้กำหนด URI ไว้
การวินิจฉัย
ระบุนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและชื่อของคำนำหน้าที่ไม่ได้จับคู่กับ URI ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาด
ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ Mean Expression Protection-1 และคำนำหน้าคือ Apigee
RegularExpressionProtection Regular-Expression-Protection-1: Non-empty prefix apigee cannot be mapped to empty uri.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่าชื่อของคำนำหน้าที่ตั้งไว้ในองค์ประกอบ
<Namespace>
ภายใต้องค์ประกอบ<XMLPayload>
ตรงกับชื่อคำนำหน้าที่ระบุในข้อความแสดงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้ระบุคำนำหน้าชื่อ apigee ในองค์ประกอบ
<Namespace>
ซึ่งตรงกับสิ่งที่อยู่ในข้อความแสดงข้อผิดพลาด<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee"/> <Namespace prefix="gmail">http://mail.google.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
ตรวจสอบว่าองค์ประกอบ
<Namespace>
ที่มีคำนำหน้าที่เจาะจงซึ่งระบุไว้ในขั้นตอนที่ 2 มี URI ที่ถูกต้องหรือไม่ หากไม่มี URI นั่นแสดงว่าเป็นสาเหตุของข้อผิดพลาดในตัวอย่างนโยบายการป้องกันนิพจน์ทั่วไปที่แสดงด้านบน ให้สังเกตว่าไม่มี URI ที่ตรงกับองค์ประกอบ
<Namespace>
ที่มี Apigee เป็นคำนำหน้า ดังนั้น คุณจะได้รับข้อผิดพลาดNon-empty prefix apigee cannot be mapped to empty uri.
ความละเอียด
ตรวจสอบว่าองค์ประกอบ <Namespace>
ทั้งหมดที่กำหนดไว้ด้วยคำนำหน้ามี URI ที่สอดคล้องกันในนโยบายการดึงข้อมูลตัวแปร เช่น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> <Namespace prefix="gmail">http://mail.google.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
DuplicatePrefix
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: Duplicate prefix prefix_name.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: Duplicate prefix apigee.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
ข้อผิดพลาดนี้เกิดขึ้นหากนโยบาย regularExpressionProtection มีคำนำหน้าเดียวกันที่กำหนดไว้มากกว่า 1 ครั้งในองค์ประกอบ <Namespace>
ภายใต้องค์ประกอบ <XMLPayload>
ตัวอย่างเช่น ข้อผิดพลาดนี้เกิดขึ้นเนื่องจากมีการกำหนด Apigee ของคำนำหน้า 2 ครั้งดังที่แสดงด้านล่าง
<Namespace prefix="apigee">http://www.apigee.com</Namespace> <Namespace prefix="apigee">http://www.apigee.com</Namespace>
การวินิจฉัย
ระบุนโยบาย regularExpressionProtection ที่เกิดข้อผิดพลาดและชื่อของคำนำหน้า ซึ่งคุณจะเห็นทั้ง 2 รายการนี้ในข้อความแสดงข้อผิดพลาด
ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ Mean Expression Protection-1 และคำนำหน้าคือ Apigee
RegularExpressionProtection Regular-Expression-Protection-1: Duplicate prefix apigee.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่าชื่อของคำนำหน้าที่ตั้งไว้ในองค์ประกอบ
<Namespace>
ภายใต้องค์ประกอบ<XMLPayload>
ตรงกับชื่อคำนำหน้าที่ระบุในข้อความแสดงข้อผิดพลาด (ขั้นตอนที่ 1 ด้านบน)ตัวอย่างเช่น นโยบายต่อไปนี้ระบุคำนำหน้าชื่อ apigee ในองค์ประกอบ
<Namespace>
ซึ่งตรงกับสิ่งที่อยู่ในข้อความแสดงข้อผิดพลาด<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
ตรวจสอบว่าองค์ประกอบ
<Namespace>
ที่มีคำนำหน้าเฉพาะที่ระบุในขั้นตอนที่ 2 ได้รับการกำหนดมากกว่า 1 ครั้งหรือไม่ หากมีการกำหนดไว้มากกว่า 1 ครั้ง ก็แสดงว่านี่คือสาเหตุของข้อผิดพลาดในตัวอย่างนโยบายการป้องกันนิพจน์ทั่วไปที่แสดงด้านบน ให้สังเกตว่าองค์ประกอบ
<Namespace>
ที่มี Apigee เป็นคำนำหน้าได้รับการกำหนด 2 ครั้ง ดังนั้น คุณจะได้รับข้อผิดพลาดDuplicate prefix apigee.
ความละเอียด
ตรวจสอบว่ามีเพียง 1 คำจำกัดความสำหรับคำนำหน้าแต่ละรายการในองค์ประกอบ <Namespace>
ในนโยบาย regularExpressionProtection เช่น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
EmptyXPathExpression
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: Empty XPath expression.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: Empty XPath expression.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากนโยบาย regularExpressionProtection ไม่มีองค์ประกอบ <Expression>
ที่ตั้งค่าไว้ภายในองค์ประกอบ <XPath>
การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลวจากข้อความแสดงข้อผิดพลาด ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ regular-Expression-Protection-1
RegularExpressionProtection Regular-Expression-Protection-1: Empty XPath expression.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่ามีองค์ประกอบ
<XMLPayload>
ที่มีองค์ประกอบย่อย<XPath>
ที่ไม่ได้กำหนดองค์ประกอบ<Expression>
ไว้ หรือองค์ประกอบ<Expression>
ไม่ได้ตั้งค่าเป็นค่าใดๆ ถ้าเป็นเช่นนั้น นี่คือสาเหตุของข้อผิดพลาดลองดูตัวอย่างนโยบายการป้องกันนิพจน์ทั่วไปที่มีเอลิเมนต์
<XMLPayload>
ดังต่อไปนี้<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression></Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
เนื่องจากมีองค์ประกอบ
<Expression>
ที่ว่างเปล่าภายในองค์ประกอบ<XPath>
การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่านโยบาย regularExpressionProtection มีองค์ประกอบ <Expression>
ที่ไม่ว่างเปล่าและถูกต้องซึ่งกำหนดไว้ภายใต้องค์ประกอบ <XPath>
เช่น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <XMLPayload> <Namespaces> <Namespace prefix="apigee">http://www.apigee.com</Namespace> </Namespaces> <XPath> <Expression>/apigee:Greeting/apigee:User</Expression> <Type>string</Type> <Pattern>REGEX PATTERN</Pattern> </XPath> </XMLPayload> </RegularExpressionProtection>
EmptyJSONPathExpression
ข้อความแสดงข้อผิดพลาด
การทำให้พร็อกซี API ใช้งานได้ผ่าน Edge UI หรือ Edge Management API จะล้มเหลวโดยมีข้อความแสดงข้อผิดพลาดต่อไปนี้
Error Saving Revision revision_number RegularExpressionProtection policy_name: Empty JSONPath expression.
ตัวอย่างข้อความแสดงข้อผิดพลาด
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: Empty JSONPath expression.
ตัวอย่างภาพหน้าจอแสดงข้อผิดพลาด
สาเหตุ
หากนโยบาย regularExpressionProtection ไม่มีองค์ประกอบ <Expression>
ที่ตั้งค่าไว้ภายในองค์ประกอบ <JSONPath>
การทำให้พร็อกซี API ใช้งานได้จะล้มเหลว
การวินิจฉัย
ระบุนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลวจากข้อความแสดงข้อผิดพลาด ตัวอย่างเช่น ในข้อผิดพลาดต่อไปนี้ ชื่อนโยบายคือ regular-Expression-Protection-1
Error Saving Revision 1 RegularExpressionProtection Regular-Expression-Protection-1: Empty JSONPath expression.
ใน XML ของนโยบายการป้องกันนิพจน์ทั่วไปที่ล้มเหลว ให้ตรวจสอบว่ามีองค์ประกอบ
<JSONPayload>
ที่มีองค์ประกอบย่อย<JSONPath>
ที่ไม่มีองค์ประกอบ<Expression>
ที่กำหนดไว้ หรือองค์ประกอบ<Expression>
ไม่ได้ตั้งค่าใดๆ หรือไม่ ถ้าเป็นเช่นนั้น นี่คือสาเหตุของข้อผิดพลาดลองดูตัวอย่างนโยบายการป้องกันนิพจน์ทั่วไปที่มีเอลิเมนต์
<JSONPayload>
ดังต่อไปนี้<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <JSONPayload> <JSONPath> <Expression></Expression> <Pattern>REGEX PATTERN</Pattern> <Pattern>REGEX PATTERN</Pattern> </JSONPath> </JSONPayload> </RegularExpressionProtection>
เนื่องจากมีองค์ประกอบ
<Expression>
ที่ว่างเปล่าภายในองค์ประกอบ<JSONPath>
การทำให้พร็อกซี API ใช้งานได้จึงล้มเหลว
ความละเอียด
ตรวจสอบว่านโยบาย regularExpressionProtection มีองค์ประกอบ <Expression>
ที่ไม่ว่างเปล่าและถูกต้องซึ่งกำหนดไว้ภายใต้องค์ประกอบ <JSONPath>
เช่น
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RegularExpressionProtection async="false" continueOnError="false" enabled="true" name="Regular-Expression-Protection-1"> <DisplayName>Regular Expression Protection-1</DisplayName> <Properties/> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Source>request</Source> <JSONPayload> <JSONPath> <Expression>$.store.book[*].author</Expression> <Pattern>REGEX PATTERN</Pattern> <Pattern>REGEX PATTERN</Pattern> </JSONPath> </JSONPayload> </RegularExpressionProtection>