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: --dry-run prevents authorization #2451

Closed
derlade opened this issue Jul 18, 2023 · 3 comments
Closed

Bug: --dry-run prevents authorization #2451

derlade opened this issue Jul 18, 2023 · 3 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@derlade
Copy link

derlade commented Jul 18, 2023

Describe the bug

I am not sure if this actually is a bug, but it seems like a minor usability issue to me.

When setting up the client for the first time on a new machine, I instinctively ran it with the --dry-run option as to prevent downloads of unwanted files. This seems to have caused the authorization process to fail with the message

Application has not been successfully authorised. Please check your URI response entry and try again.

Trying in different browsers did not help, but after omitting the --dry-run option the authorization completed successfully. If this is wanted behaviour, I'd suggest modifying the error message to indicate that --dry-run cannot be used during authorization (if this wasn't a malconfiguration on my part, obviously).

Operating System Details

Linux XXX 6.4.3-arch1-2 #1 SMP PREEMPT_DYNAMIC Sat, 15 Jul 2023 19:25:49 +0000 x86_64 GNU/Linux

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Personal

What is your OneDrive Application Version

v2.4.25

What is your OneDrive Application Configuration

default, except for custom skip_file option

What is your 'curl' version

8.1.2

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

will provide, if needed

What are all your local file system partition types

will provide, if needed

How do you use 'onedrive'

Local OneDrive folder, no sync yet (first time authorization)

Steps to reproduce the behaviour

  1. Download the client for the first time
  2. run onedrive --dry-run
  3. Enter response URI
  4. Observe error
  5. run onedrive without options
  6. Enter response URI
  7. Observe successful authentication

Complete Verbose Log Output

Will generate this output if needed.

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@derlade derlade added the Bug Something isn't working label Jul 18, 2023
@abraunegg
Copy link
Owner

@derlade

When setting up the client for the first time on a new machine, I instinctively ran it with the --dry-run option as to prevent downloads of unwanted files. This seems to have caused the authorization process to fail with the message

Unfortunately there is still a lot of poor references out there on the Internet on how to use this client.

Running onedrive or even onedrive --dry-run (regardless of the authentication state) will not allow any data to be downloaded as --synchronize or --monitor is missing from the command .... so regardless of your desire to not have any data downloaded - nothing would have occurred and the application would have generated an error with a message saying this.

Now - why, in a clean | new installed state, does onedrive --dry-run generate the error you got .. it simply is that the file, which is the authentication token, is not being written out, thus cant be found - so the application thinks that the auth process failed, the error is technically correct, but as you point out could be improved.

As such, I will look at this as part of the work I am doing with the v2.5.0 branch, but for now I am going to close this issue as technically it is not a bug - the application is working correctly as intended.

@abraunegg abraunegg added Enhancement New feature or request Not a bug and removed Bug Something isn't working labels Jul 19, 2023
@abraunegg abraunegg added this to the v2.5.0 milestone Jul 19, 2023
@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 Jul 27, 2023
@abraunegg abraunegg reopened this Jan 15, 2024
@abraunegg abraunegg added Bug Something isn't working and removed Enhancement New feature or request Not a bug labels Jan 15, 2024
@abraunegg
Copy link
Owner

@derlade
Apologies for coming back to this one so late, however this has been fixed|improved in 'alpha-5':

[alex@onedrive-client-dev onedrive-v2.5.0-alpha-5]$ ./onedrive --dry-run          
Reading configuration file: /home/alex/.config/onedrive/config
Configuration file successfully loaded

ERROR: Unable to create /var/log/onedrive
ERROR: Please manually create '/var/log/onedrive' and set appropriate permissions to allow write access for your user to this location.
ERROR: The requested client activity log will instead be located in your users home directory

DRY-RUN Configured. Output below shows what 'would' have occurred.
DRY-RUN: Copying items.sqlite3 to items-dryrun.sqlite3 to use for dry run operations
DRY RUN: Not creating backup config file as --dry-run has been used
DRY RUN: Not updating hash files as --dry-run has been used
Using IPv4 and IPv6 (if configured) for all network operations
Configuring Global Azure AD Endpoints

The application requires authorisation, which involves saving authentication data on your system. Note that authorisation cannot be completed with the '--dry-run' option.

To exclusively authorise the application without performing any additional actions, use this command: onedrive

[alex@onedrive-client-dev onedrive-v2.5.0-alpha-5]$ 

As such, closing this item as fixed|implemented.

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
Development

No branches or pull requests

2 participants