I have a store running 18.104.22.168 (updated from a clean install of 1.6). The store keeps running into the "An error occurred while saving the URL rewrite" error.
The store is a very simple installation with only premium matrix rate installed as an additional module.
On trying to refresh the Catalog URL Rewrites the following error occurs: "An error occurred while saving the URL rewrite"
Attempts to fix:
- recursively chown entire store directory to correct user
- recursively chmod 777 var and media
- clear var/session, var/cache, var/locks
- Backup and truncate core_url_rewrite (resolves or a short time) but less than ideal due to indexing issues on renamed products and future use of custom rewrites
Checking the logs the errors that are being generated are along the following lines:
SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'category-name/sub-category-1' for key 'UNQ_CORE_URL_REWRITE_REQUEST_PATH_STORE_ID'
UNQ_CORE_URL_REWRITE_REQUEST_PATH_STORE_ID belongs to
core_url_rewrite and is a
UNIQUE KEY across the
The duplicate value in question doesn't actually exist in the request_path however multiple instances of request_path/store_id duplicates seem to be in the database.
Example of a duplicate entry:
INSERT INTO `core_url_rewrite` (`url_rewrite_id`, `store_id`, `category_id`, `product_id`, `id_path`, `request_path`, `target_path`, `is_system`, `options`, `description`) VALUES (5246, 1, 376, NULL, 'category/376', 'test-assemblies/123-assemblies', 'catalog/category/view/id/376', 1, NULL, NULL), (6334, 1, 376, NULL, 'category/376', 'test-assemblies/123-assemblies', 'catalog/category/view/id/376', 1, NULL, NULL);
- Would it be safe for me to go through and remove all duplicate entries and potentially resolve the issue?
- What could be happening to allow duplicate entries to occur?
- Can anyone shed any light on the issue?
Update: seems to be an issue with categories not product looking further into the issue.