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

Bug: Subscription ID already exists #2501

Closed
cholzer79 opened this issue Sep 26, 2023 · 21 comments
Closed

Bug: Subscription ID already exists #2501

cholzer79 opened this issue Sep 26, 2023 · 21 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@cholzer79
Copy link

Describe the bug

Since yesterday my Onedrive Docker throws the error that the Subscription ID already exists.

Operating System Details

unraid 6.12.4
docker: driveone/onedrive

Client Installation Method

From Source

OneDrive Account Type

Personal

What is your OneDrive Application Version

driveone/onedrive:latest also tested driveone/onedrive:edge

What is your OneDrive Application Configuration

log_dir = "/onedrive/conf/"
check_nomount = "true"
check_nosync = "true"
enable_logging = "true"
sync_dir_permissions = "777"
sync_file_permissions = "777"
webhook_enabled = "true"
webhook_public_url = "https://odwhc.holzers.win/webhooks/chris"
webhook_listening_port = "8888"

What is your 'curl' version

docker

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

docker

What are all your local file system partition types

docker

How do you use 'onedrive'

docker in unraid 6.12.4

Steps to reproduce the behaviour

launch the docker

Complete Verbose Log Output

2023-Sep-26 11:27:42.5104818	[DEBUG] Testing network to ensure network connectivity to Microsoft OneDrive Service
2023-Sep-26 11:27:42.5175589	[DEBUG] Attempting to contact online service
2023-Sep-26 11:27:42.637326	[DEBUG] Shutting down HTTP engine as successfully reached OneDrive Online Service
2023-Sep-26 11:27:42.6383093	Checking Application Version ...
2023-Sep-26 11:27:42.7523857	[DEBUG] applicationVersion:       2.4.25
2023-Sep-26 11:27:42.7529727	[DEBUG] latestVersion:            2.4.25
2023-Sep-26 11:27:42.7533218	[DEBUG] publishedDate:            2023-Jun-21 05:30:55Z
2023-Sep-26 11:27:42.7535557	[DEBUG] currentTime:              2023-Sep-26 09:27:42Z
2023-Sep-26 11:27:42.7538682	[DEBUG] releaseGracePeriod:       2023-Jul-21 05:30:55Z
2023-Sep-26 11:27:42.7540712	Initializing the OneDrive API ...
2023-Sep-26 11:27:42.754272	Configuring Global Azure AD Endpoints
2023-Sep-26 11:27:42.7545066	[DEBUG] Configured authUrl:          https://login.microsoftonline.com/common/oauth2/v2.0/authorize
2023-Sep-26 11:27:42.7546959	[DEBUG] Configured redirectUrl:      https://login.microsoftonline.com/common/oauth2/nativeclient
2023-Sep-26 11:27:42.7548835	[DEBUG] Configured tokenUrl:         https://login.microsoftonline.com/common/oauth2/v2.0/token
2023-Sep-26 11:27:42.7550958	[DEBUG] Configured driveUrl:         https://graph.microsoft.com/v1.0/me/drive
2023-Sep-26 11:27:42.7553116	[DEBUG] Configured driveByIdUrl:     https://graph.microsoft.com/v1.0/drives/
2023-Sep-26 11:27:42.7555307	[DEBUG] Configured sharedWithMeUrl:  https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
2023-Sep-26 11:27:42.7557626	[DEBUG] Configured itemByIdUrl:      https://graph.microsoft.com/v1.0/me/drive/items/
2023-Sep-26 11:27:42.7559591	[DEBUG] Configured itemByPathUrl:    https://graph.microsoft.com/v1.0/me/drive/root:/
2023-Sep-26 11:27:42.7561936	[DEBUG] Configured siteSearchUrl:    https://graph.microsoft.com/v1.0/sites?search
2023-Sep-26 11:27:42.756464	[DEBUG] Configured siteDriveUrl:     https://graph.microsoft.com/v1.0/sites/
2023-Sep-26 11:27:42.7567057	Using Curl defaults for all HTTP operations
2023-Sep-26 11:27:42.7569992	[DEBUG] clientId    = d50ca740-c83f-4d1b-b616-12c519384f0c
2023-Sep-26 11:27:42.7572797	[DEBUG] companyName = abraunegg
2023-Sep-26 11:27:42.7575503	[DEBUG] appTitle    = OneDrive Client for Linux
2023-Sep-26 11:27:42.757979	Opening the item database ...
2023-Sep-26 11:27:42.7582986	[DEBUG] Using database file: /onedrive/conf/items.sqlite3
2023-Sep-26 11:27:42.7604776	[DEBUG] Configuring default new folder permissions as: 777
2023-Sep-26 11:27:42.7607703	[DEBUG] Configuring default new file permissions as: 777
2023-Sep-26 11:27:42.7610051	All operations will be performed in: /onedrive/data
2023-Sep-26 11:27:42.761434	[DEBUG] Configuring skip_dir ...
2023-Sep-26 11:27:42.7616736	[DEBUG] skip_dir: 
2023-Sep-26 11:27:42.7619268	[DEBUG] Configuring skip_dir_strict_match ...
2023-Sep-26 11:27:42.7621976	[DEBUG] skip_dir_strict_match: false
2023-Sep-26 11:27:42.7624334	[DEBUG] Configuring skip_dotfiles ...
2023-Sep-26 11:27:42.7626658	[DEBUG] skip_dotfiles: false
2023-Sep-26 11:27:42.7629174	[DEBUG] Configuring skip_file ...
2023-Sep-26 11:27:42.7631801	[DEBUG] skip_file: ~*|.~*|*.tmp
2023-Sep-26 11:27:43.2004052	[DEBUG] Setting file permissions for: /onedrive/conf/refresh_token
2023-Sep-26 11:27:43.2008548	[DEBUG] Request URL = https://graph.microsoft.com/v1.0/me/drive
2023-Sep-26 11:27:43.476277	[DEBUG] Request URL = https://graph.microsoft.com/v1.0/me/drive/root
2023-Sep-26 11:27:43.6164961	[DEBUG] OneDrive Account Details:      {"@odata.context":"https:\/\/graph.microsoft.com\/v1.0\/$metadata#drives\/$entity","driveType":"personal","id":"8a6dc48d52df7fda","owner":{"user":{"displayName":"Christian Holzer","id":"8a6dc48d52df7fda"}},"quota":{"deleted":1515180312,"remaining":1115156381696,"state":"normal","storagePlanInformation":{"upgradeAvailable":false},"total":1185410973696,"used":70254592000}}
2023-Sep-26 11:27:43.6185387	[DEBUG] OneDrive Account Root Details: {"@odata.context":"https:\/\/graph.microsoft.com\/v1.0\/$metadata#users('c.holzer%40live.at')\/drive\/root\/$entity","cTag":"adDo4QTZEQzQ4RDUyREY3RkRBITExNC42MzgzMTMxNjI3ODUzNzAwMDA","createdBy":{"user":{"displayName":"Christian Holzer","id":"8a6dc48d52df7fda"}},"createdDateTime":"2010-07-09T07:18:58.447Z","eTag":"aOEE2REM0OEQ1MkRGN0ZEQSExMTQuNzY","fileSystemInfo":{"createdDateTime":"2010-07-09T07:18:58.446Z","lastModifiedDateTime":"2023-06-11T10:54:07.38Z"},"folder":{"childCount":30,"view":{"sortBy":"name","sortOrder":"ascending","viewType":"thumbnails"}},"id":"8A6DC48D52DF7FDA!114","lastModifiedBy":{"application":{"displayName":"OneDrive website","id":"44048800"},"user":{"displayName":"Christian Holzer","id":"8a6dc48d52df7fda"}},"lastModifiedDateTime":"2023-09-26T09:11:18.537Z","name":"root","parentReference":{"driveId":"8a6dc48d52df7fda","driveType":"personal"},"root":{},"size":69400219432,"webUrl":"https:\/\/onedrive.live.com\/?cid=8a6dc48d52df7fda"}
2023-Sep-26 11:27:43.6189425	Application version: v2.4.25-11-g4a60654
2023-Sep-26 11:27:43.6192013	Account Type: personal
2023-Sep-26 11:27:43.6194876	Default Drive ID: 8a6dc48d52df7fda
2023-Sep-26 11:27:43.6196786	Default Root ID: 8A6DC48D52DF7FDA!114
2023-Sep-26 11:27:43.6199394	Remaining Free Space: 1115156381696
2023-Sep-26 11:27:43.6202135	Fetching details for OneDrive Root
2023-Sep-26 11:27:43.620424	[DEBUG] Request URL = https://graph.microsoft.com/v1.0/me/drive/root
2023-Sep-26 11:27:43.714789	OneDrive Root exists in the database
2023-Sep-26 11:27:43.7153179	Initializing the Synchronization Engine ...
2023-Sep-26 11:27:43.7159068	Initializing monitor ...
2023-Sep-26 11:27:43.7163124	OneDrive monitor interval (seconds): 300
2023-Sep-26 11:27:43.7167466	[DEBUG] Calling add() for this dirname: .
2023-Sep-26 11:27:43.7170215	[DEBUG] inotify_add_watch successfully added for: .
2023-Sep-26 11:27:43.7173778	Monitor directory: .
2023-Sep-26 11:27:43.717863	[DEBUG] Calling addRecursive() for this directory: ./Bilder
2023-Sep-26 11:27:43.7181234	[DEBUG] skip_dir evaluation for: /Bilder
2023-Sep-26 11:27:43.7183386	[DEBUG] No Strict Matching Enforced
2023-Sep-26 11:27:43.7185992	[DEBUG] Calling add() for this dirname: ./Bilder
2023-Sep-26 11:27:43.7188151	[DEBUG] inotify_add_watch successfully added for: ./Bilder
2023-Sep-26 11:27:43.7190344	Monitor directory: ./Bilder
2023-Sep-26 11:27:43.7194561	[DEBUG] Calling addRecursive() for this directory: ./Bilder/Eigene Aufnahmen
2023-Sep-26 11:27:43.7196636	[DEBUG] skip_dir evaluation for: /Bilder/Eigene Aufnahmen
2023-Sep-26 11:27:43.719893	[DEBUG] No Strict Matching Enforced
2023-Sep-26 11:27:43.7202156	[DEBUG] Calling add() for this dirname: ./Bilder/Eigene Aufnahmen
2023-Sep-26 11:27:43.7204661	[DEBUG] inotify_add_watch successfully added for: ./Bilder/Eigene Aufnahmen
2023-Sep-26 11:27:43.7206951	Monitor directory: ./Bilder/Eigene Aufnahmen

2023-Sep-26 11:27:44.5695875	Initializing subscription for updates ...
2023-Sep-26 11:27:45.4766561	ERROR: Microsoft OneDrive API returned an error with the following message:
2023-Sep-26 11:27:45.4772176	  Error Message:    HTTP request returned status code 409 (Conflict)
2023-Sep-26 11:27:45.4775438	[DEBUG] Raw Error Data: HTTP request returned status code 409 (Conflict)
{
    "error": {
        "code": "ObjectIdentifierInUse",
        "innerError": {
            "client-request-id": "615af209-467a-4ab7-8eff-27c1d1efbc2d",
            "date": "2023-09-26T09:27:45",
            "request-id": "615af209-467a-4ab7-8eff-27c1d1efbc2d"
        },
        "message": "Subscription Id c0bba80e-57a3-43a7-bac2-e6f525a76e7c already exists for the requested combination"
    }
}
2023-Sep-26 11:27:45.478451	[DEBUG] JSON Message: {"error":{"code":"ObjectIdentifierInUse","innerError":{"client-request-id":"615af209-467a-4ab7-8eff-27c1d1efbc2d","date":"2023-09-26T09:27:45","request-id":"615af209-467a-4ab7-8eff-27c1d1efbc2d"},"message":"Subscription Id c0bba80e-57a3-43a7-bac2-e6f525a76e7c already exists for the requested combination"}}
2023-Sep-26 11:27:45.4788614	  Error Reason:     Subscription Id c0bba80e-57a3-43a7-bac2-e6f525a76e7c already exists for the requested combination
2023-Sep-26 11:27:45.4791233	  Error Timestamp:  2023-09-26T09:27:45
2023-Sep-26 11:27:45.4793682	  API Request ID:   615af209-467a-4ab7-8eff-27c1d1efbc2d
2023-Sep-26 11:27:45.4796554	  Calling Function: createSubscription()

2023-Sep-26 11:27:45.4798751	ERROR: Unable to initialize subscriptions for updates. Please fix this issue.
2023-Sep-26 11:27:46.0325755	[DEBUG] Testing network to ensure network connectivity to Microsoft OneDrive Service
2023-Sep-26 11:27:46.0401462	[DEBUG] Attempting to contact online service
2023-Sep-26 11:27:46.1674872	[DEBUG] Shutting down HTTP engine as successfully reached OneDrive Online Service

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@cholzer79 cholzer79 added the Bug Something isn't working label Sep 26, 2023
@cholzer79
Copy link
Author

cholzer79 commented Sep 26, 2023

As discussed in the other thread, I spun up a Vm with Debian 12.
I installed OneDrive from source - using the same config/account I can reproduce the exact same issue "Subscription ID already exists" on that VM once I enable the webhook.

I even went as far as to creating an entirely new public facing subdomain for that VM - does not change a thing.

@abraunegg
Copy link
Owner

@cholzer79

I installed OneDrive from source - using the same config/account I can reproduce the exact same issue "Subscription ID already exists" on that VM once I enable the webhook.

OK that is great - that means this is highly reproducible for you.

In this Debian 12 system where you self-compiled the application, please can you test the following PR. Whilst the checks that I have done is simply a compile - I cannot test the logic.

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2502/head:pr2502
git checkout pr2502

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

When running the PR, your version should be: onedrive v2.4.25-12-gf3dce7b or greater.

@cholzer79
Copy link
Author

Good morning from Austria!

This is getting weird.

I thought just for fun I try to startup my OneDriver docker container on unraid which threw the error yesterday.

And today it just works again.... O.o

# Launching onedrive
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 300
Initializing subscription for updates ...
Webhook: handled validation request
Starting a sync with OneDrive
Syncing changes and items from OneDrive ...
Performing a database consistency and integrity check on locally stored data due to fullscan requirement ... 
Sync with OneDrive is complete

The 2nd container which syncs my wife's account still throws the error. But I will probably not be able to test your PR with her account right now because I need her phone for the 2FA.
I will get back to you.

@cholzer79
Copy link
Author

cholzer79 commented Sep 27, 2023

Okay, I got my wife to tell me the 2FA code over the phone.

Using that I setup the onedrive PR build on the debian VM, and it appears to work!

(dmd-2.105.2)root@onedrive:~/onedrive# ./onedrive --monitor --verbose
Using 'user' Config Dir: /root/.config/onedrive
Using 'system' Config Dir: /etc/onedrive
Configuration file successfully loaded
Checking Application Version ...
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Using Curl defaults for all HTTP operations
Opening the item database ...
All operations will be performed in: /root/OneDrive
Application version: v2.4.25-12-gf3dce7b
Account Type: personal
Default Drive ID: c4af24b5d81d8c3c
Default Root ID: C4AF24B5D81D8C3C!103
Remaining Free Space: 1104041476096
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 300
Monitor directory: .
Monitor directory: ./Bilder
Monitor directory: ./Bilder/Collage
Monitor directory: ./Bilder/Eigene Aufnahmen
Monitor directory: ./Bilder/Eigene Aufnahmen/2020
Monitor directory: ./Bilder/Screenshots
Monitor directory: ./Bilder/Download
Initializing subscription for updates ...
Webhook: handled validation request
Starting a sync with OneDrive
Syncing changes and items from OneDrive ...
Applying changes of Path ID: C4AF24B5D81D8C3C!103
Updated Remaining Free Space: 1103997985607
Processing 210 OneDrive items to ensure consistent local state

So.... I then stopped that VM, went back to unraid, fired up her OneDrive container which threw the error just 15minutes earlier... and that now works again as well O.o

# Launching onedrive
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 300
Initializing subscription for updates ...
Webhook: handled validation request
Starting a sync with OneDrive
Syncing changes and items from OneDrive ...

Does this make any sense to you?

@cholzer79
Copy link
Author

cholzer79 commented Sep 27, 2023

Now I get the error again on my account.

This is with your PR using the following conf:

sync_dir = "~/OneDrive"
sync_dir_permissions = "777"
sync_file_permissions = "777"
webhook_enabled = "true"
webhook_public_url = "https://odlxc.XY.com"
webhook_listening_port = "8887"

machine has a static IP of 192.168.1.7 to which the cloudflare tunnel points https://odlxc.XY.com

Webhook: handled validation request
The OneDrive API reported that the Subscription ID already exists for the requested combination, thus generating a conflict
The Subscription ID that is in conflict is: 4d21d684-1e1f-401e-b002-052d5e892ef6
Attempting to delete the conflict Subscription ID
Deleted the conflict Subscription ID
Initializing subscription for updates ...
Webhook: handled validation request
Deleted subscription
std.json.JSONException@std/json.d(315): JSONValue is not an object
----------------
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:518 pure @safe noreturn std.exception.bailOut!(std.json.JSONException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x5591c376d980]
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:439 pure @safe bool std.exception.enforce!(std.json.JSONException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x5591c376d8fb]
??:? inout pure @property @trusted inout(std.json.JSONValue[immutable(char)[]]) std.json.JSONValue.objectNoRef() [0x5591c382925d]
??:? inout pure ref @safe inout(std.json.JSONValue) std.json.JSONValue.opIndex(return scope immutable(char)[]) [0x5591c3829460]
src/onedrive.d:1075 void onedrive.OneDriveApi.createSubscription() [0x5591c37ab0cb]
src/onedrive.d:1015 void onedrive.OneDriveApi.createOrRenewSubscription() [0x5591c37aabf7]
src/main.d:1552 _Dmain [0x5591c379fc9b]
std.net.curl.CurlException@std/net/curl.d(4401): A libcurl function was given a bad argument on handle null
----------------
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:518 pure @safe noreturn std.exception.bailOut!(std.net.curl.CurlException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x5591c377a91b]
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:439 pure @safe bool std.exception.enforce!(std.net.curl.CurlException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x5591c377a88f]
??:? void std.net.curl.Curl._check(int) [0x5591c3851281]
??:? void std.net.curl.Curl.clear(etc.c.curl.CurlOption) [0x5591c3851636]
??:? void std.net.curl.HTTP.clearRequestHeaders() [0x5591c384f3bb]
src/onedrive.d:500 void onedrive.OneDriveApi.shutdown() [0x5591c37a83e1]
src/main.d:84 _Dmain [0x5591c37a0808]

Let me explain how I setup the docker containers on unraid (this has been running for well over a year with no issue).

Mine:
Static IP 192.168.1.91
Cloudflare tunnel odc.XY.com pointing to 192.168.1.91

conf:
sync_dir_permissions = "777"
sync_file_permissions = "777"
webhook_enabled = "true"
webhook_public_url = "https://odc.XY.com"
webhook_listening_port = "8888"

Wife:
Static IP 192.168.1.92
Cloudflare tunnel oda.XY.com pointing to 192.168.1.92

conf:
sync_dir_permissions = "777"
sync_file_permissions = "777"
webhook_enabled = "true"
webhook_public_url = "https://oda.XY.com"
webhook_listening_port = "8889"

@abraunegg
Copy link
Owner

@cholzer79

So my thoughts here are that I think your Docker setup or configuration is somehow logically messed up somewhere .. potentially Cloud Flare is seeing your traffic as a single entity - and this is where the error is potentially being triggered from.

In terms of the new crash .. will have to try and trace back and update the PR - however the delete does appear to work.

@cholzer79
Copy link
Author

So my thoughts here are that I think your Docker setup or configuration is somehow logically messed up somewhere .. potentially Cloud Flare is seeing your traffic as a single entity - and this is where the error is potentially being triggered from.

Is it possible that there is a "hiccup" on their end?
Because I have not touched these docker containers in months - nor the config of these 2 separate cloudflare tunnels odc.XY.com & oda.XY.com (one for each container)

@abraunegg
Copy link
Owner

@cholzer79
CloudFlare do change things ... potentially worth asking them

@abraunegg
Copy link
Owner

@cholzer79
If this error is still reproducible on your Debian 12 system:

----------------
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:518 pure @safe noreturn std.exception.bailOut!(std.json.JSONException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x5591c376d980]
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:439 pure @safe bool std.exception.enforce!(std.json.JSONException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x5591c376d8fb]
??:? inout pure @property @trusted inout(std.json.JSONValue[immutable(char)[]]) std.json.JSONValue.objectNoRef() [0x5591c382925d]
??:? inout pure ref @safe inout(std.json.JSONValue) std.json.JSONValue.opIndex(return scope immutable(char)[]) [0x5591c3829460]
src/onedrive.d:1075 void onedrive.OneDriveApi.createSubscription() [0x5591c37ab0cb]
src/onedrive.d:1015 void onedrive.OneDriveApi.createOrRenewSubscription() [0x5591c37aabf7]
src/main.d:1552 _Dmain [0x5591c379fc9b]
std.net.curl.CurlException@std/net/curl.d(4401): A libcurl function was given a bad argument on handle null
----------------
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:518 pure @safe noreturn std.exception.bailOut!(std.net.curl.CurlException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x5591c377a91b]
/root/dlang/dmd-2.105.2/linux/bin64/../../src/phobos/std/exception.d:439 pure @safe bool std.exception.enforce!(std.net.curl.CurlException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x5591c377a88f]
??:? void std.net.curl.Curl._check(int) [0x5591c3851281]
??:? void std.net.curl.Curl.clear(etc.c.curl.CurlOption) [0x5591c3851636]
??:? void std.net.curl.HTTP.clearRequestHeaders() [0x5591c384f3bb]
src/onedrive.d:500 void onedrive.OneDriveApi.shutdown() [0x5591c37a83e1]
src/main.d:84 _Dmain [0x5591c37a0808]

Could you please email a debug log (--verbose --verbose output) when this is occurring to assist with further changes to the PR.

@cholzer79
Copy link
Author

cholzer79 commented Sep 27, 2023

@abraunegg e-mail sent. and this is interesting.

When i launched onedrive on the VM it worked fine.
But then I noticed that I can still trigger the "subscription exists" error like this:

  1. ./onedrive --monitor --verbose --verbose
  2. wait a bit for onedrive to start syncing
  3. ctrl+c to end onedrive
  4. IMMEDIATLY ./onedrive --monitor --verbose --verbose

Result: subscription already exists, if you wait a little bit before launching onedrive again the error will not occur.

Does that help? Even though this is different to the initial behaviour where I got the error no matter how long I waited.

note: my 2 docker containers on Unraid are working perfectly fine again - no hiccups there anymore.

@abraunegg
Copy link
Owner

@cholzer79

note: my 2 docker containers on Unraid are working perfectly fine again - no hiccups there anymore.

Thanks for the email + debug log. As this is working again normally, without implementing any change, I am going to hit pause on working on this issue until later in the v2.5.0 development release cycle. Right now I am heavy in updating the documentation to ensure there is feature parity, before starting to run through all usage scenario's again so that an 'alpha-2' can be released for testing.

Given that you also have a good reproducer, when I get back to looking at this I should be able to reproduce this (hopefully).

@cholzer79
Copy link
Author

Given that you also have a good reproducer, when I get back to looking at this I should be able to reproduce this (hopefully).

I will backup the VM, if you need me to do more tests I can restore it easiely. :)

Thank you for your help!

@cholzer79
Copy link
Author

cholzer79 commented Oct 12, 2023

Just want to let you know that it happened again yesterday after I had to restart the server.

  • I then stopped both containers as they were restarting constantly due to "Subscription ID already exists"
  • waited 30 minutes -> started just one of the containers -> same problem "Subscription ID already exists"
  • waited 12 hours -> started both containers -> working fine again

@abraunegg
Copy link
Owner

Just want to let you know that it happened again yesterday after I had to restart the server.

  • I then stopped both containers as they were restarting constantly due to "Subscription ID already exists"
  • waited 30 minutes -> started just one of the containers -> same problem "Subscription ID already exists"
  • waited 12 hours -> started both containers -> working fine again

Given there are no other reports of this sort of issue - I suspect that potentially this is being caused by something in your setup / use / how subscriptions have been configured for your environment.

Could you open a case with Cloudflare at all ? See if there is any sort of inadvertent caching going on?

@cholzer79
Copy link
Author

Could you open a case with Cloudflare at all ? See if there is any sort of inadvertent caching going on?

I will try that.

@cholzer79
Copy link
Author

Good point about caching!

Seems like cloudflare tunnels are cached per default!

I have now used their new cache rules (beta) to set the 2 tunnels used for my 2 ondedrive containers/accounts to bypass all caching.
https://developers.cloudflare.com/cache/how-to/cache-rules/

@Lyncredible
Copy link
Contributor

@abraunegg I ran into the same issue on my single box. My theory is that a previous container didn't properly quit/cleanup.

I created a new PR #2516 to fix this issue and make webhooks more resilient in general. (If you remember, I also created the original webhook support PR #1718)

@abraunegg
Copy link
Owner

@cholzer79 , @Lyncredible

Please can you test the following PR as part of 'onedrive client version v2.5.0-alpha-3' to potentially resolve your issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2520/head:pr2520
git checkout pr2520

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

When running the PR, your version should be: v2.5.0-alpha-3 GitHub version: v2.4.25-16-g158a571 or greater

This version incorporates #2516 into 'alpha-3' - and 'alpha-3' is the version where webhooks has been added back in to the rewrite.

Any confirmation from either of you that:

  • This fixes the issue
  • Webhooks are working in 'alpha-3' but bug still exists would be greatly appreciated

@abraunegg abraunegg added this to the v2.5.0 milestone Oct 19, 2023
@abraunegg abraunegg linked a pull request Oct 19, 2023 that will close this issue
@abraunegg
Copy link
Owner

@cholzer79
Are you able to test the latest v2.5.0 alpha-3 build from PR #2520 ?

This has a number of updates for webhooks and webhook handling. When running the PR, the version should be v2.5.0-alpha-3 GitHub version: v2.4.25-35-g3798e1a

@abraunegg
Copy link
Owner

Marking as fixed as this is embedded in v2.5.0 alpha series code

@abraunegg
Copy link
Owner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Repository owner locked as resolved and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
3 participants