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

Path on server needs / at beginning when configurations are edited #3460

Closed
aSpeX2009 opened this Issue Oct 26, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@aSpeX2009
Copy link

aSpeX2009 commented Oct 26, 2018

  • I have searched open and closed issues for duplicates.

Environment info

  • Duplicati version: 2.0.3.12_canary_2018-10-23
  • Operating system: Ubuntu 18.04
  • Backend: OneDrive V2

Description

Since the last canary I have to add a "/" to the beginning of "Path on server" when I edit backup-configurations. Otherwise the path is not found, a new database is generated and i get an error-message.
When I add the slash and save the configuration it gets removed the next time I open the config of the backup-job.

Steps to reproduce

  1. Edit backup-configuration without adding a / to the path on server (change time etc.)
  2. Start a backup
  3. Get an error-message
  4. Cry
  5. Add a / to path on server
  6. Repair database
  7. Start backup
  8. Get no error-message
  • Actual result:
    Error-message below
  • Expected result:
    Do a backup without errors

Screenshots

Debug log

Duplicati.Library.Backend.MicrosoftGraph.MicrosoftGraphException: BadRequest: Bad Request error from request https://graph.microsoft.com/v1.0/me/drive/root:Dokumente/Backup/Dokumente:/children Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/me/drive/root:Dokumente/Backup/Dokumente:/children', Version: 1.1, Content: <null>, Headers: { User-Agent: Duplicati/2.0.3.12 Authorization: Bearer ABC...XYZ } StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Cache-Control: private Transfer-Encoding: chunked request-id: 5c82b836-cf43-4914-93ff-339265009bf8 client-request-id: 5c82b836-cf43-4914-93ff-339265009bf8 x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West Europe","Slice":"SliceC","Ring":"5","ScaleUnit":"001","Host":"AGSFE_IN_53","ADSiteName":"WEU"}} Duration: 1.8315 Strict-Transport-Security: max-age=31536000 Date: Fri, 26 Oct 2018 15:56:56 GMT Content-Type: application/json } { "error": { "code": "BadRequest", "message": "Resource not found for the segment 'root:Dokumente'.", "innerError": { "request-id": "5c82b836-cf43-4914-93ff-339265009bf8", "date": "2018-10-26T15:56:56" } } } at Duplicati.Library.Main.BackendManager.List () [0x00049] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.RecreateDatabaseHandler.DoRun (Duplicati.Library.Main.Database.LocalDatabase dbparent, System.Boolean updating, Duplicati.Library.Utility.IFilter filter, Duplicati.Library.Main.Operation.RecreateDatabaseHandler+NumberedFilterFilelistDelegate filelistfilter, Duplicati.Library.Main.Operation.RecreateDatabaseHandler+BlockVolumePostProcessor blockprocessor) [0x00084] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.RecreateDatabaseHandler.Run (System.String path, Duplicati.Library.Utility.IFilter filter, Duplicati.Library.Main.Operation.RecreateDatabaseHandler+NumberedFilterFilelistDelegate filelistfilter, Duplicati.Library.Main.Operation.RecreateDatabaseHandler+BlockVolumePostProcessor blockprocessor) [0x00037] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.RepairHandler.RunRepairLocal (Duplicati.Library.Utility.IFilter filter) [0x000ba] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.RepairHandler.Run (Duplicati.Library.Utility.IFilter filter) [0x00159] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify (Duplicati.Library.Main.BackendManager backend, System.String protectedfile) [0x000cd] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Operation.BackupHandler+<RunAsync>d__19.MoveNext () [0x004fa] in <a699962d1b954fd09198884685231873>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0 at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x00050] in <6973ce2780de4b28aaa2c5ffc59993b1>:0 at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x00008] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Controller+<>c__DisplayClass13_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x00035] in <a699962d1b954fd09198884685231873>:0 at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action1[T] method) [0x0011d] in :0 `

@aSpeX2009 aSpeX2009 changed the title Path on server needs / at beginning when settings are edited Path on server needs / at beginning when configurations are edited Oct 26, 2018

@warwickmm

This comment has been minimized.

Copy link
Contributor

warwickmm commented Oct 27, 2018

I am able to replicate this. I have a fix that will be pushed for review after some more testing.

warwickmm added a commit to warwickmm/duplicati that referenced this issue Oct 27, 2018

Fix slashes in Microsoft Graph URLs.
This fixes an issue introduced in revision f9022fe ("Avoid referencing
virtual members in constructor").

This addresses issue duplicati#3460.
@kees-z

This comment has been minimized.

Copy link

kees-z commented Oct 27, 2018

I can confirm this bug. All backup jobs using the OneDriveV2 backend fail after upgrading to Duplicati 2.0.3.12. When editing the backup job, I notice that the path does not start with a slash. When entering a leading slash, the destination check succeeds, but the backup job fails. When editing the backup job again, the leading slash in the Path field has disappeared.

For the current Canary version, as a workaround, you can enter a double slash at the beginning of the Path field, for example //Backup/Duplicati/MyBackup.
After saving the backup configuration, the first leading slash will be removed from the path, resulting in /Backup/Duplicati/MyBackup and make the backup job work again.

@warwickmm

This comment has been minimized.

Copy link
Contributor

warwickmm commented Oct 27, 2018

Thanks @kees-z. The workaround you mentioned, when applied to the current canary, appears to continue to work even after applying the bugfix in pull request #3462. That's good news, but I wonder if there's a little luck involved. Ideally, users should revert the workaround once the fix has been released. Even better, I shouldn't have introduced this error in the first place. 😞

@Pectojin

This comment has been minimized.

Copy link
Member

Pectojin commented Oct 28, 2018

I've just merged the fix.

I'm hoping someone with appropriate setup can confirm it works before we close this issue.

@warwickmm

This comment has been minimized.

Copy link
Contributor

warwickmm commented Nov 3, 2018

@aSpeX2009, a new canary has been released. If possible, would you be able to verify if this new version fixes the issue?

@aSpeX2009

This comment has been minimized.

Copy link

aSpeX2009 commented Nov 3, 2018

Works perfectly. Slash gets removed when i edit the config, backup works even when config is edited twice without the need to change "Path in server".
Thank you!

@aSpeX2009 aSpeX2009 closed this Nov 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment