--- title: "MSSQL_ENG021331 | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: sql ms.prod_service: "database-engine" ms.reviewer: "" ms.technology: replication ms.topic: conceptual helpviewer_keywords: - "MSSQL_ENG021331 error" ms.assetid: 9acd75d9-fda1-44cd-ba17-20295ad53ea0 author: "MashaMSFT" ms.author: "mathoma" monikerRange: "=azuresqldb-mi-current||>=sql-server-2016||=sqlallproducts-allversions" --- # MSSQL_ENG021331 [!INCLUDE[appliesto-ss-asdbmi-xxxx-xxx-md](../../includes/appliesto-ss-asdbmi-xxxx-xxx-md.md)] ## Message Details ||| |-|-| |Product Name|SQL Server| |Event ID|21331| |Event Source|MSSQLSERVER| |Component|[!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)]| |Symbolic Name|| |Message Text|Failed to copy user script file to the Distributor.(%ls)| ## Explanation This error can occur when a subscription is initialized manually, and the scripts generated by replication, or specified in a replication command, cannot be saved to the specified directory. The error can be caused by a permissions issue: when a subscription is initialized without using a snapshot, the account under which the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service runs at the Publisher must have write permissions on the snapshot folder at the Distributor. ## User Action Ensure that the correct path has been specified for the snapshot folder and that the account under which the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service runs at the Publisher has sufficient permissions. ## See Also [Specify Snapshot Options](../../relational-databases/replication/snapshot-options.md) [Errors and Events Reference (Replication)](../../relational-databases/replication/errors-and-events-reference-replication.md) [Initialize a Transactional Subscription Without a Snapshot](../../relational-databases/replication/initialize-a-transactional-subscription-without-a-snapshot.md)