Data corrupted on download from server error

Arch linux updated to the latest:

nextcloud 23.0.3-1
nextcloud-client 2:3.4.4-2
apache 2.4.53-1
php-fpm 8.1.4-1

Cannot sync any files from the server to client, upload from client to server is OK
Says Data corrupted on any download attempts

also all contacts GONE!
Overview reports: Your web server is not yet properly set up to allow file synchronization, because the WebDAV interface seems to be broken.

Tried:
downgrade to php80-fpm 8.0.17-2
downgrade to nextcloud-client 3.3.6-1
boot different kernels
occ files:scan

but NO help, no change in behavior ;-;

1 Like

Checkout nextcloud.log for errors under /var/www or as admin user on top right menu.

Please copy paste the actual errors you are receiving. Also, try searching for them on the forum and on the internet.

Restore from backup if updating caused issues. Your post is too vague to offer any technical guidance.

Both the server and client logs are bloated with irrelevant information, cannot find any clear issue relating to this problem…They are huge. If anyone else cannot reproduce this issue then I guess it’s something with my mysql database (mariadb 10.7.3-1) or the Arch Linux php 8.1 patched nextcloud server. But I can reproduce this problem in 2 independent machines with different user ecosystems.

Steps to reproduce:

  1. Install the described versions of Nextcloud server and client (current latest)
  2. Create a folder on the server and set its synchronization on the client
  3. Upload a file to the server’s folder via the web interface
  4. Client fails to synchronize this file reporting “Data corrupted…”

I have never experienced anything like this…

Here are some errors from the server’s logfile (Debug set to 0):

Error: Return type of OCA\Deck\Db\RelationalEntity::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /usr/share/webapps/nextcloud/apps/deck/lib/Db/RelationalEntity.php#66

Error: ctype_digit(): Argument of type int will be interpreted as string in the future at /usr/share/webapps/nextcloud/3rdparty/sabre/http/lib/Response.php#152

Error: Automatic conversion of false to array is deprecated at /usr/share/webapps/nextcloud/lib/private/User/Database.php#393

Error: Return type of OCA\LogReader\Log\LogIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /usr/share/webapps/nextcloud/apps/logreader/lib/Log/LogIterator.php#88

Error: Return type of OCA\LogReader\Log\LogIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /usr/share/webapps/nextcloud/apps/logreader/lib/Log/LogIterator.php#69

Error: Return type of OCA\LogReader\Log\LogIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /usr/share/webapps/nextcloud/apps/logreader/lib/Log/LogIterator.php#122

With php8.1, there were then some problems with filenames??

Not sure if everything was patched with the archlinux package.

If you see errors like for the deck app, try to disable such apps and check if the file transfer works after that.

Unfortunately, it’s hard to know in advance, but for php 8.1, it would have been better to wait a few weeks for NC 24.

I confirm exactly the same problem since yesterday! After upgrading to PHP 8.0.17 from 8.0.14 I also see “corrupted data” messages in client, files can not be downloaded, and Overview says “Webdav is broken”.

I run multiple NC installations on the same server and all installations have the same problem right after PHP was automatically upgraded to 8.0.17. CentOS 7 + cPanel. I switched to PHP 7.4 and all installations started working immediately.

My best guess is that some changes were introduced in latest PHP 8.0 and 8.1 versions and they broke NC (I was using PHP 8.0.x without problems previously).

P.S. @jaro3 , just to be sure that your problem is 100% identical to mine, can you also confirm if:

  1. If you try to view any PDF file via browser (using NC PDF Viewer app) it displays message “Network error”?
  2. If you try to view any image file via browser (using NC app), it actually works? But absolutely all other files don’t work?

P.P.S. I cleaned NC log file while trying to debug this issue - no single entry is added to log file regarding this error. NC simply doesn’t work, and no further errors are logged.

2 Likes

@tflidd this also happens on latest version of PHP 8.0 on a completely different OS, see my post above for more details.

I confirm the 2 issues:

When viewing PDF: An error occurred while loading the PDF
.jpg is fine

I downgraded the PHP to 8.0.17 (built from AUR) but the issue persists;-; Was the whole Nextcloud installation permanently f*cked by once upgrading to PHP 8.1?

DO you also have problems with Contacts - all disappeared for me. This is the worst scenario I ever experienced with NC…

There are no clues in the logs, they are useless…

Yes, contacts were also gone on PHP 8.0.17.

Which means both latest PHP 8.0 and 8.1 packages introduced some critical changes and NC is not compatible with latest versions of PHP 8.x anymore… Our only option is to use PHP 8.0.14 or earlier now.

Can anyone figure out the latest versions of PHP (and NC) where this doesn’t occur? Would going back to PHP 8.0.14 fix the issue and bring back my Contacts? I have no backups;-;

Are the contacts still in the database?

Yes, they are. Because right after switching to PHP 7.4 everything started working again (including old contacts).

Good to know… I try to revert to PHP 8.0.14 but there may be other dependencies issues as all other packages are on the latest versions…

Reverted to PHP 8.0.14 but there are other issues, NC is dead with message:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

downgraded to lowest in cache:
php-redis 5.3.6-1
redis 6.2.5-1

but still:

[proxy_fcgi:error] 127.0.0.1:19106 Yj2BdJg4fwC4J00w04TZaAAAAEY AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught OCP\HintException: [0]: Memcache \OC\Memcache\Redis not available for local cache (Is the matching PHP module installed and enabled?)\n\n thrown in /usr/share/webapps/nextcloud/lib/private/Memcache/Factory.php on line 94’

Just disable caching for a while (edit config.php file), it should start working.

Yeah, disabled the caching, get to the blue NC screen but it reports another error:

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.

Technical details

  • Remote Address: x.x.x.x
  • Request ID: Yj6P1R3hJZkYow_xj5fgnQAAAIA

and in the NC log:

{“reqId”:“Yj6P1R3hJZkYow_xj5fgnQAAAIA”,“level”:3,“time”:“2022-03-26T13:00:21+09:00”,“remoteAddr”:“x.x.x.x”,“user”:"–",“app”:“base”,“method”:“GET”,“url”:"
/nextcloud/",“message”:“Failed to start session”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.46 Saf
ari/537.36”,“version”:“23.0.3.2”,“exception”:{“Exception”:“Exception”,“Message”:“Failed to start session”,“Code”:0,“Trace”:[{“file”:"/usr/share/webapps/nextcl
oud/lib/base.php",“line”:423,“function”:"__construct",“class”:“OC\Session\Internal”,“type”:"->",“args”:[“oc626a57ddf4”]},{“file”:"/usr/share/webapps/nextclo
ud/lib/base.php",“line”:645,“function”:“initSession”,“class”:“OC”,“type”:"::",“args”:},{“file”:"/usr/share/webapps/nextcloud/lib/base.php",“line”:1087,“func
tion”:“init”,“class”:“OC”,“type”:"::",“args”:},{“file”:"/usr/share/webapps/nextcloud/index.php",“line”:34,“args”:["/usr/share/webapps/nextcloud/lib/base.php
“],“function”:“require_once”}],“File”:”/usr/share/webapps/nextcloud/lib/private/Session/Internal.php",“Line”:62,“CustomMessage”:"–"}}

Do you mean PHP 7.4 or 8.0.14 ?

It seems that the Arch Linux Nextcloud patched for the PHP 8.1 doesn’t work with the older PHP

Goddammit, fixed, after 1 week sleepless nights… There are other PHP dependencies that must be downgraded as well…

What the hell happened between the PHP versions 8.0.14 and 8.0.17 that caused this Nextcloud disaster??? Great thanks to toxpal who figured this out, watching the logs was useless in troubleshooting the problem…

The Arch Linux is really an alpha level testing piece of crap as it pushes the update of Nextcloud to v23 along with PHP v8.1 without any warnings and then the developers close my bug reports as irrelevant… Maybe it is made in Russia/Ukraine so that they cannot focus on their work now. Next time LFS or Gentoo…

Hi
Exactely same behaviour on CentOS 7.9.2009
Issuing
yum downgrade php php-sodium php-common php-intl php-soap php-bcmath php-fpm php-xml php-ldap php-opcache php-gmp php-process php-mbstring php-gd php-imap php-cli php-pdo php-mysqlnd
fixed any problem
NC 23.0.3 works perfectly with php 8.0.16 but those problem raise on php 8.0.17
So I’m back on 8.0.16

1 Like