Search This Blog

Wednesday 6 July 2022

Fix a corrupt history database for WatchFTP

When your computer abruptly shuts down or crashes, it can happen WatchFTP's history database becomes corrupt. Your task can not run anymore.


When this has happened you will typically get a message about SQL Errors (can not select from the housekeeping table). When you start the WatchFTP control center it tries to fix this but sometimes it needs a little help.


How to fix this issue

You will need to delete the current (corrupt) database, here is how:
  • Open the WatchFTP Control Center
  • Make sure the problem task is stopped
  • Right-click the task and select "Explore Task Directory" from the popup menu. This will open Windows Explorer, typically inside (a subdirectory of) "C:\ProgramData\WatchFTP"
  • Make sure you are in a subdirectory with the same name of the task
  • Delete all files with names that start with "history", it is typically only one but there could be a few
  • Stop the WatchFTP Control Center and start it again, this will create a new (empty) history database

After this, your task should run fine again.

 

Please note this will not work for WatchDirectory. A future blog will explain how to fix a WatchDirectory corrupt database.


Friday 1 July 2022

WatchDirectory - Could not create temporary file

 

If you try to edit or create a WatchDirectory task and receive a message like

"Could not create a temporary file"

Here is the reason and how to resolve this issue.

Why this happens

While you create or edit a task the WatchDirectory Control Center needs to store your new settings somewhere. It can not be inside the WatchDirectory settings directory itself because you may cancel editing. So WatchDirectory asks Windows what the directory for "temporary files" is.
All your changes are made to a temporary file inside that directory. When you press OK, the file is moved to the WatchDirectory settings directory.

The problem here is Windows tells WatchDirectory it can create temporary files in some directory (something like C:\Temp), but there is a problem. Typically the directory does not exist or (not so common) WatchDirectory is not allowed to write/create/delete files inside the directory.

How to resolve

Here are the steps you need to follow to fix this:
  1. Stop the WatchDirectory Control Center
  2. Open a Windows command prompt by running cmd.exe
  3. On the command prompt enter the following 2 commands
    SET TMP
    SET TEMP
Those commands will respond with the name of 1 or 2 directories (they typically are the same directory). Now you need to make sure those directories exist and "Everyone" has the privilege to create/change/delete files inside them.