Backup and Restore OC -> Webdav auth failure

Steps to reproduce

  1. Backed up OC with custom script: https://github.com/gtntdev/owncloud-backup-and-restore-client
  2. Wanted to test the backup and restored it to new directory on same server
  3. Switched the cname to new directory. Web login is working, webdav url seems fine when logged in

Expected behaviour

Webdav should work in restored instance

Actual behaviour

Webdav auth failes with asking password over and over again
(no matter what config, old or new, always used new db)

Server configuration

Operating system:

Web server:

Database:

PHP version:

ownCloud version: latest (10.6)

Updated from an older ownCloud or fresh install: updated from 10.5 before backup started

Where did you install ownCloud from: web installer

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
No errors have been found.

The content of config/config.php: https://gist.github.com/gtntdev/8847b5482046bf10d2e7cefb557f0031

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Sorry, I don’t undestand this:

With Webdav you’re referring an API-request? Could you be more precise, or even better, give an example.

1 Like

Hi alfredb,

when I open the browser and call https://owncloud.example.com/remote.php/webdav I’m asked for user and password and authentication fails and I’m asked again and again.
EDIT:
after entering the credentials several times I get following error message:
Unauthorized
No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured

When I now login to the webinterface (https://owncloud.example.com/index.php/login) as user and then call the same page from above in another tab I get following output: “This is the WebDAV interface. It can only be accessed by WebDAV clients such as the ownCloud desktop sync client.” indicating webdav works.

My proplem is, that the Desktop Client can’t connect to the server.
(Same result: when I enter the user and password and confirm I’m told “server access forbidden” and asked again for user and pw)

I also tried to connect to webdav directly from linux file manager: davs://owncloud.example.com/remote.php/dav/files/admin/. I enter user and password and the an alert box appears asking me “Please enter Owncloud Password”.

If you need any further information or log files just let me know.

Best regards,
Lukas

Hi everyone,

I followed the guide at How to fix CalDAV|CardDAV|WebDAV problems and was able to solve the problem on my own. It turns out that there was no .htaccess file in the restore/ dir. Simply copying the old one worked, guess it enabled the header rewrite module.

Still many thanks for anyone thinkink about this problem!
I will continue working on my Backup/Restore client mentioned in the first post (Integreating more tests, supporting ssh key auth and other stuff)

Please mark this thread as solved and close it.

Best, Lukas

2 Likes