Error: "Expected URL pattern or 'category=': 'define'" loading a local database on Edge SWG
search cancel

Error: "Expected URL pattern or 'category=': 'define'" loading a local database on Edge SWG

book

Article ID: 429400

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

Administrators started seeing or receiving critical alerts regarding the local database download. This issue typically occurs after you have manually modified or updated a Local Database file, such as custom local categories or category files.

The following error message appears in the download status for the local database:

ERROR: (line 5625): Expected URL pattern or 'category=': 'define'
    There was 1 error
  Database build failed

This error prevents the appliance from successfully loading the updated database.

Environment

  • Product: Edge SWG (ProxySG)

  • Feature: Local Database with Custom Categories

Cause

The root cause of this error is a syntax omission within the local database file. Specifically, a define category block is missing the required end control word at the conclusion of the list.

When you omit the end statement, the parser continues to look for URL patterns belonging to the current category. When it hits the next define keyword for a subsequent category, it triggers a syntax error because it expects a URL or a category assignment rather than a new definition command.

Resolution

To resolve this error, you must ensure that every defined category block in your local database file is correctly terminated.

  1. Access the local database file or the source file used for your custom categories.

  2. Review the file structure to ensure that every define category [category_name] statement is paired with an end statement on its own line.

  3. Ensure there are no nested definitions or orphaned define statements.

Correct Syntax Example

Use the following format to ensure the parser correctly identifies the start and end of your custom category:

define category My_Custom_Category
   example.com
   example.org 
end
  1. Save the changes to the file.

  2. Re-download or Install the policy again.

Once the end statements are correctly placed the download and build of the database will succeed and the critical error will be resolved. 

Additional Information

If you have a very large local database file, use the line number provided in the error message to quickly locate the specific block that is missing the end keyword. The error usually triggers on the line where the next category starts.

References: 
Configure a Local Database