Q. The Flows service will not start and I see the following in the netsaw2.log file:

09/22/2015 11:48:43.963591 Storage Manager: corrupt record 16 in meta-database /Library/Application Support/ns2flows/SESSIOND /ns2sessions.metadb 09/22/2015 11:48:43.979851 Failed to allocate storage!


A.The IMFlows server keeps an index file containing information about your session database in a file names ns2sessions.metadb in the SESSIONDB directory. This file keeps track of the sessions kept in each .dat file, and enables Flows to start up in a reasonable period of time. However, this file can become corrupted. In particular, an improper stop to the service -- a system crash, for example, or receipt of a SIGKILL -- can cause it to be corrupted or simply out of sync with the database. A bug in IMFlows 1.2 could also cause this issue on shutdown after making adjustments to the database.

When this happens, the server will exit with status -1 or 0xfffffff (Windows will frequently report the latter when the service is started via the Windows Services interface) This issue can generate misleading log entries and stderr output, however, frequently with references to being unable to write to the disk. This depends on the exact nature of the mis-written segment of the file.

The solution to this problem is simply to delete the SESSIONDB\ns2sessions.metadb file and restart the service. On start, Flows will recognize that the file is missing and will rebuild the service. During this time it will not accept client connections or incoming Netflow data. It is crucial that it be allowed to fully recreate this file before shutting down or the new ns2sessions.metadb file will also be corrupted, and the process must be repeated. Historical data will not be lost, so there is no harm (other than inability to collect data) to removing this file and attempting to restart if the Flows server will not start.