ChurchCRM / CRM

ChurchCRM is an OpenSource Church CRM & Management Software.
https://ChurchCRM.io
MIT License
635 stars 445 forks source link

Bug: WebDav backup not working #6776

Closed meichthys closed 2 days ago

meichthys commented 10 months ago

Description

This is to re-open https://github.com/ChurchCRM/CRM/issues/5688#issuecomment-1858982106

Entering WebDav credentials, enabling remote backup, and saving backup to remote doesn't seem to save the backup file to the WebDav server: image

Steps To Reproduce

  1. Go to Admin > Edit General Settings > Backup
  2. Update remote settings (use WebDav)
  3. Save
  4. Go To Admin > Backup Database > Generate and Ship Backup to External Storage

Expected behavior Backup file should be saved to remote WebDav server

Debugging Steps The webUI indicates that the backup succeeded: image

However, the file is not saved to WebDav server. App log shows:

[2023-12-26T19:51:42.736422+00:00] defaultLogger.ERROR: Error copying backup: Exception: Error backing up to remote: necessary data rewind wasn't possible in /home/firstb20/church.us-church.org/ChurchCRM/Backup/BackupJob.php:88 Stack trace: #0 /home/firstb20/church.us-church.org/api/routes/system/system-database.php(61): ChurchCRM\Backup\BackupJob->copyToWebDAV('https://nextclo...', 'user', 'password...') #1 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #2 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #3 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array) #4 /home/firstb20/church.us-church.org/ChurchCRM/Slim/Middleware/Request/Auth/BaseAuthRoleMiddleware.php(28): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) #5 [internal function]: ChurchCRM\Slim\Middleware\Request\Auth\BaseAuthRoleMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #6 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ChurchCRM\Slim\Middleware\Request\Auth\AdminRoleAuthMiddleware), Array) #7 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #8 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route)) #9 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #10 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) #11 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response)) #12 /home/firstb20/church.us-church.org/ChurchCRM/Slim/Middleware/VersionMiddleware.php(13): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response)) #13 [internal function]: ChurchCRM\Slim\Middleware\VersionMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #14 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ChurchCRM\Slim\Middleware\VersionMiddleware), Array) #15 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #16 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App)) #17 /home/firstb20/church.us-church.org/ChurchCRM/Slim/Middleware/AuthMiddleware.php(33): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #18 [internal function]: ChurchCRM\Slim\Middleware\AuthMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #19 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ChurchCRM\Slim\Middleware\AuthMiddleware), Array) #20 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #21 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure)) #22 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response)) #23 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response)) #24 /home/firstb20/church.us-church.org/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response)) #25 /home/firstb20/church.us-church.org/api/index.php(83): Slim\App->run() #26 {main} [] {"url":"/api/database/backupRemote","remote_ip":"74.67.79.83","correlation_id":"658b2ecdb7f87"}

Desktop (please complete the following information):

Additional context My suspicion is that this may be related to my shared hosting server. I do not have access to all server settings, so i am somewhat limited in my configuration options. Sorry for the screenshot, but debug shows: image

DAcodedBEAT commented 10 months ago

@meichthys just to fully understand the operating environment, what application/server are you using for WebDAV? It would be nice to have this covered in the docker test environment.

meichthys commented 10 months ago

I'm running Nextcloud v28 (Apache2, PHP8.2, Postgresql 14)

DawoudIO commented 10 months ago

Can you give this a try with the latest version? 5.4.1

DAcodedBEAT commented 10 months ago

@DawoudIO I wouldn't expect this to work with the new code. This code path needs to be vetted more (with CI tests)

meichthys commented 10 months ago

No difference on v5.4.2

DawoudIO commented 10 months ago

Any chance you provide a temp web dev account to test with ?

meichthys commented 10 months ago

@DawoudIO Sure. Could you provide an email to send the credentials to?

DAcodedBEAT commented 10 months ago

@DawoudIO this should probably be developed and added to the test environment. I think we can add https://github.com/drakkan/sftpgo to the docker compose to test against.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 days ago

This issue was closed because it has been stalled for 15 days with no activity.