Sync Error - gnucash .log files - Resolved if extension changed to .txt

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 23.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.4.28

The issue you are facing: I use nextcloud to sync gnucash files between systems. Every file generated by gnucash is properly synced. As you work in gnucash, it will generate one or more log files with the format similar to NAME.gnucash.20220329152932.log. These log files fail to sync to the cloud. However, if you change the file extension from .log to .txt, the files sync instantly without error.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Change gnucash account files and save changes.
  2. .log file generated
  3. File fails to sync. The desktop sync client throws a “405 Method Not Allowed” error.
  4. If you later change the file extension from .txt back to .log, the file will sync with the .log extention.

The output of your Nextcloud log in Admin > Logging:

No log file was created for this error.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____: This is coterminous with the 405 error listed above.
[Wed Mar 30 09:59:50.208115 2022] [:error] [pid 390303:tid 139704125531904] [client] [client] ModSecurity: Access denied with code 403 (phase 2). Match of "pmFromFile userdata_wl_extensions" against "TX:extension" required. [file "/etc/apache2/modsecurity.d/rules/comodo_free/10_HTTP_HTTP.conf"] [line "27"] [id "210730"] [rev "4"] [msg "COMODO WAF: URL file extension is restricted by policy|||F|2"] [data ".gnucash.20220330095050.log"] [severity "CRITICAL"] [tag "CWAF"] [tag "HTTP"] [hostname ""] [uri "/remote.php/dav/files/FILES/gnucash/FILE LOCATION/FILE.gnucash.20220330095050.log"] [unique_id "YkRwZgAAbkTgbZ@32yW2nQAAAFg"]

Based on the provided log excerpt I would assume that this issue isn’t Nextcloud related because your Nginx server. and especially the ModSecurity module, is blocking the file. My recommendation is to check the ModSecurity configuration and adjust it based on your requirements.

Thank you! Your message gave me the hints I needed to resolve this.

1 Like