Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

405 Error - Related to ownCloud being hosted on URL with a directory #4

Open
liamoreilly opened this issue May 25, 2022 · 1 comment

Comments

@liamoreilly
Copy link

Hi,

I am getting a 405 error when executing this script. The error I get is:

bash-5.1# php restore.php --url=https://xxxxx/owncloud --username="test.user" --password="xxxxx" --date="2022-05-24"

Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/symfony/console/Helper/HelperSet.php on line 94
Collection files to restore
Found 1 files to restore 
ERROR: The requested URL returned error: 405
File ownCloud Manual.pdf restored

I think the deprecated warning can be ignored. What is strange here is that it is correctly identifying the number of files to restore. So the communication seems to be working to some extent.

Any idea on what goes wrong here.

I am using PHP8.1. Our owncloud server is 10.9.1 (stable).

Any help would be appreciated.

Thanks,
Liam

@liamoreilly
Copy link
Author

The issue seems to be that the restore URL is being computed incorrectly.

The value of $trashbinRecord['remoteUrl'] in the function restoreTrashbinData starts with "owncloud" (at least in our setup).

The URL we provide to the script is: https://mydomain.com/owncloud

The value of $trashbinRecord['remoteUrl'] ends up being /owncloud/remote.php/dav/trash-bin/test.user/6542166 which is then combined with $this->URI to form https://mydomain.com/owncloud/owncloud/remote.php/dav/trash-bin/test.user/6542166 (Line 103 of lib/RestoreTrash.php).

I guess the issue is that this script expects ownCloud to be available at the root of the domain. Not sure exactly.

@liamoreilly liamoreilly changed the title 405 Error 405 Error - Related to ownCloud URL being located in directory off a URL May 28, 2022
@liamoreilly liamoreilly changed the title 405 Error - Related to ownCloud URL being located in directory off a URL 405 Error - Related to ownCloud being hosted on URL with a directory May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant