Unknow error has occured, connection to server lost

Nextcloud version (eg, 20.0.5): 27.0.2
Operating system and version (eg, Ubuntu 20.04): 22.04.3
Apache or nginx version (eg, Apache 2.4.25): 2.4.52
PHP version (eg, 7.4): 8.1.22

The issue you are facing:

Each time I try to upload files (ex: PDFs of 20Mb) I got these kinds of error message. I can confirm that smaller files seem to work better but I can’t determine at which size the probleme start to happening.

image

I even can’t view pdf into nextcloud, they stuck at loading…

Is this the first time you’ve seen this error? (Y/N): Since I’m under NC 27 (I think)

The output of your Nextcloud log in Admin > Logging:

Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T14:10:20-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 958464 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T14:09:03-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T14:06:47-0400
Error	core	Error: Call to undefined method Rubix\ML\Datasets\Labeled::features()	
2023-09-07T14:05:04-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 794624 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:58:28-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:57:54-0400
Error	core	Error: Call to undefined method Rubix\ML\Datasets\Labeled::features()	
2023-09-07T13:55:04-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:49:21-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:48:54-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 1007616 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:48:46-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 696320 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:48:45-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 434176 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:48:45-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 647168 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:48:45-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:47:55-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:47:34-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 811008 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:47:21-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 974848 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:46:55-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 843776 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:46:39-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 811008 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:45:02-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 434176 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:44:57-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 434176 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:44:57-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 352256 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:44:55-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 516096 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:44:52-0400
Error	no app in context	RuntimeException: Failed to initialize deepl translator class	
2023-09-07T13:44:36-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 729088 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:43:53-0400
Error	core	Error: Call to undefined method Rubix\ML\Datasets\Labeled::features()	
2023-09-07T13:43:26-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 991232 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:43:11-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 778240 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:43:00-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 991232 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:42:52-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 892928 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:42:39-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 958464 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:42:29-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 925696 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:41:52-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 811008 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:41:27-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 991232 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:41:23-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 712704 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.	
2023-09-07T13:41:10-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 991232 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:40:57-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 843776 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:40:46-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 925696 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.	
2023-09-07T13:40:43-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 335872 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.	
2023-09-07T13:40:40-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 450560 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.	
2023-09-07T13:40:40-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 1048000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 942080 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2023-09-07T13:40:31-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 385024 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.	
2023-09-07T13:39:59-0400
Error	no app in context	Sabre\DAV\Exception\BadRequest: Taille du fichier attendue : 1048000 octets mais taille du fichier lue (depuis le client Nextcloud) et écrit (dans le stockage Nextcloud) : 516096 octets. Cela peut être un problème de réseau au niveau du client ou un problème de stockage au niveau du serveur.

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

[PHP]

engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions =
disable_classes =
zend.enable_gc = On
zend.exception_ignore_args = On
zend.exception_string_param_max_len = 0
expose_php = Off
max_execution_time = 600
max_input_time = 1000
memory_limit = 1024M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 2G
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2G
max_file_uploads = 500
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60

[CLI Server]
cli_server.color = On

[Date]
date.timezone = America/Montreal

[filter]

[iconv]

[imap]

[intl]

[sqlite3]

[Pcre]

[Pdo]

[Pdo_mysql]
pdo_mysql.default_socket=

[Phar]

[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[MySQLi]

mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[mysqlnd]
mysqlnd.collect_statistics = On

mysqlnd.collect_memory_statistics = Off

[OCI8]

[PostgreSQL]
pgsql.allow_persistent = On

pgsql.auto_reset_persistent = Off

pgsql.max_persistent = -1

pgsql.max_links = -1

pgsql.ignore_notice = 0

pgsql.log_notice = 0

[bcmath]
bcmath.scale = 0

[browscap]

[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5

[Assertion]
zend.assertions = -1

[COM]

[mbstring]

[gd]

[exif]

[Tidy]
tidy.clean_output = Off

[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5

[sysvshm]

[ldap]
ldap.max_links = -1

[dba]

[opcache]
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=2
opcache.save_comments=1

[curl]

[openssl]


[ffi]

The output of your Apache/nginx/system log in /var/log/____:

No error in the apache error log file..

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

already put above