The Kaspersky Anti-Virus Engine C API library does not throw exceptions or handle errors. Discovered errors and values are returned as return codes.
Functions from the Kaspersky Anti-Virus Software Development Kit 8 Level 3 for Windows use two types of return codes: system codes and custom codes.
Most KAV SDK functions targeted for Windows platform return HRESULT data type values.
System values are defined in the winerror.h file. Custom return values are defined in the SDK_folder/Include/kave8_def.h file where SDK_folder is your SDK folder.
Return values can be either returned by an SDK function, or sent to the callback function in case of the EVENT_ERROR callback event.
The table below describes operating system return codes.
For more information about the system codes, please see the documentation for the winerror.h header file provided by Microsoft.
System return codes
Return value |
Description |
|---|---|
|
The operation completed successfully. |
|
An attempt to call KAV SDK will initialize, but cloud features will not be available. If logging is turn on, KAV SDK adds details to the log file. |
|
Unexpected error occurred during execution. |
|
The function was called at unexpected moment. For example, this code is returned when calling function before initializing or after uninitializing, or invoking it before the previous call is completed (for example, the function is called from different threads). |
|
Invalid arguments were passed into the function. |
|
There was an attempt to call function before loading the library. |
|
The process is running out of system memory. |
|
The specified programming interface is not supported. |
|
The specified pointer is invalid. |
|
The specified handle of an object is invalid. |
|
Operation has been aborted. |
|
General access error. |
The table below lists custom return codes and their descriptions.
Custom return codes
Return code |
Description |
|---|---|
|
The scanning task queue is overloaded (the queue length is set during initialization and can be changed by using the |
|
One of the SDK modules is not found during initialization. |
|
Anti-virus database used by the SDK is corrupted. This value is also returned when no database is found in the indicated location (the location is specified during initialization, otherwise the default path is used). |
|
This value is returned in case the An attempt to call
|
|
Specified license KEY file is expired or missing from the default or custom location. Note that when using For more information, see section "License lifecycle". |
|
You attempt to start KAV SDK with limited functionality. Used KEY file does not allow you to initialize KAV SDK with the specified flags. KAV SDK will not initialize. |
|
This code is returned after the timeout period specified in the For more information about the |
|
Please notice that in some cases this event may not be raised when there is not enough disk space left. Please always be sure check with KAV SDK system requirements to avoid issues with running SDK on a low disk space. For more information, refer to section "System requirements". There is not enough disk space to store temporary files during the scanning process. |
|
Not enough rights to access the file. |
|
The nesting level is too high to scan the object. |
|
Reboot is necessary for normal POP3 monitor functioning. This code can be returned only after the POP3 anti-virus database is updated; the For more information about callback events, see section "Event notification codes". |
|
This return code indicates that infected file will not be removed upon the next reboot. Preparing the infected file for deletion on the next reboot has failed for some reason and deletion cannot be performed on the next reboot. This code is returned by KAV SDK when Advanced Disinfection mechanism (see section "Advanced Disinfection mode") fails to mark the infected file for deletion. This could be caused by a locking problem such as when the file to be marked is being locked by another process and cannot be deleted in-place. When handling this code, it is recommended that you use external tools developed by Kaspersky Lab. For more information about these tools contact with your Technology Account Manager (TAM). |
|
This return code indicates that infected file will not be disinfected upon the next reboot. Preparing the infected file for disinfection on the next reboot has failed for some reason and disinfection cannot be performed on the next reboot. This code is returned by KAV SDK when Advanced Disinfection mechanism (see section "Advanced Disinfection mode") fails to mark the infected file for disinfection. |
|
Error occurred while trying to read the file. |
|
The object cannot be disinfected because it cannot be accessed for writing. |
Handling return values in service mode
In UNIX environment you can troubleshoot KAV SDK server workflow issues at the run time using error codes returned by kavehost service. The kavehost service implements server functionality and may return an error code while it is running or at startup to help you resolve issues.
The error codes are returned by kavehost service to the standard output (console STDOUT). The 0 return code indicates a successful operation performed by KAV Engine. Any non-zero value of return code indicates an issue. For detailed information about the type of an issue please appeal to your Technical Account Manager. The following types of issues may be reported:
The following table allows you to retrieve error descriptions by the error code and message returned by kavehost to standard output:
Error codes returned by kavehost service
Return code |
Message |
Description |
|---|---|---|
|
N/A. No error message is returned. |
This is a success return code and indicates successful operation performed by KAV server. No error message is returned to stdout. |
|
Config path must be absolute; now [%s] |
An invalid path to the |
|
Error load settings from config file: [%s] |
There was an error parsing configuration XML file. Please check that XML layout is correct and all configuration file options have been correctly specified. Refer to section "Kavehost service configuration file" for more information about configuring kavehost service settings using configuration file. |
|
Cannot start server: set signal processing failed |
The |
|
Cannot start server: fork failed |
There was an error starting a child kavehost process at initialization stage. During initialization |
|
Cannot start server: setsid failed |
The server could not be started, because there was an error creating new session for |
|
Cannot start server: out of memory |
Operating system is running out of memory. There is not enough memory to start |
|
Cannot start server: preparing server connections failed |
Starting |
|
Cannot start server: Necessary module not found! |
Error starting For more information, see description of the |
|
Cannot start server: Invalid updateable antivirus databases! |
Anti-virus database used by the SDK is corrupted. This value is also returned when no database is found in the indicated location (the location is specified during initialization, otherwise the default path is used). Additionally, see description of the |
|
Cannot start server: Product is not registered! |
This value is returned in case the For more information, see section "Licensing". Additionally, see description of the |
|
Cannot start server: Product license is expired or missing! |
The license key file is not found, or it is expired. For more information, see section "License lifecycle". Additionally, see description of the |
|
Cannot start server: initializing server object failed |
There was an error initializing KAV Engine. This error code indicates some issue with initialization of scanning engine loaded by |
|
Cannot run server object |
There was an error at the post-initialization workflow, for example, service failed accessing UNIX sockets. This error may occur, when UNIX sockets that were present at initialization have been forcibly removed by external process at kavehost runtime. |
|
Cannot write pid file %s.kavehost ended |
The |
|
Cannot start server: waiting signal failed |
The
|
|
Cannot start server: sigchild |
The |
|
Cannot run server: Extended error! |
Some unexpected error occurred that cannot be handled. |