Skip to main content
All CollectionsKnowledge BaseEndpoint and SaaS AppsTroubleshooting - Endpoint and SaaS Apps
Troubleshooting Error: Cannot write to log file - Access Denied
Troubleshooting Error: Cannot write to log file - Access Denied
Updated over a week ago

This article applies to:

  • OS: Windows

  • Product edition: inSync Client

Problem description

inSync Client displays the following error message. The error states that inSyncAgent.exe does not have permissions to create the C:\ProgramFiles(x86)\Druva\inSync\inSyncAgent.exe.log

CantWriteToLogs.png

Multiple underlying scenarios are responsible for this error. However, the client displays this error as the inSync Agent fails to write the error logs. According to the error message, inSyncAgent.exe is not able to create a log file at C:\ProgramFiles(x86)\Druva\inSync on the user's device. This is because the user does not have write permissions at the location where the inSyncAgent.exe tries to write the log file.

To enable write permissions for the user at C:\ProgramFiles(x86)\Druva\inSync:

  1. Log in to the device and go to C:\ProgramFiles(x86)\Druva.

  2. Right-click the inSync folder and click Properties.

  3. Open the Security tab.

  4. Under Group or user names list, select the username and enable the Write permission for the user.
    For example, the below screen capture displays write permissions enabled for the username Win 10.

    EnableWritePermissions.png



    This allows the inSync Agent to create error logs under C:\ProgramFiles(x86)\Druva\inSync. The error logs can be used further to resolve the underlying issues causing the error.

After user permissions are enabled for C:\ProgramFiles(x86)\Druva\inSync, the following error message is displayed when the inSync services are restarted on the device.

WritePermissionsError.png

The scenarios that can cause this error are as follows:

Resolution of error scenarios

Description and troubleshooting steps for each error scenario are discussed below.

inSync fails to access the temp folder

During a system startup, inSync writes bootstrap logs to the temp folder of the user. If inSync fails to access the temp folder, it displays the error message. The access to the temp folder of the user may be blocked by the antivirus software installed on the system. After closing the error message, it does not show up again until the next reboot.

Traceback

The following traceback is seen inside the inSync Agent.exe.log file.

Traceback (most recent call last):
File "inSyncAgent.py", line 794, in <module>
File "inSyncAgent.py", line 742, in main
File "inSyncAgent.py", line 551, in run
File "inSyncLib\inSyncLog.pyc", line 452, in __init__
inSyncLib.inSyncError.SyncError: Unable to Write to log file. Error : No such file or directory (#10000000b)

Resolution

  • Set the inSync Client process to delayed start.

  • When a system is booting during the initial few minutes, an antivirus can lock the %temp% folder and during this phase, inSync is unable to access the folder.

  • By setting the process to delayed start, you can force the inSync process to start after the system comes up.

  • If this fixes the issue, then you need to run the machine in clean boot to identify the application that may be causing the issue.

  • If you are still not able to identify the application causing the issue after a clean boot, you will need to remove all the security applications on this machine to identify the cause of the issue.

Antivirus software permissions were changed for inSync folders

inSync displays the error message repeatedly if the user does not have access permissions to the C:\ProgramData\Druva\inSync4\Users\<username>\logs folder.

Traceback

The following traceback is found in the logs.


💡 Tip

If the logs are not accessible due to the absence of user permissions, perform the procedure described above to obtain the user access to the logs.


Traceback (most recent call last):
  File "inSyncAgent.py", line 982, in <module>
  File "inSyncAgent.py", line 911, in main
  File "inSyncAgent.py", line 725, in run
  File "inSyncAgent.py", line 70, in __init__
  File "inSyncAgent.py", line 98, in startlogger
  File "inSyncLib\inSyncLog.pyc", line 464, in __init__
  File "inSyncLib\inSyncLog.pyc", line 184, in __init__
  File "logging\handlers.pyc", line 117, in __init__
  File "logging\handlers.pyc", line 64, in __init__
  File "logging\__init__.pyc", line 903, in __init__
  File "logging\__init__.pyc", line 926, in _open
IOError: [Errno 13] Permission denied: u'C:\\ProgramData\\Druva\\inSync4\\users\\Jani\\logs\\inSyncClientGUI.log'

Resolution

  1. Add antivirus exclusions for the inSync folders.

  2. Restart inSync services to verify whether the exclusion permissions are reset.

If the permissions are not corrected, contact Druva Support to troubleshoot the issue further.

WMI on the device is corrupt

Since WMI is found to have corruption, the resolution in this scenario must be followed carefully. If the issue persists even after following the steps specified in the resolution, follow up with Microsoft Support to fix the issue in the operating system.

Traceback

The following traceback is saved to the inSyncAgent.exe.log file.

pywintypes.com_error: (-2147217406, 'OLE error 0x80041002', None, None) 
Traceback (most recent call last): 
File "inSyncAgent.py", line 51, in <module> 
File "inSyncClient\inSyncConnector.pyc", line 38, in <module> 
File "inSyncClient\inSyncAUtil.pyc", line 53, in <module> 
File "wmi.pyc", line 157, in <module> 
File "win32com\client\__init__.pyc", line 72, in GetObject 
File "win32com\client\__init__.pyc", line 87, in Moniker 

The traceback found in event logs:

>> Eventviewer : Application log: 
Log Name: Application 
Source: Microsoft-Windows-WMI 
Date: 30/05/2018 12:30:53 
Event ID: 28 
Task Category: None 
Level: Error 
Keywords: 
User: SYSTEM 
Computer: UKBCALT61125.autologic.int 
Description: 
Failed to Initialize WMI Core or Provider SubSystem or Event SubSystem with error number 0x80041002. This could be due to a badly installed version of WMI, WMI repository upgrade failure, insufficient disk space or insufficient memory. 

Resolution

  1. Verify the corruption in MSI:

    1. On the system, click Start > Run > Msinfo32 command.
      The command populates the OS information.

    2. Go to Start > Run > Wmimgmt.msc to launch the WMI console.

    3. Right-click WMI Control (Local) and click Properties.
      If the system information is not populated in the OS information under the General tab, it confirms the corruption in WMI.

  2. If WMI is found corrupt, rebuild the WMI.

    1. Open the command prompt as an administrator.

    2. Change the directory to C:\Windows\System32\Wbem

    3. Create a .bat file with the following content:

      @echo off 
              sc config winmgmt start= disabled 
              net stop winmgmt /y 
              %systemdrive% 
              cd %windir%\system32\wbem 
              for /f %s in ('dir /b *.dll') do regsvr32 /s % 
              wmiprvse /regserver 
              winmgmt /regserver 
              sc config winmgmt start= auto 
              net start winmgmt 
              for /f %s in ('dir /s /b *.mof *.mfl') do mofcomp %s 
    4. Run the bat file from the command prompt.

    5. Restart the system and verify whether the error has resolved.

  3. If the issue does not resolve, rebuild the WMI repository after checking the repository for inconsistencies.

    • On Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2, open the command prompt and run the command:

      winmgmt /verifyrepository 
    • On Windows XP and Windows Server 2003, run the WmiDiag tool with the checkconsistency option.

      For example:

      WmiDiag checkconsistency
  4. If the repository is found inconsistent, run the commands to rebuild the repository automatically.

    Warning: Rebuilding the WMI repository causes some third-party products to stop working on the system until their setup is rerun and their MOF is added back to the repository.

    1. To rebuild repository on devices with Windows Vista or later operating systems, run the command:

      Winmgmt /salvagerepository

      Important: The command takes the content of the inconsistent repository and merges it into rebuild repository

    2. If the above command fails, run the following:

      Winmgmt/resetrepository

      Important: The command resets the repository to the initial state when the OS was first installed.

  5. If /salvagerepository and /resetrespository fail to resolve the issue, then manually rebuild the repository.

    1. Change the startup type of WMI service to disabled.

    2. Stop the IP Helper Service if required, stop all the services dependent on WMI, and then proceed to stop the WMI service.

    3. Rename the C:\WINDOWS\system32\wbem\Repository folder to Repository.old.

    4. Open the command prompt with elevated privileges and run the commands:

      cd windows\system32\wbem
              for /f %%s in (‘dir /b /s *.dll’) do regsvr32 /s %%s
    5. Set the WMI Service type back to Automatic and start WMI Service.

      cd /d c:\
              for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s
    6. Restart the server.

  6. Install the latest hotfixes for the WMI, as they help to prevent this issue from recurring.
    For repetitive WMI repository corruption issues on the same system, engage a Microsoft Support Engineer for assistance in resolving the issue.

inSync fails to load the QtWebKit.pyc file

inSync displays the error when it fails to load the QtWebKit.pyc file while loading the inSync dll files. On checking C:\ProgramFiles(x86)\Druva\inSync, the QtWebKit.pyc file is found missing. This issue can occur due to failure in loading various dll files. The name of the dll file is displayed in the error message.

The primary cause for the error due to this scenario is found in the antivirus software configured on the system.

Traceback

The following traceback is saved to the inSyncAgent.exe.log file in this scenario.

Traceback (most recent call last):
  File "inSyncAgent.py", line 42, in <module>
  File "inSyncLib\inSyncPyQt.pyc", line 4, in <module>
  File "PyQt4\QtWebKit.pyc", line 12, in <module>
  File "PyQt4\QtWebKit.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

Resolution

If exceptions are not created for the inSync installation folder, the antivirus software can scan the folders and can delete them or cause corruption of the files.

To resolve the issue:

  • Identify the affected dll and replace the same file by copying it from a healthy device.

  • If replacing the dll is not possible, add exclusions for the inSync folder to the antivirus software on the system and reinstall inSync on the device.

Did this answer your question?