File*** could not be synced due to an error

Good morning
“file could not be synced due to an error” — I could not find anything in the FAQ or forum topics. Sorry for asking such stupid question.

I had a system engineer install nextcloud on a rental server space (for my website).
It seems to be working - sort of - but nextcloud CONSTANTLY complains of not being able to synchronize files, telling me:
“file*** could not be synced due to an error. See the log for details.” (where file*** is the file name; sometimes followed by something like “and 30 other files”

As far as I can tell, this behavior is totally random and there is NO telling, which files are OK and which not.
This applies to ALL file types and it does not matter how I copy or create those files.
Let’s say I have a folder with 10 small text files. I copy that to the nextcloud folder and get “… 5 files could not be synced”.
These files can be opened in the computer I was using to create/copy those files, but naturally DO NOT appeared in the other devices.
ALL files can be opened normally with any of my computers.
Even if I create a new text file and save it directly into the nextcloud folder … sometimes I get this error and sometimes not.

  • 2-3 times I noticed that SOME of the files “pending” for synchronization actually DID synchronize - A DAY LATER!

I am supposed to look at the log. Yet, the log (archive) created immediately after an attempt to copy a small text file contained TWO files:

  1. 166 KB = 465 lines
  2. 1449 KB = 3695 lines (in a general text editor)
    copying this into a wordprocessor gives 119,276 words = 428 pages worth of text
    (Whereas the “owncloudsync.log” that seems to be automatically created in all folders is always 0 KB. Why is there an “owncloud” file anyway?))
    And that for a little text file saying just “Hi, nice weather today.”
    Where in those 430 pages am I supposed to look for what?

This is a very annoying behavior and renders nextcloud totally unreliable.
Is there some trick I could try to get a reliable operation?
Thank you.

It could be something to do with the setup, but it’s not possible to even guess at a cause without more to go on. You can just post log errors, or entries logged at the time the sync failed, to narrow it down, from both the Nextcloud and web server logs.

Also post the rest of the system info from the support post template. OS, web server, PHP version, web server and Nextcloud configs, etc…

Good evening and thank you!

  • I found some but not all of the information you requested:

Nextcloud version (eg, 20.0.5): Nextcloud
Operating system and version (eg, Ubuntu 20.04):
desktop client for Windows 10 64 bit
server: Linux(CentOS, version not given in the specification)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.x (that is what I found in the server specification)
PHP version (eg, 7.4): PHP ver8.0

The issue you are facing:
Some files ARE synchronized, other not.
Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Just copy a file to the nextcloud folder or create one there. Then wait.
  2. 2-3 seconds later “filexxx could not be synced due to an error” is displayed

The output of your Nextcloud log in Admin > Logging: Just found that. Paste the latest entry only

[internet_connection_check] Error: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 30000 milliseconds with 0 bytes received (see for at <<closure>>

 0. /home/users/1/ line 158
    GuzzleHttp\Handler\CurlFactory::createRejection(GuzzleHttp\Handl ... l}, [28,"Operation t ... "])
 1. /home/users/1/ line 110
    GuzzleHttp\Handler\CurlFactory::finishError(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl ... l}, GuzzleHttp\Handler\CurlFactory {})
 2. /home/users/1/ line 47
    GuzzleHttp\Handler\CurlFactory::finish(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl ... l}, GuzzleHttp\Handler\CurlFactory {})
 3. /home/users/1/ line 146
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 4. /home/users/1/ line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 5. /home/users/1/ line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 6. /home/users/1/ line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 7. /home/users/1/ line 107
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 8. /home/users/1/ line 73
    GuzzleHttp\RedirectMiddleware->checkRedirect(GuzzleHttp\Psr7\Request {}, "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 9. /home/users/1/ line 41
    GuzzleHttp\RedirectMiddleware->GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
10. /home/users/1/ line 48
    GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
11. /home/users/1/ line 248
12. /home/users/1/ line 224
13. /home/users/1/ line 269
14. /home/users/1/ line 226
15. /home/users/1/ line 62
16. /home/users/1/ line 187
17. /home/users/1/ line 218
    GuzzleHttp\Client->request("get", "", ["/home/users/1/ ... "])
18. /home/users/1/ line 211
19. /home/users/1/ line 193
20. /home/users/1/ line 869
21. /home/users/1/ line 225
22. /home/users/1/ line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings\Con ... {}, "check")
23. /home/users/1/ line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "check")
24. /home/users/1/ line 298
    OC\AppFramework\App::main("OCA\\Settings\\ ... r", "check", OC\AppFramework\ ... {}, ["settings.CheckSetup.check"])
25. /home/users/1/ line 1047
26. /home/users/1/ line 36

GET /nextcloud/index.php/settings/ajax/checksetup
from by Fliegen at 2022-12-15T09:15:21+00:00

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):
$CONFIG = array (
  'instanceid' => 'ocmpqncdbiso',
  'passwordsalt' => 'zBAwyWri0s90IiybhsujmVQrf5C7l4',
  'secret' => '8J2rULobnNfUnBTGJs/9ma1prkWv44zolsOtrhB4uyK1jNP+',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/home/users/1/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'xxx-nextcloud',
  'dbhost' => 'mysq-xxx',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,

The output of your Apache/nginx/system log in `/var/log/____`: Again, sorry, I don't know where that is.

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors.

As far as I can find out using FTP, there is no such folder in my rented space.

However, I just checked “security and setup warnings” in my nextcloud dashboard and get the following:

 Security & setup warnings

It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.
There are some errors regarding your setup.

    The PHP memory limit is below the recommended value of 512MB.

    The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the documentation ↗.
    The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the security tips ↗.

    Your web server is not properly set up to resolve "/.well-known/webfinger". Further information can be found in the documentation ↗.
    Your web server is not properly set up to resolve "/.well-known/nodeinfo". Further information can be found in the documentation ↗.
    Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation ↗.
    Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation ↗.
    You have not set or verified your email server configuration, yet. Please head over to the Basic settings in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.
    Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add "default_phone_region" with the respective ISO 3166-1 code ↗ of the region to your config file.
    No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗.
    You are currently running PHP 7.4.33. Upgrade your PHP version to take advantage of performance and security updates provided by the PHP Group ↗ as soon as your distribution supports it.
    The PHP OPcache module is not properly configured. See the documentation ↗ for more information.
        The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8.
    The PHP modules "gmp" and/or "bcmath" are not enabled. If you use WebAuthn passwordless authentication, these modules are required.
    MySQL version "5.7.36-log" is used. Nextcloud 21 and higher do not support this version and require MySQL 8.0 or MariaDB 10.2 or higher.

Please double check the installation guides ↗, and check for any errors or warnings in the log.

Check the security of your Nextcloud over our security scan ↗.

Does any of the above help?

No ideas, anybody? As long as I cannot solve this problem, I am afraid nextcloud is useless. Not being a computer specialist, I do not understand the things I copied above, but consider please consider the following.
I use a common text editor (EmEditor) to create a very small text file (character encoding utf-8) and save it to the nextcloud folder. The file name does not include any special characters, looking like “test.txt” or “000.txt”. For some fortunate reason THIS file is synced.
Then I use the same editor, create a new text file, this one named “delete.txt”. Same file format, same folder to save it in; about 2 KB. Yet, THIS file is NOT synced.
I could understand, if there were an error for ALL files, but not this discrimination between two text files created at the same time, saved in the same folder, same file format, same size …
And as I said in the original post, this happens to all types of files. Impossible to predict when it will affect what file.
I would really appreciate any hints towards a path to salvation.
Thank you

it isn’t. Really not.
But you’re right, it’s not simple to setup nor to maintain. Maybe you should think about renting a managed instance somewhere. Or to use our rookie-tools, like nextcloudpi.

btw: this seems to be a crossposting, related to File synchronization trouble. Please help - I’m closing this one here in favour of the just mentioned thread