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

Schedule command with blank password prevents subsequent schedule commands #442

Open
bryankitts opened this issue Dec 10, 2024 · 4 comments

Comments

@bryankitts
Copy link

bryankitts commented Dec 10, 2024

On Windows, if a schedule command is run and a blank (incorrect) user password is entered, the command fails (as expected), but then subsequent schedule commands crash without prompting for a password (see attached output).

> resticprofile schedule --all

Creating task for user PC\User
Task Scheduler requires your Windows password to validate the task: 

[At this point I incorrectly just pressed Enter i.e. blank password]

2024/12/10 17:24:10 error creating job daily/backup: error creating registered task \resticprofile backup\daily backup: 
error registering task: The user name or password is incorrect.

> resticprofile schedule --all
uh-oh! resticprofile crashed miserably :-(
...

schedule_crash.txt

Opening a new command window doesn't resolve it i.e. same crash. I suspect logging off and on will fix it, so it's a very low priority to fix. Rebooting doesn't seem to fix it.

Not sure if the issue is caused by the password entered being blank or just incorrect. (My password is not blank, but I normally use a PIN to log on to Windows which is why I'd forgotten it.)

@bryankitts
Copy link
Author

It seems the incorrect blank password got saved in Windows Credential Manager (as "MicrosoftAccount:user=email_address"). After deleting the entry, resticprofile schedule prompted again for a password and ran successfully.

(I'm logged into Windows using a Microsoft account rather than a local account - not sure if that makes a difference.)

@creativeprojects
Copy link
Owner

creativeprojects commented Dec 12, 2024

Thank you for the crash report.

(it's my first crash report in 5 years 🍾 )

I think saving this password in the Credential Manager is a (fairly?) new feature in Windows, because I never had the issue before (although I no longer use Windows since I changed job about 3 years ago 😆 )

I'll do some tests and see how I can prevent that 👍🏻

@bryankitts
Copy link
Author

bryankitts commented Dec 13, 2024

Thanks for looking at this, and sorry for breaking your 5 year streak!

I'm no longer sure about Credential Manager: the crash has come back (even running 'status --all') and deleting the entry no longer makes any difference, so it may just have been a coincidence.

I've also tried reproducing it under the debugger (VS Code on same PC) with mixed results. Almost every time I run it under the debugger, it completes successfully, but I had one run where I was stepping through some of the code and got exactly the same crash and call-stack.

Also, it has never prompted me for a password under the debugger. It's only ever asked me for a password twice outside the debugger: the very first time I ran it (when I accidentally entered a blank password), and the one time I successfully ran it after deleting the Credential Manager entry, when I entered my password correctly (and it then successfully created entries in Task Scheduler).

In summary, outside the debugger I've had one successful run and many crashes. Inside the debugger I've had one crash and many successful runs.

Let me know if there's anything I can try from my side. (I have dev experience but none with Go or VS Code, so feel free to suggest obvious things!)

@creativeprojects
Copy link
Owner

Thanks for trying this out.

I'll be on Xmas break next week so I'll dig up my old Windows laptop and try to make sense of it 👍🏻

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

2 participants