nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 784 forks source link

[Bug]: Client reports "Network Error 5" in abundance (nowhere near clear enough to understand what is wrong) #6149

Open bernd-wechner opened 10 months ago

bernd-wechner commented 10 months ago

Bug description

I have installed a Nextcloud Server 27 clean. I have installed the desktop client latest version as an AppImage (Help says it's 3.10) I have copied a LOT of files into my local Nextcloud folder It is syncing.

The Server and Client are on the same LAN. The server is running on up to date Ubuntu (22.04.3 LTS) The Client is running up to date Linux Mint (21.2)

The client reports a LOT of "Network Error 5" errors in white on red at top of the Settings window (below the progress bar)

image

Steps to reproduce

Hard to say. I don't know what they mean, or how to get them. Client and Server are on same LAN. No issues with connectivity. Fresh Server install, fresh client install.

Expected behavior

I expect, as a bare minimum, some guidance on what is really happening and what to do about it. At the very least, if I could Google the code but if I google this:

https://help.nextcloud.com/t/erro-de-rede-5-network-error-5/172151

I don't find much of use. What is Network Error 5.? Why am I getting it? How do I fix it?

Which files are affected by this bug

/InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg

Operating system

Linux

Which version of the operating system you are running.

Mint 21.2

Package

Appimage

Nextcloud Server version

27.1.2

Nextcloud Desktop Client version

3.10

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

I have exported debug logs from the client, unzipped them and search for that one file I mentioned (among any). All lines I find mentioning tit that might be of some use are:

2023-10-18 23:40:30:100 [ info nextcloud.sync.checksums /home/user/src/common/checksums.cpp:189 ]:  Computing "MD5" checksum of "/media/Data/Cloud/NextCloud/InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" in a thread
2023-10-18 23:40:30:211 [ info nextcloud.sync.propagator.bulkupload /home/user/src/libsync/bulkpropagatorjob.cpp:189 ]: "/InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" transmission checksum "faa475500c20d0179fd30fa0397bc7a3" "/media/Data/Cloud/NextCloud/InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg"
2023-10-18 23:45:55:198 [ info nextcloud.sync.propagator.bulkupload /home/user/src/libsync/bulkpropagatorjob.cpp:531 ]: Item completed "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW "Network error: 5"
2023-10-18 23:45:55:198 [ warning nextcloud.sync.propagator /home/user/src/libsync/bulkpropagatorjob.cpp:713 ]: Could not complete propagation of "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" by OCC::BulkPropagatorJob(0x55cbe614f600) with status OCC::SyncFileItem::NormalError and error: "Network error: 5"
2023-10-18 23:45:55:198 [ warning nextcloud.gui.activity /home/user/src/gui/tray/usermodel.cpp:873 ]:   Item  "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg"  retrieved resulted in  "Network error: 5"
2023-10-18 23:45:55:198 [ warning nextcloud.gui.activity /home/user/src/gui/tray/usermodel.cpp:835 ]:   Item  "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg"  retrieved resulted in error  "Network error: 5"
2023-10-18 23:51:36:192 [ info nextcloud.sync.propagator.bulkupload /home/user/src/libsync/bulkpropagatorjob.cpp:531 ]: Item completed "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW "Network error: 5"
2023-10-18 23:51:36:192 [ warning nextcloud.sync.propagator /home/user/src/libsync/bulkpropagatorjob.cpp:713 ]: Could not complete propagation of "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg" by OCC::BulkPropagatorJob(0x55cbe614f600) with status OCC::SyncFileItem::NormalError and error: "Network error: 5"
2023-10-18 23:51:36:192 [ warning nextcloud.gui.activity /home/user/src/gui/tray/usermodel.cpp:873 ]:   Item  "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg"  retrieved resulted in  "Network error: 5"
2023-10-18 23:51:36:192 [ warning nextcloud.gui.activity /home/user/src/gui/tray/usermodel.cpp:835 ]:   Item  "InstantUpload/0/2022/07/Pictures/Screenshots/Screenshot_20220710_195826_com.mewe.jpg"  retrieved resulted in error  "Network error: 5"

On the server log this file is not mentioned anywhere. I do see loads of messages like this:

{"reqId":"mvyMcsGEQhkxGLGYhoCV","level":3,"time":"2023-10-17T11:12:58+00:00","remoteAddr":"192.168.0.11","user":"--","app":"index","method":"POST","url":"/index.php/apps/bookmarks/public/rest/v2/lock","message":"Reached maximum delay","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0","version":"27.1.2.1","exception":{"Exception":"OCP\\Security\\Bruteforce\\MaxDelayReached","Message":"Reached maximum delay","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":431,"function":"sleepDelayOrThrowOnMax","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":580,"function":"logClientIn","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1150,"function":"tryBasicAuthLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/html/nextcloud/lib/base.php","line":1057,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/html/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud/lib/private/Security/Bruteforce/Throttler.php","Line":300,"CustomMessage":"--"}}

And I wonder if Network Error 5 relates to this. I will drill down on this, but think I have a browser with floccus running trying to synch bookmarks and I have changed my password. This is a new server install (after a disc crash, so a complete system rebuild on a new disc) and I have been using it for years and no doubt have floccus running ;-). Still if Network Error 5 related to this or anything else, the bugs stands, it should provide a lucid clarification of what is wrong.

I can provide the complete logs on request, but prefer not to unnecessarily attach large files nor post logs in public per se.

Additional info

I will look at fixing all the issues that System Overview mentions:

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.

    Your remote address was identified as "192.168.0.11" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly. Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-reverse-proxy).
    Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-code-integrity). ([List of invalid files…](https://nephele.thumbs.place/index.php/settings/integrity/failed) / [Rescan…](https://nephele.thumbs.place/index.php/settings/integrity/rescan?requesttoken=p01J%2Fl%2BzD%2BvO150pKVL8IENNRusFdRFSJ98aKsA2bis%3D%3A6x99hzPGW52q%2BNEcfGuqS3oXEq80O3Qzc64pZ7NdRUE%3D))
    The PHP memory limit is below the recommended value of 512MB.

    Your web server is not properly set up to resolve "/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it's [documentation page ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-nginx). On Nginx those are typically the lines starting with "location ~" that need an update.
    PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response. Please check the [installation documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-php-fpm) for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.

    Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-setup-well-known-URL).
    Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-setup-well-known-URL).
    You have not set or verified your email server configuration, yet. Please head over to the [Basic settings](https://nephele.thumbs.place/index.php/settings/admin) in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.
    The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-transactional-locking) for more information.
    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 ↗](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) 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 ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-performance).
    The PHP OPcache module is not properly configured. See the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-php-opcache) 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.

Please double check the [installation guides ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-install), and check for any errors or warnings in the [log](https://nephele.thumbs.place/index.php/settings/admin/logging).

Check the security of your Nextcloud over [our security scan ↗](https://scan.nextcloud.com/).

But again, the bug stands as the client should be providing messages we can do something with. The build of my 3GB upload worked fine, just a number of (hard to count, again because the message is admirably not copyable or countable, is presnented in a klunky box, with no scroll bar, the fills the whole settings window under the progress bar, and no matter how tall or short that window, it just shows the top errors and any scroll down, sees it disappear and the standard folder tree with checkboxes shown.

Haidafraid commented 10 months ago

Same here. fresh install NC27hub

bernd-wechner commented 10 months ago

Starting to sound like Nextcloud 27 bug! It's really bugging me. As bugs go it's a bugging one (the client regularly full of red Network Error 5 messages) and no sign as to what is wrong, and no connectivity issues at all to the server, and nothing in the server logs, only the client logs.

I am currently working down the list of "Security & setup warnings" and have some dealt with now and am left with these to deal with:

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.

    Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-code-integrity). ([List of invalid files…](https://nephele.thumbs.place/index.php/settings/integrity/failed) / [Rescan…](https://nephele.thumbs.place/index.php/settings/integrity/rescan?requesttoken=kemAHSpZELvwVugtb%2FyHBEmahzLEqw4UnNTmH0W%2F88w%3D%3A3oDjdHITceLCJK97F87tRxy19F%2BmmD17qqO2by3Gx%2Fg%3D))

    Your web server is not properly set up to resolve "/ocm-provider/". This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in ".htaccess" for Apache or the provided one in the documentation for Nginx at it's [documentation page ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-nginx). On Nginx those are typically the lines starting with "location ~" that need an update.
    PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response. Please check the [installation documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-php-fpm) for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.
    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 ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-reverse-proxy).

    Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-setup-well-known-URL).
    Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-setup-well-known-URL).
    You have not set or verified your email server configuration, yet. Please head over to the [Basic settings](https://nephele.thumbs.place/index.php/settings/admin) in order to set them. Afterwards, use the "Send email" button below the form to verify your settings.
    The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the [documentation ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-transactional-locking) for more information.
    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 ↗](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) of the region to your config file.

Please double check the [installation guides ↗](https://docs.nextcloud.com/server/27/go.php?to=admin-install), and check for any errors or warnings in the [log](https://nephele.thumbs.place/index.php/settings/admin/logging).

Check the security of your Nextcloud over [our security scan ↗](https://scan.nextcloud.com/).
Haidafraid commented 10 months ago

My network error 5 is gone. It seems it was caused by my Nextcloud client. I followed this old thread , which seems to have done the trick. Cheers Haidafraid

Haidafraid commented 10 months ago

I deleted the config of the local client... Sorry for having been unprecise.

bernd-wechner commented 10 months ago

Mine seems to be working fine now too. Still, this bug stands. The message is not in the least useful and the client should be clear about what is wrong and what remedial action is warranted.

Haidafraid commented 10 months ago

Network errors (2, 5, 499,...) came back without giving me any chance to find a structure what could possibly cause any of those) I finally got rid of all network errors by deleting my sync.db on the machine that was causing problems. After syncing again, no network error occured anymore. Have a nice (long) weekend.

bernd-wechner commented 10 months ago

The bug stands, to request more lucid messages! My errors have disappeared too. Finally. Not sure why.

Alas when you write deleting my sync.db on the machine that was causing problems. it is not clear if that's the machine running the nextcloud client or the machine running the nextcloud server, as it is not clear from the message which of those 2 is 'causing problems'.

lssong99 commented 10 months ago

I also have this is issue. Also in the log there is also a log of error 5 for photos being affected. The solution of delete nextcloud.cfg seems to be an work around, but it requires you to re-setup the sync directory and it's not acceptable as a solution.

I am currented being updated to client 3.10.1 but this happens with previous version.

joshtrichards commented 10 months ago

no sign as to what is wrong, and no connectivity issues at all to the server, and nothing in the server logs, only the client logs.

I am currently working down the list of "Security & setup warnings" and have some dealt with now and am left with these to deal with: [...]

I think you answered your own question above. :-)

The "network error 5" is admittedly vague, but the errors you're being warned about in your Admin Overview indicate you have serious configuration problems with your server (and essentially an incomplete server installation).

They are the clues you're looking for!

The brute force triggers alone would constantly freeze your client connections out and make trouble shooting nearly impossible.

Please review the Admin Manual (https://docs.nextcloud.com) and pose specific targeted troubleshooting and general configuration questions to the Nextcloud Help Forum - https://help.nextcloud.com

Until those fundamental errors are addressed I'm afraid you're going to get many weird behaviors out of any of the clients.

You should not be using any clients until your Server is fully configured.

These are the most serious ones:

Your remote address was identified as "192.168.0.11" and is bruteforce throttled at the moment slowing down the performance of various requests. If the remote address is not your address this can be an indication that a proxy is not configured correctly. Further information can be found in the documentation ↗.

Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation ↗. ([List of invalid files…](

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

PHP does not seem to be setup properly to query system environment variables.

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 ↗.

bernd-wechner commented 10 months ago

I think you answered your own question above. :-)

On the "Security & setup warnings" yes. Those I've mostly fixed. Only these left:

Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation.

A message I'd like to lose, but can't. Because of:

https://github.com/nextcloud/server/issues/14926 https://github.com/nextcloud/server/issues/40082

Which need resolution.

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.

Which is a nonsense message and should not exist when we are indeed: "accessing Nextcloud from a trusted proxy". It's a trusted proxy, why the heck do we need an error message or warning about it. Anyone behind a firewall and using NAT to server the web has this issue surely, and it's known, no warning needed, it is intentional, we use a reverse proxy.

https://github.com/nextcloud/server/issues/35810

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.

Sure, but no drama, will get around to that one.

And that is all. No other server issues.

The "network error 5" is admittedly vague,

Vague? It conveys zero useful information, zip, nada, none. That is an order of magnitude more than vague. Or do you have a reference (that the message fails to provide) on translating these network error numbers to text messages and details? Believe me, Google and I have tried, and failed (which does not mean it isn't out there)

But yes, the Network Error 5 went away when I fixed all but those three remaining messages. But the issue stands, as valid, that if the client prints a network error at all, it should perforce be sufficiently informative to act on.

lssong99 commented 10 months ago

Network Error 5 happens only when there are several hundreds files (photos during a trip) need to sync to server via desktop client. It never happen if only couple files need sync.

Finally I avoid this nonsense by SFTP those hundreds of files directly to the target folder within NextCloud data folder, then occ files:scan to update the database. Takes 1/100 of time and 100% success rate. The client really need a better way to handle this situation, apart from the Network Error 5 issue. I could do this because this is my personal NC instance. Other people with no admin right will be out of luck.

Mister-Muffin commented 7 months ago

I also have this error, but I'm only syncing about 20 Files (~400B), all of them already uploaded.

Using Nextcloud 27.1.6, client 3.11.0.

maacarbo commented 5 months ago

Network Error 5 happens only when there are several hundreds files (photos during a trip) need to sync to server via desktop client. It never happen if only couple files need sync.

Finally I avoid this nonsense by SFTP those hundreds of files directly to the target folder within NextCloud data folder, then occ files:scan to update the database. Takes 1/100 of time and 100% success rate. The client really need a better way to handle this situation, apart from the Network Error 5 issue. I could do this because this is my personal NC instance. Other people with no admin right will be out of luck.

Exaclty the same problem here. I use it to sync different working environments (containing a large anount of git repos) between multiple computers. Impossible to sync when there are a large amount of files (60000 files, small and big).

Nextcloud desktop client 3.12.3 Nextcloud Hub 7 (28.0.3)

fOO223Fr commented 5 months ago

Network Error 5 happens only when there are several hundreds files (photos during a trip) need to sync to server via desktop client. It never happen if only couple files need sync.

Finally I avoid this nonsense by SFTP those hundreds of files directly to the target folder within NextCloud data folder, then occ files:scan to update the database. Takes 1/100 of time and 100% success rate. The client really need a better way to handle this situation, apart from the Network Error 5 issue. I could do this because this is my personal NC instance. Other people with no admin right will be out of luck.

isn't this something highly not recommended? which is to mess with the datadir

braca commented 5 months ago

I'm trying to migrate from dropbox to my own nextcloud, and I have the same issue (Nextcloud Hub 7 (28.0.4)) while syncing a lot of files (60k files, 500GB of data) using desktop app

bernd-wechner commented 4 months ago

Well, it's happening again. And yes, after adding a pile of files to sync folder. Oodles and oodles of Network error: 5. With no clarification. There are config issues:

image

Nothing in server log (those errors are all related to other apps, like DuplicateFinder and Memories). The client just throws this (private paths blurred):

image

Now there is a little more info. If I click one of those I get another popup (the main dialog) which lists the errors, and has an elipsis beside each one, which when clicked opens something like:

image

Which suggests oddly the reason is the remote file doesn't exist and it's related to sharing? Totally surprising and confusing. Of course the remote file doesn't exist, I've added it to my local folder and am syncing it up. And I have in no way elected to share it (though there's a slim chance it's in a shared folder?).

bernd-wechner commented 4 months ago

Anyhow, I have no configuration errors, and increasing number of people report the same issue, and the fundamental problem is that the client isn't even telling us what the problem is.

And so this bug is in essence, a request that we improve the desktop client to provide actual useful information on what the problem is, such that we might fix it if it's fixable, either in a configuration or in the client itself if it points to a simple handling issue in the desktop client.

starcraft66 commented 3 months ago

Experiencing this a lot in my desktop client

j007bond007 commented 3 months ago

Getting this often on my windows 10 nextcloud client as well trying to upload sync a large number of small files - it starts syncing again for a while when i restart the client.

juanjointera5 commented 1 month ago

Hello,

Same here. More than 7000 files small files, only 80MB. Network error 5.

Using latest server 29 and latest Windows client 3.13.2.

Sync some files, and give network error 5. Restart the client, sync some more files, and again network error 5 ... and again, again ...