Resolving 'Compile OS (302:309): An error occurred while creating server data' via DCF Cache Remediation

Resolving 'Compile OS (302:309): An error occurred while creating server data' via DCF Cache Remediation

In SIMATIC PCS 7, the compilation abort 'Compile OS (302:309): An error occurred while creating server data' signifies that the WinCC package generator failed to generate or update the server data package (.pck) inside the OS project. This failure is directly caused by locked Microsoft SQL Server database tables, out-of-sync Data Communication Files (.dcf), or obsolete server packages referencing previous computer names. To resolve the error, close SIMATIC Manager, terminate WinCC background processes using CCProjectMgr.exe, delete all .dcf files in the WinCC project directory, delete existing .pck files under the 'packages' folder, and initiate a complete OS compilation.

Table of Contents

Executive Summary

During the final phase of PCS 7 OS compilation, the system invokes internal routines to publish server data packages (.pck) containing tag lists, archive structures, and message classes for client access. If this routine encounters file access locks, stale database pointers, or conflicting .dcf cache structures, compilation terminates abruptly with Compile OS (302:309): An error occurred while creating server data. This issue is particularly prevalent after restoring archived projects or renaming server stations. This guide details the internal mechanisms of server data package generation and provides an actionable recovery procedure.

Architecture and Fundamental Mechanics

The server data generation mechanism coordinates several software subsystems:
1. Server Data Package Generation (.pck):
In a client-server PCS 7 architecture, OS Clients do not access AS controllers directly. Instead, they access OS Servers using server data packages (<ProjectName>_<OSName>.pck). These packages encapsulate runtime tags, message types, and archive server prefixes.
2. The Role of Data Communication Files (.dcf):
The WinCC Communication Subsystem maintains .dcf files (such as <ProjectName>.dcf and <ComputerName>.dcf) as high-speed synchronization caches between WinCC editors and the Microsoft SQL Server instance (MSSQL$WINCC). When an OS compile takes place, the package generator writes updated tag metadata to these files.
3. Failure Trigger Mechanisms for Error 302:309:
- Database Lock: If CCProjectMgr.exe or an orphaned SQL process holds a lock on the database catalog, file write operations fail.
- Stale DCF Cache: If .dcf files contain obsolete GUIDs or outdated computer names from a previous system, the package generator cannot reconcile internal references.
- Corrupted Existing Package: If an existing .pck file in the packages subfolder has read-only flags or binary corruption, the compiler cannot overwrite it.

Step-by-Step Implementation Procedure

  1. Terminate All Active WinCC Processes:
    a. Close SIMATIC Manager and WinCC Explorer.
    b. Open Windows Command Prompt as Administrator.
    c. Execute CCProjectMgr.exe /force or open Windows Task Manager.
    d. Ensure that processes such as CCProjectMgr.exe, CCWinCCStoreSvc.exe, and WinCCExplorer.exe are completely stopped.

  2. Clear Corrupted DCF and Temporary Cache Files:
    a. Open Windows File Explorer and navigate to the project directory: <Multiproject>\wincproj\<OS_Server>\.
    b. Search for *.dcf and delete all matching files in the OS folder.
    c. Navigate to the packages subfolder inside the OS directory (e.g., <OS_Directory>\packages\).
    d. Delete any existing .pck files located in this directory.

  3. Restart the WinCC SQL Server Service:
    a. Press Win + R, type services.msc, and press Enter.
    b. Locate service SQL Server (MSSQL$WINCC).
    c. Right-click the service and select 'Restart'.
    d. Verify that the service enters 'Running' state cleanly.

  4. Recreate Server Data Manually in WinCC Explorer (Optional Sanity Check):
    a. Open the OS project directly in WinCC Explorer.
    b. In the navigation tree, right-click 'Server Data' and select 'Create...'.
    c. Confirm that a new server package is generated without error dialogs.
    d. Close WinCC Explorer.

  5. Execute Full OS Compilation from SIMATIC Manager:
    a. Open SIMATIC Manager and navigate to the Component View.
    b. Right-click the OS Server object -> Compile.
    c. In the wizard, select 'Entire OS' and check 'Generate server data'.
    d. Run the compilation: verify that the compilation completes with 0 errors and generates the updated server data package.

Verification

  1. Check the compilation summary dialog: confirm 'Compile OS completed with 0 errors'.
  2. In Windows File Explorer, open <OS_Directory>\packages\: confirm that a new .pck file exists with the current system timestamp.
  3. Open WinCC Explorer on an OS Client station, open 'Server Data', right-click, and select 'Load': confirm that the newly created server package loads successfully and lists all server tags.

Limitations and Operational Precautions

Deleting .dcf files is safe, but never delete SQL database files (.mdf or .ldf). Always ensure WinCC Explorer is fully closed before modifying files in the project folder to prevent database catalog desynchronization.

Engineer FAQ

What is a server data package (.pck) in PCS 7?

It is an exported configuration file containing tag lists, alarm types, and server connection paths used by OS Clients to access server runtime data.

Why does deleting .dcf files fix error 302:309?

Deleting .dcf files forces WinCC to purge stale cached metadata and rebuild the communication database directly from the SQL Server tables.

What should I do if error 302:309 persists after deleting .dcf files?

Restart the MSSQL$WINCC service, verify that the Windows computer name matches the WinCC project properties, and verify that the target hard drive has adequate free storage space.

Can I generate server data if the OS project is already in Runtime?

No. Generating server data during OS compilation requires offline access to configuration databases; compiling while Runtime is active can trigger file access conflicts.

Do OS Single Stations generate server data packages?

OS Single Stations can generate server data if configured to act as reference servers or Web servers for thin clients.

Technical References

Related Articles

Related Tags

  • Compile OS
  • Server Data
  • Error 302:309
  • PCK Package
  • WinCC Database
  • DCF Cache
20 respuestas