Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can.
The Basics
- Nextcloud Server version (e.g., 29.x.x):
30.0.4
- Operating system and version (e.g., Ubuntu 24.04):
- `Debian 11 (server)
Debian 12 (client)
- Web server and version (e.g, Apache 2.4.25):
Apache 2.4.62
- Reverse proxy and version _(e.g. nginx 1.27.2)
none
- PHP version (e.g, 8.3):
8.3.15
- Is this the first time you’ve seen this error? (Yes / No):
yes
- When did this problem seem to first start?
when I updated the client script to use nextcloudcmd instead of owncloudcmd
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Archive from nextcloud
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
Negative
Summary of the issue you are facing:
I am encountering an issue using nextcloudcmd to automate upload of a file to the server. According to the ‘Credential Handling’ section in the Advanced Usage section of the documentation,
"nextcloudcmd requires the user to specify the username and password using the standard URL pattern, e.g.,
$ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud
(emphasis mine)
When I attempt to upload, I get a host not found error. The URL shown is not the URL I entered on the command line. Note that in the below example, I am using fake information, as this URL is an internal URL.
I enter:
nextcloudcmd --non-interactive --trust /var/opt/LincolnRadioJournal/ https://'user':'P@ssw0rd!'@123.456.789.101/LRJ
In the output from the command, I see the following as the first line:
01-05 12:03:27:627 [ info nextcloud.sync.accessmanager ]: 2 "" "http://https//user:P@ssw0rd!@123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json" has X-Request-ID "5688e5f0-9e49-4256-bc4c-c3a9fcf3329b"
If I drop the ‘https://’ from the URL, then the connection shows just the user:P@ssw0rd!@123.456.789.101… as the URL - no protocol, and the connection fails the same way - host not found. The full output from the command looks like this:
01-05 12:03:27:627 [ info nextcloud.sync.accessmanager ]: 2 "" "http://https//user:P@ssw0rd!@123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json" has X-Request-ID "5688e5f0-9e49-4256-bc4c-c3a9fcf3329b"
01-05 12:03:27:629 [ info nextcloud.sync.networkjob ]: OCC::JsonApiJob created for "http://https//user:P@ssw0rd!@123.456.789.101/LRJ" + "ocs/v1.php/cloud/capabilities" ""
01-05 12:03:27:692 [ warning nextcloud.sync.networkjob ]: QNetworkReply::HostNotFoundError "Host https not found" QVariant(Invalid)
01-05 12:03:27:692 [ info nextcloud.sync.networkjob.jsonapi ]: JsonApiJob of QUrl("http://https//user:P@ssw0rd!@123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json") FINISHED WITH STATUS "HostNotFoundError Host https not found"
01-05 12:03:27:692 [ warning nextcloud.sync.networkjob.jsonapi ]: Network error: "ocs/v1.php/cloud/capabilities" "Host https not found" QVariant(Invalid)
01-05 12:03:27:692 [ debug default ] [ main(int, char**)::<lambda ]: Server capabilities QJsonObject()
If I use the --user and --password parameters instead, the URL is not mangled, but it also fails to connect with ‘Host requires authentication’:
wmssnm01$ nextcloudcmd --non-interactive --trust --user 'user' --password 'P@ssw0rd' /var/opt/LincolnRadioJournal/ https://123.456.789.101/LRJ
01-05 12:12:29:573 [ info nextcloud.sync.accessmanager ]: 2 "" "https://123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json" has X-Request-ID "347a52f8-8525-4847-9e29-fa6d5b6e5446"
01-05 12:12:29:573 [ info nextcloud.sync.networkjob ]: OCC::JsonApiJob created for "https://123.456.789.101/LRJ" + "ocs/v1.php/cloud/capabilities" ""
01-05 12:12:29:581 [ info nextcloud.sync.account ]: "SSL-Errors happened for url \"https://123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json\" \tError in QSslCertificate(\"3\", \"04:ed:cf:5e:c3:a3:26:91:85:55:81:7c:a5:83:c3:a9:db:83\", \"JDU9+3FpsCj9pkEv5jltDQ==\", \"E6\", \"ingest.wmssfm.com\", QMap((1, \"ingest.wmssfm.com\")), QDateTime(2024-12-13 01:32:22.000 UTC Qt::UTC), QDateTime(2025-03-13 01:32:21.000 UTC Qt::UTC)) : \"The host name did not match any of the valid hosts for this certificate\" ( \"The host name did not match any of the valid hosts for this certificate\" ) \n " Certs are known and trusted! This is not an actual error.
01-05 12:12:30:732 [ warning nextcloud.sync.networkjob ]: QNetworkReply::AuthenticationRequiredError "Host requires authentication" QVariant(int, 401)
01-05 12:12:30:732 [ info nextcloud.sync.networkjob.jsonapi ]: JsonApiJob of QUrl("https://123.456.789.101/LRJ/ocs/v1.php/cloud/capabilities?format=json") FINISHED WITH STATUS "AuthenticationRequiredError Host requires authentication"
01-05 12:12:30:732 [ warning nextcloud.sync.networkjob.jsonapi ]: Network error: "ocs/v1.php/cloud/capabilities" "Host requires authentication" QVariant(int, 401)
01-05 12:12:30:732 [ debug default ] [ main(int, char**)::<lambda ]: Server capabilities QJsonObject()
Error connecting to server
wmssnm01$
Not the SSL cert failure is expected, as the cert is for the public FQDN of the server, not the internal address - and I am having an issue with splitting the DNS at the moment, but unrelated to this (other clients connect just fine internally).
Steps to replicate it (hint: details matter!):
- run the nextcloudcmd shown in the issue description above.
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.
{"reqId":"Z3q9xLxmPtG1SpDLmTMylAAAAAc","level":2,"time":"2025-01-05T17:13:41+00:00","remoteAddr":"192.168.92.141","user":"--","app":"core","method":"GET","url":"/LRJ/ocs/v1.php/cloud/capabilities?format=json","message":"Login failed: 'LRJ' (Remote IP: '192.168.92.141')","userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)","version":"30.0.4.1","data":{"app":"core"},"id":"677ac4f148b1f"}
{"reqId":"Z3q9mxK7EoK-utbZ20U0gwAAAAA","level":2,"time":"2025-01-05T17:13:00+00:00","remoteAddr":"192.168.92.141","user":"--","app":"core","method":"GET","url":"/LRJ/ocs/v1.php/cloud/capabilities?format=json","message":"Login failed: 'LRJ' (Remote IP: '192.168.92.141')","userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)","version":"30.0.4.1","data":{"app":"core"},"id":"677ac4f148b27"}
{"reqId":"Z3q9xLxmPtG1SpDLmTMylAAAAAc","level":2,"time":"2025-01-05T17:13:41+00:00","remoteAddr":"192.168.92.141","user":"--","app":"core","method":"GET","url":"/LRJ/ocs/v1.php/cloud/capabilities?format=json","message":"Login failed: 'LRJ' (Remote IP: '192.168.92.141')","userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)","version":"30.0.4.1","data":{"app":"core"},"id":"677ac4e754c15"}
{"reqId":"Z3q9xLxmPtG1SpDLmTMylAAAAAc","level":2,"time":"2025-01-05T17:13:41+00:00","remoteAddr":"192.168.92.141","user":"--","app":"core","method":"GET","url":"/LRJ/ocs/v1.php/cloud/capabilities?format=json","message":"Login failed: 'LRJ' (Remote IP: '192.168.92.141')","userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)","version":"30.0.4.1","data":{"app":"core"},"id":"677ac4f148b1f"}
Web Browser
If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.
[Not Applicable]
Web server / Reverse Proxy
The output of your Apache/nginx/system log in /var/log/____
:
ingest.wmssfm.com:443 123.456.789.101 - LincolnRadio [05/Jan/2025:11:27:07 -0500] "GET /remote.php/dav/files/LincolnRadio/LRJ/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 401 4863 "-" "Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)"
ingest.wmssfm.com:443 123.456.789.101 - LRJ [05/Jan/2025:12:12:59 -0500] "GET /LRJ/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 401 4282 "-" "Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)"
ingest.wmssfm.com:443 123.456.789.101 - LRJ [05/Jan/2025:12:13:40 -0500] "GET /LRJ/ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 401 4280 "-" "Mozilla/5.0 (Linux) mirall/3.1.1-2+deb11u1 (Nextcloud)"
(These are the only entries in the Apache ‘other_vhosts_access.log’ that are for this client. The access.log file does not contain anything for this host/user, nor does error.log file.)
Configuration
Nextcloud
The output of occ config:list system
or similar is best, but, if not possible, the contents of your config.php
file from /path/to/nextcloud
is fine (make sure to remove any identifiable information!):
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"192.168.92.29",
"nextcloud.wmssfm.com",
"ingest.wmssfm.com",
"108.11.218.172"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"enable-previews": false,
"dbtype": "mysql",
"version": "30.0.4.1",
"overwrite.cli.url": "http:\/\/localhost",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"maintenance_window_start": 1,
"maintenance": false,
"default_phone_region": "US",
"knowledgebaseenabled": true,
"session_lifetime": 86400,
"session_keepalive": true,
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"timeout": 0
},
"memcache.local": "\\OC\\Memcache\\APCu",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"mail_sendmailmode": "smtp",
"app_install_overwrite": [
"admin_notifications"
]
}
}
Thanks in advance for any assistance provided!