Unexpected error: NetworkError when attempting to fetch resource

Hello,

I have just done a fresh install of Nextcloud using the webinstaller to test it out. It is hosted on a shared infrastructure at o2switch with Apache Httpd. Once connected on the we interface it complains that it can’t fetch photos and files:

It seems that the errors are on trying to reach remote.php/dav/… but can’t figure out what is wrong and why these requests don’t follow through.

I can’t figure out why these requests don’t go through. I looked around on the configuration side.

Any ideas ?

Best,
Benjamin

Hello @bhabegger ,

welcome to the community of Nextcloud.

You started a topic in support category.
Unfortunately you ignored the template and a lot of information to help you is missing.

Please add all necessary information like Nextcloud version, webserver type and version, os version, related log file content.

Without additional information the community members cannot help you.

Does your hosting setup has all requirements to run nextcloud?

Regards,
rakekniven

Sorry about that. It looked more like a support “response” template :wink:

Here is the info:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 9 (30.0.4)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Some Linux I don't manage
  • Web server and version (e.g, Apache 2.4.25):
    • Some Apache I don't manage
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Not sure
  • PHP version (e.g, 8.3):
    • Version: 8.3.14
    • Memory limit: 1 GB
    • Max execution time: 3600
    • Upload max size: 32 MB
    • OPcache Revalidate Frequency: 2
    • Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, json, iconv, SPL, pcntl, random, readline, Reflection, session, standard, mbstring, shmop, SimpleXML, tokenizer, xml, litespeed, bcmath, dom, fileinfo, gd, imap, intl, ldap, exif, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, msgpack, igbinary, redis, soap, sockets, tidy, xmlreader, xmlwriter, xsl, zip, clos_ssa, Zend OPcache
  • Is this the first time you’ve seen this error? (Yes / No):
    • It's my first install
  • When did this problem seem to first start?
    • From the beginning
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Webinstaller
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • mod_security but turning it off didn’t change the outcome

Summary of the issue you are facing:

See previous message

Steps to replicate it (hint: details matter!):

  1. Just login and I get an error about photos
  2. Try to connect to files and then you get what was in my screenshot

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

https://pastebin.com/259EqGpD

Ok, did a fresh install from the beginning. And still get the error. There seams to be some protocol error but I have very little information about what is causing it. I checked the SSL certificate (which is from Let’s Encrypt, which is widely used and therefore I doubt that this is the cause).

The only suspicion I can have is that I am on a hosted environment and that my domain is far from the only one under the same ip…

Any clue would be highly appreciated as I am completely lost.

So I tried to replicate the problematic request in Insomnia:

* Preparing request to https://cloud.habegger.tech/remote.php/dav/files/benjamin/
* Current time is 2024-12-15T20:36:04.546Z
* Enable automatic URL encoding
* Using default HTTP version
* Enable SSL validation
* 17 bytes stray data read before trying h2 connection
* Connection 3 seems to be dead!
* Closing connection 3
* TLSv1.3 (IN), TLS alert, close notify (256):
* Hostname cloud.habegger.tech was found in DNS cache
*   Trying 109.234.161.80:443...
* Connected to cloud.habegger.tech (109.234.161.80) port 443 (#4)
* ALPN, offering h2
* ALPN, offering http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_CHACHA20_POLY1305_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=cloud.habegger.tech
*  start date: Dec 14 13:37:18 2024 GMT
*  expire date: Mar 14 13:37:17 2025 GMT
*  subjectAltName: host "cloud.habegger.tech" matched cert's "cloud.habegger.tech"
*  issuer: C=US; O=Let's Encrypt; CN=R11
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x1de402ed8800)

> PROPFIND /remote.php/dav/files/benjamin/ HTTP/2
> Host: cloud.habegger.tech
> user-agent: insomnia/2022.7.5
> content-type: application/xml
> requesttoken: ********************
> accept: */*
> content-length: 843

| <?xml version="1.0"?>
| 		<d:propfind xmlns:d="DAV:" xmlns:nc="http://nextcloud.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
| 			<d:prop>
| 				<d:getcontentlength /> <d:getcontenttype /> <d:getetag /> <d:getlastmodified /> <d:creationdate /> <d:displayname /> <d:quota-available-bytes /> <d:resourcetype /> <nc:has-preview /> <nc:is-encrypted /> <nc:mount-type /> <oc:comments-unread /> <oc:favorite /> <oc:fileid /> <oc:owner-display-name /> <oc:owner-id /> <oc:permissions /> <oc:size /> <nc:hidden /> <nc:is-mount-root /> <nc:is-federated /> <nc:metadata-files-live-photo /> <nc:reminder-due-date /> <nc:note /> <nc:sharees /> <nc:share-attributes /> <oc:share-types /> <ocs:share-permissions /> <nc:rich-workspace /> <nc:rich-workspace-file /> <nc:system-tags />
| 			</d:prop>
| 		</d:propfind>

* We are completely uploaded and fine
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
* stopped the pause stream!
* Connection #4 to host cloud.habegger.tech left intact

Which leads to PROTOCOL_ERROR.

It seams the session was closed abrubtly, now I don’t know whether it’s on the apache side or within the PHP code or a bad combination of both…

I encounter the exact same problem, also on o2switch shared hosting.

Even if this might not help you guys, directly, hav you put thought into NC not being able to run on your sharedhosting?
It’s not neccessarily a problem of NC. Could be a problem with your paid environment. Have you contacted your hoster-support?

Sure, it’s not necessarily nextcloud. However, I was successful in installing a version of nextcloud some 7-8 years ago on the same server. And the provider is quite good at accomodating a lot of services.

I get this kind of error in the nexcloud log:
{"reqId":"Z8nX0XxVQ2lxbGdvgOsJygAAAMs","level":3,"time":"2025-03-06T17:13:53+00:00","remoteAddr":"82.67.2.5","user":"svictor","app":"index","method":"GET","url":"/index.php/settings/admin/overview","message":"OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned in file '/home3/svictor/nextcloud/lib/private/User/Database.php' line 475","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"31.0.0.18","exception":{"Exception":"Exception","Message":"OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned in file '/home3/svictor/nextcloud/lib/private/User/Database.php' line 475","Code":0,"Trace":[{"file":"/home3/svictor/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home3/svictor/nextcloud/lib/private/Route/Router.php","line":307,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home3/svictor/nextcloud/lib/base.php","line":1018,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home3/svictor/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home3/svictor/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":146,"Previous":{"Exception":"TypeError","Message":"OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned","Code":0,"Trace":[{"file":"/home3/svictor/nextcloud/lib/private/User/Manager.php","line":500,"function":"countUsers","class":"OC\\User\\Database","type":"->"},{"file":"/home3/svictor/nextcloud/apps/updatenotification/lib/Settings/Admin.php","line":142,"function":"countUsersTotal","class":"OC\\User\\Manager","type":"->"},{"file":"/home3/svictor/nextcloud/apps/updatenotification/lib/Settings/Admin.php","line":79,"function":"isWebUpdaterRecommended","class":"OCA\\UpdateNotification\\Settings\\Admin","type":"->"},{"file":"/home3/svictor/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":128,"function":"getForm","class":"OCA\\UpdateNotification\\Settings\\Admin","type":"->"},{"file":"/home3/svictor/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":170,"function":"formatSettings","class":"OCA\\Settings\\Controller\\AdminSettingsController","type":"->"},{"file":"/home3/svictor/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php","line":56,"function":"getIndexResponse","class":"OCA\\Settings\\Controller\\AdminSettingsController","type":"->"},{"file":"/home3/svictor/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"index","class":"OCA\\Settings\\Controller\\AdminSettingsController","type":"->"},{"file":"/home3/svictor/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home3/svictor/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home3/svictor/nextcloud/lib/private/Route/Router.php","line":307,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home3/svictor/nextcloud/lib/base.php","line":1018,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home3/svictor/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home3/svictor/nextcloud/lib/private/User/Database.php","Line":475},"message":"OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned in file '/home3/svictor/nextcloud/lib/private/User/Database.php' line 475","exception":{},"CustomMessage":"OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned in file '/home3/svictor/nextcloud/lib/private/User/Database.php' line 475"}}

Does this suggest some way to debug?

That was a very long time ago.

Please ask your hoster whether Nextcloud should run on your service.

And which Nextcloud version are you using?

Wild guess since it’s the PROPFIND and REPORT that are being aborted: your provider is using a WAF like mod_security which is blocking things.

Hey,

I have same issue on v31 but not on v30

OC\\User\\Database::countUsers(): Return value must be of type int|false, string returned

See my post

I assume that the error is related to commit in v31 :thinking:

Hi,

I’m also having the same problem on shared host.
Is someone looking into this? Do you need more data for analysis?

Thanks.