Status.php not found when using command line client

Expected behaviour

Sync between local folder and remote folder

Actual behaviour

[url]/status.php - server replied: Not Found.

Steps to reproduce

  1. Install ownCloud client on headless Linux Server
  2. Follow directions from here to sync: hxxxs://doc.owncloud.com/desktop/next/advanced_usage/command_line_client.html

Server configuration

Operating system: Debian 11

Web server: Apache2

Database: MariaDB/MySql

PHP version: 7.4

ownCloud version: 10.11.0.6

Storage backend (external storage): None (local storage)

Client configuration

Client version: owncloudcmd ownCloud 3.1.0.9872

Operating system: Debian 11

OS language: US English

Qt version used by client package (Linux only, see also Settings dialog): Command line only - client installed on headless server. QT not used with CLI

Client package (From ownCloud or distro) (Linux only): From Owncloud Debian Repository per the instructions here: hxxxs://download.owncloud.com/desktop/ownCloud/stable/latest/linux/download/
(choosing Debian at that page, could not link directly to the Debian page)

Installation path of client: /usr/bin/owncloudcmd

Logs

  1. Client logfile: Unable to locate. If someone can direct me where to find it on a headless install, I will gladly provide it. This is a headless installation - no GUI. The command run is:
    owncloudcmd --trust /tmp/radiopa hxxxs://[user]:[pass]@[server]/remote.php/webdav/Production/RadioPA/News

The response is:
gui.platform: adding plugin directory “/opt/ownCloud/ownCloud/bin/…/lib/x86_64-linux-gnu/plugins”
23-02-03 20:55:59:789 [ warning sync.checkserverjob ]: error: status.php replied 404
23-02-03 20:55:59:789 [ fatal default ]: Failed to resolve hxxxs://[server]/remote.php/webdav/Production/RadioPA/News Error: Error transferring hxxxs://[server]/remote.php/webdav/Production/RadioPA/News/status.php - server replied: Not Found.
Aborted

Note that I am able to connect to the server using another machine with a GUI and the desktop client, using the same credentials, with no issue. The path does exist. It looks like the command line client is asking for a file called ‘status.php’, which is not in that directory. I do know it is connecting to the correct server, as I get an SSL error without the --trust option. The information in the error matches exactly what I would expect - the certificate is for external access to the server instead of internal (different hostname), this connection is internal as is the PC client I also tested with.

An example server log entry from a connection attempt:
{“reqId”:“d2a38cf2-5db7-49ee-9f42-f65d884ec471”,“level”:2,“time”:“2023-02-04T02:05:25+00:00”,“remoteAddr”:“[address]”,“user”:“RadioPANews”,“app”:“no app in context”,“method”:“GET”,“url”:“/remote.php/webdav/Production/RadioPA/News/status.php”,“message”:“File with name Production/RadioPA/News/status.php could not be located”}

If I use the GUI client on another PC, I have no problem putting the file in the same location I am trying to with the command line client. By looking in the data directory on the server, I can confirm the file did sync from the desktop GUI client to the server.

What I am working towards is a script to run via cron that will download the current news file from our provider, put it in a local folder, sync that folder with ownCloud then remove the local file. The folder in ownCloud is also synchronized with the automation system, which monitors the folders for an audio file then imports it according to a defined set of rules in the automation system. I can download the file with no problem. The problem comes when I attempt to sync to ownCloud to put the file there for automation to grab.

I have tried a number of things related to the path;
/remote.php/webdav/production/radiopa/news
/remote.php/webdav/production/radiopa/news/
/remote.php/webdav/Production/RadioPA/News (capitalization matches the folder appearance in the web interface or a GUI client)
/remote.php/webdav/Production/RadioPA/News/

All return the same error - the path I supply with status.php tacked on the end and a not found message.

If you would like additional information, please ask. I am going to ask that you also be specific, as this is my first foray into using a headless box with the client. Also, note that the client is actually on the ownCloud server - attempts using localhost instead of the IP address in the server URL have the same result.

I am guessing that writing the file directly to the appropriate directory in /data/ would be ill advised and not work. Of course, if it would work, I can ditch the client and do it that way. I would prefer to get the client to work, as eventually this portion will move to a different server (still headless, still Debian 11) and I would like to be able to simple move the script and configure cron on that box to run it.

With 3.0+, you need to split-up the server URL and the remote path.

/Applications/owncloud.app/Contents/MacOS/owncloudcmd \
~/tmp/Hacker-Songs \
https://test:test@demo.owncloud.com/ \
Test

This syncs the lokal folder ~/tmp/Hacker-Songs to the remote folder Test.

You can capture the log output like this:

/Applications/owncloud.app/Contents/MacOS/owncloudcmd \
~/tmp/Hacker-Songs \
https://test:test@demo.owncloud.com/ \
Test --logdebug > ~/tmp/owncloudcmd.log
1 Like

Ah, found something…

Old WebDAV route (/remote.php/webdav/) no longer supported in 3.0+. Please use the new one (/remote.php/dav/files/[user]/)

See The 3.0 cmd client no longer accepts legacy urls in the form of https://demo.owncloud.com/remote.php/webdav/ · Issue #279 · owncloud/docs-client-desktop · GitHub

This should work too:

owncloudcmd --trust \
/tmp/radiopa \
hxxxs://[user]:[pass]@[server]/remote.php/dav/files/[user]/Production/RadioPA/News
2 Likes

Sorry for the delay in replying, had a few larger fires to put out first (this is not yet in production - but we want it there!)

I tried the last form (the paths have changed, though, due to a change needed for our automation system). The user is the same, but the location on the local machine changed.

Trying the dav route:
owncloudcmd --trust -u [user] -p [pass] /var/opt/radiopa/news http://192.168.92.29/remote.php/dav/files/[user]/news

I was going to post that I was still getting a failure until I started to look at the output to grab an example of the failure. Saw a message about an unsupported redirect. Looking back at what I used, I realized I was missing the ‘s’ in https. This version worked fine:

owncloudcmd --trust -u [user] -p [pass] /var/opt/radiopa/news https://192.168.92.29/remote.php/dav/files/[user]/news

I guess specifying SSL helps…that was not the original problem - that was still an issue until I got the format correct.

Now that this part is done, time to get some shell scripting working to automagically pull the file from the service and stage it for upload.

Thanks for the help!

I am having issues with using the new /remote.php/dav path on Windows

This is the command I am using which I believe to be the correct path

C:"Program Files (x86)"\ownCloud\owncloudcmd C:\Users\IAlab-script\ownCloud\Scripts https://ownCloud.User:[password]@owncloud.domain/remote.php/dav/files/owncloud.user/Scripts

This is the errors that are returned
[ info sync.networkjob.propfind ]: LSCOL of QUrl(“https://owncloud.domain/remote.php/dav/files/owncloud.user/Scripts/”) FINISHED WITH STATUS “ContentNotFoundError, Server replied "404 Not Found" to "PROPFIND https://owncloud.domain/remote.php/dav/files/owncloud.user/Scripts/\”"
23-03-20 11:38:42:747 [ warning sync.discovery ]: LSCOL job error “Error transferring https://owncloud.domain/remote.php/dav/files/owncloud.user/Scripts/ - server replied: Not Found” 404 QNetworkReply::ContentNotFoundError
23-03-20 11:38:42:763 [ warning sync.discovery ]: Server error in directory “” 404
23-03-20 11:38:42:778 [ warning default ]: Sync error: “Server replied with an error while reading directory ‘/’ : Error transferring https://owncloud.domain/remote.php/dav/files/owncloud.user/Scripts/ - server replied: Not Found”
23-03-20 11:38:42:810 [ info sync.engine ]: Sync run took 199 ms
23-03-20 11:38:42:810 [ warning default ]: Failed to sync

@Ericreeses folder /Scripts already present? I wasn’t able to reproduce:

% /Applications/owncloud.app/Contents/MacOS/owncloudcmd /Users/michaelstingl/ownCloud/Scripts https://test:test@demo.owncloud.com/remote.php/dav/files/test/Scripts
23-03-21 13:24:34:766 [ info sync.checkserverjob ]:	status.php returns:  QJsonDocument({"edition":"Enterprise","installed":true,"maintenance":false,"needsDbUpgrade":false,"product":"ownCloud","productname":"ownCloud","version":"10.12.0.6","versionstring":"10.12.0"})   QNetworkReply::NoError  Reply:  QNetworkReplyHttpImpl(0x600003c35360)
23-03-21 13:24:34:768 [ info sync.networkjob ]:	Created OCC::JsonApiJob(OCC::Account("test@demo.owncloud.com"), "https://demo.owncloud.com/ocs/v1.php/cloud/capabilities?format=json", "GET", Original-Request-ID: "912f5300-2c3d-4d73-ae6b-56dd8196e09a", X-Request-ID: "912f5300-2c3d-4d73-ae6b-56dd8196e09a") for QObject(0x0)
23-03-21 13:24:34:963 [ info sync.networkjob.jsonapi ]:	JsonJob of QUrl("https://demo.owncloud.com/ocs/v1.php/cloud/capabilities?format=json") FINISHED WITH STATUS "OK"
23-03-21 13:24:34:969 [ debug default ]	[ (int, char **)::(anonymous class)::operator()():: ]:	Server capabilities QJsonObject({"checksums":{"preferredUploadType":"SHA1","supportedTypes":["SHA1"]},"core":{"pollinterval":30000,"status":{"edition":"Enterprise","hostname":"owncloud","installed":true,"maintenance":false,"needsDbUpgrade":false,"product":"ownCloud","productname":"ownCloud","version":"10.12.0.6","versionstring":"10.12.0"},"support-url-signing":true,"webdav-root":"remote.php/webdav"},"dav":{"chunking":"1.0","propfind":{"depth_infinity":false},"reports":["search-files"],"trashbin":"1.0"},"files":{"bigfilechunking":true,"blacklisted_files":[".htaccess"],"blacklisted_files_regex":"\\.(part|filepart)$","favorites":true,"file_locking_enable_file_action":false,"file_locking_support":true,"privateLinks":true,"privateLinksDetailsParam":true,"undelete":true,"versioning":true},"files_sharing":{"api_enabled":true,"auto_accept_share":true,"can_share":true,"default_permissions":31,"federation":{"incoming":true,"outgoing":true},"group":{"expire_date":{"enabled":false}},"group_sharing":true,"providers_capabilities":{"ocFederatedSharing":{"remote":["shareExpiration"]},"ocinternal":{"group":["shareExpiration"],"link":["shareExpiration","passwordProtected"],"user":["shareExpiration"]}},"public":{"can_create_public_link":true,"defaultPublicLinkShareName":"Public link","enabled":true,"expire_date":{"enabled":false},"multiple":true,"password":{"enforced":false,"enforced_for":{"read_only":false,"read_write":false,"read_write_delete":false,"upload_only":false}},"roles_api":true,"send_mail":false,"social_share":true,"supports_upload_only":true,"upload":true},"remote":{"expire_date":{"enabled":false}},"resharing":true,"search_min_length":2,"share_with_group_members_only":true,"share_with_membership_groups_only":true,"user":{"expire_date":{"enabled":false},"profile_picture":true,"send_mail":false},"user_enumeration":{"enabled":true,"group_members_only":false}},"guests_v1":{"enabled":true},"notifications":{"ocs-endpoints":["list","get","delete"]},"password_policy":{"password_requirements":{"configuration":{"lower_case":{"generate_from":{"characters":"abcdefghijklmnopqrstuvwxyz"}},"numbers":{"generate_from":{"characters":"1234567890"}},"special_characters":{"generate_from":{"any":true}},"upper_case":{"generate_from":{"characters":"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}}}}}})
23-03-21 13:24:34:970 [ info sync.networkjob ]:	Created OCC::JsonApiJob(OCC::Account("test@demo.owncloud.com"), "https://demo.owncloud.com/ocs/v1.php/cloud/user?format=json", "GET", Original-Request-ID: "67b3c3ea-daa2-4e74-a0cb-345d1f130804", X-Request-ID: "67b3c3ea-daa2-4e74-a0cb-345d1f130804") for QObject(0x0)
23-03-21 13:24:35:146 [ info sync.networkjob.jsonapi ]:	JsonJob of QUrl("https://demo.owncloud.com/ocs/v1.php/cloud/user?format=json") FINISHED WITH STATUS "OK"
23-03-21 13:24:35:179 [ info plugins ]:	Created VFS instance from plugin "owncloudsync_vfs_off"
23-03-21 13:24:35:182 [ info sync.engine ]:	There are "38 GB" available at "/Users/michaelstingl/ownCloud/Scripts/"
23-03-21 13:24:35:182 [ info sync.engine ]:	New sync (no sync journal exists)
23-03-21 13:24:35:182 [ info sync.engine ]:	Using Qt  5.15.5  SSL library  "OpenSSL 1.1.1q  5 Jul 2022"  on  "macOS 13.2"
23-03-21 13:24:35:186 [ info sync.database ]:	sqlite3 version "3.36.0"
23-03-21 13:24:35:186 [ info sync.database ]:	sqlite3 locking_mode= "exclusive"
23-03-21 13:24:35:186 [ info sync.database ]:	sqlite3 journal_mode= "wal"
23-03-21 13:24:35:186 [ info sync.database ]:	sqlite3 synchronous= "NORMAL"
23-03-21 13:24:35:194 [ info sync.database ]:	Forcing remote re-discovery by deleting folder Etags
23-03-21 13:24:35:195 [ info sync.engine ]:	NOT Using Selective Sync
23-03-21 13:24:35:195 [ info sync.engine ]:	#### Discovery start ####################################################
23-03-21 13:24:35:195 [ info sync.engine ]:	Server "10.12.0" 
23-03-21 13:24:35:195 [ info sync.discovery ]:	STARTING "" OCC::ProcessDirectoryJob::NormalQuery "" OCC::ProcessDirectoryJob::NormalQuery
23-03-21 13:24:35:196 [ info sync.networkjob ]:	Created OCC::PropfindJob(OCC::Account("test@demo.owncloud.com"), "https://demo.owncloud.com/remote.php/dav/files/test/Scripts/", "PROPFIND", Original-Request-ID: "0bfb6caa-4792-4ff6-9c80-0424d5f86e1b", X-Request-ID: "0bfb6caa-4792-4ff6-9c80-0424d5f86e1b") for OCC::DiscoverySingleDirectoryJob(0x600001504620)
23-03-21 13:24:35:281 [ info sync.networkjob.propfind ]:	LSCOL of QUrl("https://demo.owncloud.com/remote.php/dav/files/test/Scripts/") FINISHED WITH STATUS "OK"
23-03-21 13:24:35:285 [ info sync.engine ]:	#### Discovery end ####################################################  90 ms
23-03-21 13:24:35:285 [ info sync.engine ]:	#### Reconcile (aboutToPropagate) ####################################################  90 ms
23-03-21 13:24:35:286 [ info sync.engine ]:	#### Reconcile (aboutToPropagate OK) ####################################################  90 ms
23-03-21 13:24:35:286 [ info sync.engine ]:	#### Post-Reconcile end ####################################################  90 ms
23-03-21 13:24:35:286 [ info sync.engine ]:	Sync run took  91 ms
23-03-21 13:24:35:287 [ info sync.database ]:	Closing DB "/Users/michaelstingl/ownCloud/Scripts/.sync_journal.db"

user: test
pw: test

1 Like

Yes the /Scripts dir is present.

I did some additional testing this morning and it seems to only be a issue for LDAP users.

Is anyone else able to confirm issues with owncloudcmd +LDAP users?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.